id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
25,401 | import com.cronutils.model.field.CronField;</BUG>
import com.cronutils.model.field.expression.Every;
import com.cronutils.model.field.expression.FieldExpression;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.Lists;
<BUG>import org.joda.time.DateTime;
import org.slf4j.Logger;
i... | package com.cronutils.model.time.generator;
import java.time.ZonedDateTime;
import java.util.List;
import com.cronutils.model.field.CronField;
|
25,402 | private static final Logger log = LoggerFactory.getLogger(EveryFieldValueGenerator.class);
public EveryFieldValueGenerator(CronField cronField) {
super(cronField);
log.trace(String.format(
"processing \"%s\" at %s",
<BUG>cronField.getExpression().asString(), DateTime.now()
</BUG>
));
}
@Override
| cronField.getExpression().asString(), ZonedDateTime.now()
|
25,403 | private LocalBroadcastManager mLocalBroadcastManager;
private String mActiveDownloadUrlString;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
<BUG>setContentView(R.layout.activity_app_details2);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);</BUG>
toolbar.set... | setContentView(R.layout.app_details2);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
25,404 | .inflate(R.layout.app_details2_screenshots, parent, false);
return new ScreenShotsViewHolder(view);
} else if (viewType == VIEWTYPE_WHATS_NEW) {
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.app_details2_whatsnew, parent, false);
<BUG>return new WhatsNewViewHolder(view);
} else if (viewType == ... | } else if (viewType == VIEWTYPE_DONATE) {
.inflate(R.layout.app_details2_donate, parent, false);
return new DonateViewHolder(view);
} else if (viewType == VIEWTYPE_LINKS) {
|
25,405 | package jetbrains.mps.ide.actions;
import javax.swing.JCheckBox;
<BUG>import jetbrains.mps.smodel.SNode;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations;
import jetbrains.mps.internal.collections.runtime.ListSequence;</BUG>
import jetbrains.mps.internal.collections.runtime.ISelector;
import jet... | import jetbrains.mps.internal.collections.runtime.ListSequence;
|
25,406 | this.myCheckBox.setSelected(true);
}
public void updateMethod(SNode sourceMethod, SNode method) {
super.updateMethod(sourceMethod, method);
if (this.myCheckBox.isSelected()) {
<BUG>SLinkOperations.addChild(method, "annotation", new _Quotations.QuotationClass_1().createNode());
</BUG>
}
Iterable<SNode> paramList = ListS... | ListSequence.fromList(SLinkOperations.getTargets(method, "annotation", true)).addElement(new _Quotations.QuotationClass_1().createNode());
|
25,407 | package jetbrains.mps.ide.actions;
import javax.swing.JComponent;
import jetbrains.mps.smodel.SNode;
import jetbrains.mps.baseLanguage.behavior.Type_Behavior;
<BUG>import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations;
public class ImplementMethodStrategy extends BaseMethodUpdateStrategy {</BUG>
publ... | import jetbrains.mps.internal.collections.runtime.ListSequence;
public class ImplementMethodStrategy extends BaseMethodUpdateStrategy {
|
25,408 | import java.util.Locale;
import java.util.Map;
import java.util.TreeMap;
public class DependencyConvergenceReport
extends AbstractProjectInfoReport
<BUG>{
private List reactorProjects;
private static final int PERCENTAGE = 100;</BUG>
public String getOutputName()
{
| private static final int PERCENTAGE = 100;
private static final List SUPPORTED_FONT_FAMILY_NAMES = Arrays.asList( GraphicsEnvironment
.getLocalGraphicsEnvironment().getAvailableFontFamilyNames() );
|
25,409 | sink.section1();
sink.sectionTitle1();
sink.text( getI18nString( locale, "title" ) );
sink.sectionTitle1_();
Map dependencyMap = getDependencyMap();
<BUG>generateLegend( locale, sink );
generateStats( locale, sink, dependencyMap );
generateConvergence( locale, sink, dependencyMap );
sink.section1_();</BUG>
sink.body_()... | sink.lineBreak();
sink.section1_();
|
25,410 | Iterator it = artifactMap.keySet().iterator();
while ( it.hasNext() )
{
String version = (String) it.next();
sink.tableRow();
<BUG>sink.tableCell();
sink.text( version );</BUG>
sink.tableCell_();
sink.tableCell();
generateVersionDetails( sink, artifactMap, version );
| sink.tableCell( String.valueOf( cellWidth ) + "px" );
sink.text( version );
|
25,411 | sink.tableCell();
sink.text( getI18nString( locale, "legend.shared" ) );
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableCell();
iconError( sink );</BUG>
sink.tableCell_();
sink.tableCell();
sink.text( getI18nString( locale, "legend.different" ) );
| sink.tableCell( "15px" ); // according /images/icon_error_sml.gif
iconError( sink );
|
25,412 | sink.tableCaption();
sink.text( getI18nString( locale, "stats.caption" ) );
sink.tableCaption_();</BUG>
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.subprojects" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
sink.text( String.valueOf( reactorProjects.size() ) );
s... | sink.bold();
sink.bold_();
sink.tableCaption_();
sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.subprojects" ) );
sink.tableHeaderCell_();
|
25,413 | sink.tableCell();
sink.text( String.valueOf( reactorProjects.size() ) );
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.dependencies" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
sink.text( String.valueOf( depCount ) );
| sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.dependencies" ) );
sink.tableHeaderCell_();
|
25,414 | sink.text( String.valueOf( convergence ) + "%" );
sink.bold_();
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.readyrelease" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
if ( convergence >= PERCENTAGE && snapshotCount <= 0 )
| sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.readyrelease" ) );
sink.tableHeaderCell_();
|
25,415 | {
ReverseDependencyLink p1 = (ReverseDependencyLink) o1;
ReverseDependencyLink p2 = (ReverseDependencyLink) o2;
return p1.getProject().getId().compareTo( p2.getProject().getId() );
}
<BUG>else
{</BUG>
return 0;
}
}
| iconError( sink );
|
25,416 | package me.jessyan.mvparms.demo.app;
<BUG>import com.jess.arms.base.BaseApplication;
import me.jessyan.mvparms.demo.di.component.AppComponent;
import me.jessyan.mvparms.demo.di.component.DaggerAppComponent;
import me.jessyan.mvparms.demo.di.module.ServiceModule;
import me.jessyan.mvparms.demo.mvp.model.api.Api;
public ... | import com.jess.arms.http.GlobeHttpResultHandler;
import me.jessyan.mvparms.demo.di.module.CacheModule;
import timber.log.Timber;
public class WEApplication extends BaseApplication {
|
25,417 | mAppComponent = DaggerAppComponent
.builder()
.appModule(getAppModule())
.clientModule(getClientModule())
.imageModule(getImageModule())
<BUG>.serviceModule(new ServiceModule())
.build();</BUG>
}
@Override
public String getBaseUrl() {
| .cacheModule(new CacheModule())
.build();
|
25,418 | sharedPrefs.edit().putString("chart_timeframe", "" + timeframe).commit();
}
@Override
protected WatchFaceStyle getWatchFaceStyle(){
return new WatchFaceStyle.Builder(this)
<BUG>.setAcceptsTapEvents(true)
.setStatusBarGravity(Gravity.END | -20)</BUG>
.build();
}
@Override
| .setHotwordIndicatorGravity(Gravity.TOP | Gravity.CENTER)
.setStatusBarGravity(Gravity.END | -20)
|
25,419 | return false;
}
@Override
protected WatchFaceStyle getWatchFaceStyle(){
return new WatchFaceStyle.Builder(this)
<BUG>.setAcceptsTapEvents(true)
.setStatusBarGravity(Gravity.END | -20)</BUG>
.build();
}
@Override
| .setHotwordIndicatorGravity(Gravity.TOP | Gravity.END)
.setStatusBarGravity(Gravity.END | -20)
|
25,420 | return (watchMode == WatchMode.LOW_BIT) || (watchMode == WatchMode.LOW_BIT_BURN_IN) || (watchMode == WatchMode.LOW_BIT_BURN_IN);
}
@Override
protected WatchFaceStyle getWatchFaceStyle(){
return new WatchFaceStyle.Builder(this)
<BUG>.setAcceptsTapEvents(true)
.setStatusBarGravity(Gravity.END | -20)</BUG>
.build();
}
pub... | .setHotwordIndicatorGravity(Gravity.TOP | Gravity.CENTER)
.setStatusBarGravity(Gravity.END | -20)
|
25,421 | import android.os.AsyncTask;
import android.os.Bundle;
import android.os.PowerManager;
import android.preference.PreferenceManager;
import android.support.v4.content.LocalBroadcastManager;
<BUG>import android.util.Log;
import com.eveningoutpost.dexdrip.Home;</BUG>
import com.eveningoutpost.dexdrip.Models.ActiveBluetoot... | import android.widget.Toast;
import com.eveningoutpost.dexdrip.Home;
|
25,422 | private static final String WEARABLE_FIELD_PAYLOAD = "field_xdrip_plus_payload";
public static final String WEARABLE_VOICE_PAYLOAD = "/xdrip_plus_voice_payload";
public static final String WEARABLE_APPROVE_TREATMENT = "/xdrip_plus_approve_treatment";
public static final String WEARABLE_CANCEL_TREATMENT = "/xdrip_plus_c... | private static final String WEARABLE_TOAST_LOCAL_NOTIFICATON = "/xdrip_plus_local_toast";
private static final String OPEN_SETTINGS_PATH = "/openwearsettings";
|
25,423 | private static final int NOTIFICATION_ITEM = 541;
private static int last_level = -1;
private static boolean notification_showing = false;
private static int threshold = 20;
private static final int repeat_seconds = 1200;
<BUG>public static void checkBridgeBattery() {
if (!Home.getPreferencesBooleanDefaultFalse("bridg... | public static boolean checkBridgeBattery() {
boolean lowbattery = false;
if (!Home.getPreferencesBooleanDefaultFalse("bridge_battery_alerts")) return false;
|
25,424 | }
final int this_level = Home.getPreferencesInt("bridge_battery", -1);
if ((this_level > 0) && (threshold > 0)) {
if ((this_level < threshold) && (this_level < last_level)) {
if (JoH.pratelimit("bridge-battery-warning", repeat_seconds)) {
<BUG>notification_showing = true;
final PendingIntent pendingIntent = android.app... | lowbattery = true;
final PendingIntent pendingIntent = android.app.PendingIntent.getActivity(xdrip.getAppContext(), 0, new Intent(xdrip.getAppContext(), Home.class), android.app.PendingIntent.FLAG_UPDATE_CURRENT);
|
25,425 | cancelNotification(NOTIFICATION_ITEM);
notification_showing = false;
}
}
last_level = this_level;
<BUG>}
}</BUG>
public static void testHarness() {
if (Home.getPreferencesInt(PREFS_ITEM, -1) < 1)
Home.setPreferencesInt(PREFS_ITEM, 60);
| return lowbattery;
|
25,426 | myLayout.draw(canvas);
}
@Override
protected WatchFaceStyle getWatchFaceStyle(){
return new WatchFaceStyle.Builder(this)
<BUG>.setAcceptsTapEvents(true)
.setStatusBarGravity(Gravity.END | -20)</BUG>
.build();
}
@Override
| .setHotwordIndicatorGravity(Gravity.TOP | Gravity.CENTER)
.setStatusBarGravity(Gravity.END | -20)
|
25,427 | package com.easytoolsoft.easyreport.web.controller.common;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping(value = "/error")
<BUG>public class ErrorController extends AbstractController {
@RequestMapping(value = {"/404"})</BUG>... | public class ErrorController {
@RequestMapping(value = {"/404"})
|
25,428 | @JsonProperty("kafkaUri")
private String kafkaUri;
@JsonProperty("javaUri")
private String javaUri;
@JsonProperty("overriderUri")
<BUG>private String overriderUri;
@JsonCreator</BUG>
public BrokerConfiguration(
@JsonProperty("cpus")double cpus,
@JsonProperty("mem")double mem,
| public BrokerConfiguration() {
}
@JsonCreator
|
25,429 | import org.apache.commons.logging.LogFactory;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
<BUG>import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.TreeMap;</BUG>
public fin... | import java.util.*;
|
25,430 | key = key.replace('_', '.');
return key;
}
private KafkaSchedulerConfiguration fetchConfig(String configName) {
log.info("Fetching configuration: " + configName);
<BUG>return configState.fetch(configName);
</BUG>
}
private static Map<String, String> getOverrides(
KafkaSchedulerConfiguration fromZk,
| return configState.fetch(UUID.fromString(configName));
|
25,431 | this.newTargetConfig = newTargetConfig;
final KafkaConfiguration kafkaConfiguration = newTargetConfig.getKafkaConfiguration();
final String frameworkName = newTargetConfig.getServiceConfiguration().getName();
this.kafkaConfigState = new KafkaConfigState(
frameworkName,
<BUG>kafkaConfiguration.getZkAddress(),
"/");</BU... | kafkaConfiguration.getZkAddress());
|
25,432 | return kafkaConfigState;
}
public KafkaStateService getKafkaState() {
return kafkaStateService;
}
<BUG>private void setTargetConfig(KafkaSchedulerConfiguration newTargetConfig) throws StateStoreException {
String targetConfigName = UUID.randomUUID().toString();
kafkaConfigState.store(newTargetConfig, targetConfigName);... | UUID targetConfigName = kafkaConfigState.store(newTargetConfig);
|
25,433 | throw new BadPayloadException("Unable to inflate frame, frame erroneously says it needs a dictionary");
}
}
if (len > 0)
{
<BUG>out.setPayload(ByteBuffer.wrap(outbuf,0,len));
}
nextIncomingFrame(out);</BUG>
}
catch (DataFormatException e)
| accumulator.addBuffer(outbuf,0,len);
|
25,434 | catch (DataFormatException e)
{
LOG.warn(e);
throw new BadPayloadException(e);
}
<BUG>}
}</BUG>
@Override
public boolean isRsv1User()
{
| out.setPayload(accumulator.getByteBuffer(getBufferPool()));
nextIncomingFrame(out);
|
25,435 | decompressor = new Inflater(nowrap);
for (String key : config.getParameterKeys())
{
key = key.trim();
String value = config.getParameter(key,null);
<BUG>switch(key) {
case "c2s_max_window_bits":</BUG>
negotiated.setParameter("s2c_max_window_bits",value);
break;
| switch (key)
case "c2s_max_window_bits":
|
25,436 | throw new BadPayloadException("Unable to inflate frame, frame erroneously says it needs a dictionary");
}
}
if (len > 0)
{
<BUG>out.setPayload(ByteBuffer.wrap(outbuf,0,len));
}
nextIncomingFrame(out);</BUG>
}
catch (DataFormatException e)
| accumulator.addBuffer(outbuf,0,len);
|
25,437 | catch (DataFormatException e)
{
LOG.warn(e);
throw new BadPayloadException(e);
}
<BUG>}
}</BUG>
@Override
public boolean isRsv1User()
{
| out.setPayload(accumulator.getByteBuffer(getBufferPool()));
nextIncomingFrame(out);
|
25,438 | options.valueOf(intermediateNbest), options.valueOf(finalNbest),
options.valueOf(entityHasReadableId),
options.valueOf(shouldStartWithNamedEntity),
options.valueOf(containsNamedEntity),
options.valueOf(noPrecedingNamedEntity),
<BUG>options.valueOf(noSucceedingNamedEntity));
String inputFileString = options.valueOf(inp... | options.valueOf(noSucceedingNamedEntity),
options.valueOf(containsProperNoun),
options.valueOf(noPrecedingProperNoun),
options.valueOf(noSucceedingProperNoun),
options.valueOf(ignoreEntitiesWithVerbs),
options.valueOf(ignoreEntitiesWithQuestionWords));
String inputFileString = options.valueOf(inputFile);
|
25,439 | });
int sentCount = 1;
BufferedReader br = new BufferedReader(new InputStreamReader(stream));
try {
String line = br.readLine();
<BUG>while (line != null) {
JsonObject jsonSentence = jsonParser.parse(line).getAsJsonObject();</BUG>
if (!jsonSentence.has(SentenceKeys.INDEX_KEY)) {
jsonSentence.addProperty(SentenceKeys.IN... | if (line.startsWith("#") || line.trim().equals("")) {
continue;
}
JsonObject jsonSentence = jsonParser.parse(line).getAsJsonObject();
|
25,440 | Runnable worker =
new DisambiguateSentenceRunnable(this, jsonSentence, kb,
initalNbest, intermediateNbest, finalNbest,
entityHasReadableId, shouldStartWithNamedEntity,
containsNamedEntity, noPrecedingNamedEntity,
<BUG>noSucceedingNamedEntity, out);
threadPool.execute(worker);</BUG>
line = br.readLine();
}
} finally {
| noSucceedingNamedEntity, containsProperNoun,
noPrecedingProperNoun, noSucceedingProperNoun,
ignoreEntitiesWithVerbs, ignoreEntitiesWithQuestionWords, out);
threadPool.execute(worker);
|
25,441 | trainingSample.addAll(examplesCopy);
}
}
return trainingSample;
}
<BUG>public void loadExamples(Reader inputReader, List<String> examples)
</BUG>
throws IOException {
Preconditions.checkNotNull(examples);
BufferedReader br = new BufferedReader(inputReader);
| public static void loadExamples(Reader inputReader, List<String> examples)
|
25,442 | BufferedReader br = new BufferedReader(inputReader);
try {
String line = br.readLine();
while (line != null) {
line = line.trim();
<BUG>if (line.equals("") || line.charAt(0) == '#') {
continue;</BUG>
}
examples.add(line);
line = br.readLine();
| continue;
|
25,443 | private OptionSpec<Boolean> useKG;
@Override
public void initializeOptions(OptionParser parser) {
languageCode =
parser.accepts("langCode", "Knowledge Graph/Freebase Language code.")
<BUG>.withRequiredArg().ofType(String.class).defaultsTo("stdin");
</BUG>
apiKey =
parser.accepts("apiKey", "Knowledge Graph/Freebase API ... | .withRequiredArg().ofType(String.class).defaultsTo("en");
|
25,444 | import com.google.gson.JsonParser;
import edu.stanford.nlp.ling.CoreLabel;
import edu.stanford.nlp.ling.IndexedWord;
import edu.stanford.nlp.semgraph.SemanticGraph;
import edu.stanford.nlp.trees.GrammaticalRelation;
<BUG>import edu.stanford.nlp.trees.GrammaticalRelation.Language;
</BUG>
import edu.stanford.nlp.trees.Ty... | import edu.stanford.nlp.international.Language;
|
25,445 | package com.projecttango.examples.java.augmentedreality;
import com.google.atap.tangoservice.Tango;
import com.google.atap.tangoservice.Tango.OnTangoUpdateListener;
import com.google.atap.tangoservice.TangoCameraIntrinsics;
import com.google.atap.tangoservice.TangoConfig;
<BUG>import com.google.atap.tangoservice.TangoC... | import com.google.atap.tangoservice.TangoErrorException;
import com.google.atap.tangoservice.TangoEvent;
|
25,446 | super.onResume();
if (!mIsConnected) {
mTango = new Tango(AugmentedRealityActivity.this, new Runnable() {
@Override
public void run() {
<BUG>try {
connectTango();</BUG>
setupRenderer();
mIsConnected = true;
} catch (TangoOutOfDateException e) {
| TangoSupport.initialize();
connectTango();
|
25,447 | if (lastFramePose.statusCode == TangoPoseData.POSE_VALID) {
mRenderer.updateRenderCameraPose(lastFramePose, mExtrinsics);
mCameraPoseTimestamp = lastFramePose.timestamp;</BUG>
} else {
<BUG>Log.w(TAG, "Can't get device pose at time: " + mRgbTimestampGlThread);
}</BUG>
}
}
}
@Override
| mRenderer.updateRenderCameraPose(lastFramePose);
mCameraPoseTimestamp = lastFramePose.timestamp;
Log.w(TAG, "Can't get device pose at time: " +
|
25,448 | import org.rajawali3d.materials.Material;
import org.rajawali3d.materials.methods.DiffuseMethod;
import org.rajawali3d.materials.textures.ATexture;
import org.rajawali3d.materials.textures.StreamingTexture;
import org.rajawali3d.materials.textures.Texture;
<BUG>import org.rajawali3d.math.Matrix4;
import org.rajawali3d.... | import org.rajawali3d.math.Quaternion;
import org.rajawali3d.math.vector.Vector3;
|
25,449 | translationMoon.setRepeatMode(Animation.RepeatMode.INFINITE);
translationMoon.setTransformable3D(moon);
getCurrentScene().registerAnimation(translationMoon);
translationMoon.play();
}
<BUG>public void updateRenderCameraPose(TangoPoseData devicePose, DeviceExtrinsics extrinsics) {
Pose cameraPose = ScenePoseCalculator.t... | public void updateRenderCameraPose(TangoPoseData cameraPose) {
float[] rotation = cameraPose.getRotationAsFloats();
float[] translation = cameraPose.getTranslationAsFloats();
Quaternion quaternion = new Quaternion(rotation[3], rotation[0], rotation[1], rotation[2]);
getCurrentCamera().setRotation(quaternion.conjugate()... |
25,450 | package com.projecttango.examples.java.helloareadescription;
import com.google.atap.tangoservice.Tango;
<BUG>import com.google.atap.tangoservice.Tango.OnTangoUpdateListener;
import com.google.atap.tangoservice.TangoConfig;</BUG>
import com.google.atap.tangoservice.TangoCoordinateFramePair;
import com.google.atap.tangos... | import com.google.atap.tangoservice.TangoAreaDescriptionMetaData;
import com.google.atap.tangoservice.TangoConfig;
|
25,451 | import org.spongepowered.api.world.Locatable;
import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.World;
import javax.annotation.Nullable;
import java.util.List;
<BUG>import java.util.Optional;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG>
public class CommandDel... | import java.util.stream.Stream;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
|
25,452 | .append(Text.of(TextColors.GREEN, "Usage: "))
.append(getUsage(source))
.build());
return CommandResult.empty();
} else if (isIn(REGIONS_ALIASES, parse.args[0])) {
<BUG>if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!"));
IRegion region = FGManager.getInstance().getRegion(parse.args[1... | String regionName = parse.args[1];
IRegion region = FGManager.getInstance().getRegion(regionName).orElse(null);
|
25,453 | </BUG>
isWorldRegion = true;
}
if (region == null)
<BUG>throw new CommandException(Text.of("No region exists with the name \"" + parse.args[1] + "\"!"));
if (region instanceof GlobalWorldRegion) {
</BUG>
throw new CommandException(Text.of("You may not delete the global region!"));
}
| if (world == null)
throw new CommandException(Text.of("No world exists with name \"" + worldName + "\"!"));
if (world == null) throw new CommandException(Text.of("Must specify a world!"));
region = FGManager.getInstance().getWorldRegion(world, regionName).orElse(null);
throw new CommandException(Text.of("No region exis... |
25,454 | source.getName() + " deleted " + (isWorldRegion ? "world" : "") + "region"
);
return CommandResult.success();
} else if (isIn(HANDLERS_ALIASES, parse.args[0])) {
if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!"));
<BUG>IHandler handler = FGManager.getInstance().gethandler(parse.args[... | Optional<IHandler> handlerOpt = FGManager.getInstance().gethandler(parse.args[1]);
if (!handlerOpt.isPresent())
IHandler handler = handlerOpt.get();
if (handler instanceof GlobalHandler)
|
25,455 | .excludeCurrent(true)
.autoCloseQuotes(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "handler").stream()
.filter(new StartsWithPredicate(parse.current.token))</BUG>
.map(args -> parse.current.prefix... | return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
25,456 | .excludeCurrent(true)
.autoCloseQuotes(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "handler").stream()
.filter(new StartsWithPredicate(parse.current.token))</BUG>
.map(args -> parse.current.prefix... | return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
25,457 | @Dependency(id = "foxcore")
},
description = "A world protection plugin built for SpongeAPI. Requires FoxCore.",
authors = {"gravityfox"},
url = "https://github.com/FoxDenStudio/FoxGuard")
<BUG>public final class FoxGuardMain {
public final Cause pluginCause = Cause.builder().named("plugin", this).build();
private stat... | private static FoxGuardMain instanceField;
|
25,458 | private UserStorageService userStorage;
private EconomyService economyService = null;
private boolean loaded = false;
private FCCommandDispatcher fgDispatcher;
public static FoxGuardMain instance() {
<BUG>return instanceField;
}</BUG>
@Listener
public void construct(GameConstructionEvent event) {
instanceField = this;
| }
public static Cause getCause() {
return instance().pluginCause;
}
|
25,459 | return configDirectory;
}
public boolean isLoaded() {
return loaded;
}
<BUG>public static Cause getCause() {
return instance().pluginCause;
}</BUG>
public EconomyService getEconomyService() {
return economyService;
| [DELETED] |
25,460 | import org.spongepowered.api.world.Locatable;
import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.World;
import javax.annotation.Nullable;
import java.util.*;
<BUG>import java.util.stream.Collectors;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG>
public class Comm... | import java.util.stream.Stream;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
|
25,461 | .excludeCurrent(true)
.autoCloseQuotes(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "handler").stream()
.filter(new StartsWithPredicate(parse.current.token))</BUG>
.map(args -> parse.current.prefix... | return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
25,462 | private static FGStorageManager instance;
private final Logger logger = FoxGuardMain.instance().getLogger();</BUG>
private final Set<LoadEntry> loaded = new HashSet<>();
private final Path directory = getDirectory();
private final Map<String, Path> worldDirectories;
<BUG>private FGStorageManager() {
defaultModifiedMap ... | public final HashMap<IFGObject, Boolean> defaultModifiedMap;
private final UserStorageService userStorageService;
private final Logger logger = FoxGuardMain.instance().getLogger();
userStorageService = FoxGuardMain.instance().getUserStorage();
defaultModifiedMap = new CacheMap<>((k, m) -> {
|
25,463 | String name = fgObject.getName();
Path singleDir = dir.resolve(name.toLowerCase());
</BUG>
boolean shouldSave = fgObject.shouldSave();
if (force || shouldSave) {
<BUG>logger.info((shouldSave ? "S" : "Force s") + "aving handler \"" + name + "\" in directory: " + singleDir);
</BUG>
constructDirectory(singleDir);
try {
fg... | UUID owner = fgObject.getOwner();
boolean isOwned = !owner.equals(SERVER_UUID);
Optional<User> userOwner = userStorageService.get(owner);
String logName = (userOwner.isPresent() ? userOwner.get().getName() + ":" : "") + (isOwned ? owner + ":" : "") + name;
if (fgObject.autoSave()) {
Path singleDir = serverDir.resolve(n... |
25,464 | if (fgObject.autoSave()) {
Path singleDir = dir.resolve(name.toLowerCase());
</BUG>
boolean shouldSave = fgObject.shouldSave();
if (force || shouldSave) {
<BUG>logger.info((shouldSave ? "S" : "Force s") + "aving world region \"" + name + "\" in directory: " + singleDir);
</BUG>
constructDirectory(singleDir);
try {
fgOb... | Path singleDir = serverDir.resolve(name.toLowerCase());
logger.info((shouldSave ? "S" : "Force s") + "aving world region " + logName + " in directory: " + singleDir);
|
25,465 | public synchronized void loadRegionLinks() {
logger.info("Loading region links");
try (DB mainDB = DBMaker.fileDB(directory.resolve("regions.foxdb").normalize().toString()).make()) {
Map<String, String> linksMap = mainDB.hashMap("links", Serializer.STRING, Serializer.STRING).createOrOpen();
linksMap.entrySet().forEach(... | Optional<IRegion> regionOpt = FGManager.getInstance().getRegion(entry.getKey());
if (regionOpt.isPresent()) {
IRegion region = regionOpt.get();
logger.info("Loading links for region \"" + region.getName() + "\"");
|
25,466 | public synchronized void loadWorldRegionLinks(World world) {
logger.info("Loading world region links for world \"" + world.getName() + "\"");
try (DB mainDB = DBMaker.fileDB(worldDirectories.get(world.getName()).resolve("wregions.foxdb").normalize().toString()).make()) {
Map<String, String> linksMap = mainDB.hashMap("l... | Optional<IWorldRegion> regionOpt = FGManager.getInstance().getWorldRegion(world, entry.getKey());
if (regionOpt.isPresent()) {
IWorldRegion region = regionOpt.get();
logger.info("Loading links for world region \"" + region.getName() + "\"");
|
25,467 | StringBuilder builder = new StringBuilder();
for (Iterator<IHandler> it = handlers.iterator(); it.hasNext(); ) {
builder.append(it.next().getName());
if (it.hasNext()) builder.append(",");
}
<BUG>return builder.toString();
}</BUG>
private final class LoadEntry {
public final String name;
public final Type type;
| public enum Type {
REGION, WREGION, HANDLER
|
25,468 | .autoCloseQuotes(true)
.leaveFinalAsIs(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "worldregion", "handler", "controller").stream()
</BUG>
.filter(new StartsWithPredicate(parse.current.token))
.co... | return Stream.of("region", "worldregion", "handler", "controller")
|
25,469 | import java.util.Locale;
import java.util.Map;
import java.util.TreeMap;
public class DependencyConvergenceReport
extends AbstractProjectInfoReport
<BUG>{
private List reactorProjects;
private static final int PERCENTAGE = 100;</BUG>
public String getOutputName()
{
| private static final int PERCENTAGE = 100;
private static final List SUPPORTED_FONT_FAMILY_NAMES = Arrays.asList( GraphicsEnvironment
.getLocalGraphicsEnvironment().getAvailableFontFamilyNames() );
|
25,470 | sink.section1();
sink.sectionTitle1();
sink.text( getI18nString( locale, "title" ) );
sink.sectionTitle1_();
Map dependencyMap = getDependencyMap();
<BUG>generateLegend( locale, sink );
generateStats( locale, sink, dependencyMap );
generateConvergence( locale, sink, dependencyMap );
sink.section1_();</BUG>
sink.body_()... | sink.lineBreak();
sink.section1_();
|
25,471 | Iterator it = artifactMap.keySet().iterator();
while ( it.hasNext() )
{
String version = (String) it.next();
sink.tableRow();
<BUG>sink.tableCell();
sink.text( version );</BUG>
sink.tableCell_();
sink.tableCell();
generateVersionDetails( sink, artifactMap, version );
| sink.tableCell( String.valueOf( cellWidth ) + "px" );
sink.text( version );
|
25,472 | sink.tableCell();
sink.text( getI18nString( locale, "legend.shared" ) );
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableCell();
iconError( sink );</BUG>
sink.tableCell_();
sink.tableCell();
sink.text( getI18nString( locale, "legend.different" ) );
| sink.tableCell( "15px" ); // according /images/icon_error_sml.gif
iconError( sink );
|
25,473 | sink.tableCaption();
sink.text( getI18nString( locale, "stats.caption" ) );
sink.tableCaption_();</BUG>
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.subprojects" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
sink.text( String.valueOf( reactorProjects.size() ) );
s... | sink.bold();
sink.bold_();
sink.tableCaption_();
sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.subprojects" ) );
sink.tableHeaderCell_();
|
25,474 | sink.tableCell();
sink.text( String.valueOf( reactorProjects.size() ) );
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.dependencies" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
sink.text( String.valueOf( depCount ) );
| sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.dependencies" ) );
sink.tableHeaderCell_();
|
25,475 | sink.text( String.valueOf( convergence ) + "%" );
sink.bold_();
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.readyrelease" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
if ( convergence >= PERCENTAGE && snapshotCount <= 0 )
| sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.readyrelease" ) );
sink.tableHeaderCell_();
|
25,476 | {
ReverseDependencyLink p1 = (ReverseDependencyLink) o1;
ReverseDependencyLink p2 = (ReverseDependencyLink) o2;
return p1.getProject().getId().compareTo( p2.getProject().getId() );
}
<BUG>else
{</BUG>
return 0;
}
}
| iconError( sink );
|
25,477 | private static String bluetoothDeviceAddress = null;
private static String bluetoothDeviceName = null;
private static String gatewayUrl = null;
public final static int REQUEST_ENABLE_BT = 3;
public final static int SETTINGS_ACTIVITY = 7;
<BUG>public final static int LEAVE_BLUETOOTH_ON= 11;
</BUG>
public static final sh... | public final static int LEAVE_BLUETOOTH_ON = 11;
|
25,478 | public static final short CAR_ZOE_R240 = 0x020;
public static final short CAR_ZOE_Q90 = 0x040;
public static final short CAR_ZOE_R90 = 0x080;
public static final short FIELD_TYPE_MASK = 0x700;
public static final short FIELD_TYPE_SIGNED = 0x100;
<BUG>public static final short FIELD_TYPE_STRING = 0x200; // not impl... | public static final short TOAST_NONE = 0;
public static final short TOAST_ELM = 1;
public static final short TOAST_ELMCAR = 2;
public static final double reduction = 9.32; // update suggested by Loc Dao
|
25,479 | Log.d(TAG, text);
if(debugLogMode) {
SimpleDateFormat sdf = new SimpleDateFormat(instance.getString(R.string.format_YMDHMSs), Locale.getDefault());
DebugLogger.getInstance().log(sdf.format(Calendar.getInstance().getTime()) + ": " + text);
}
<BUG>}
public static void toast(final String message)</BUG>
{
if(instance!=null... | public static void toast(int level, final String message)
if (level <= toastLevel) return;
|
25,480 | import lu.fisch.canze.actors.Frame;
import lu.fisch.canze.actors.Message;
import lu.fisch.canze.actors.VirtualField;
import lu.fisch.canze.bluetooth.BluetoothManager;
import lu.fisch.canze.database.CanzeDataSource;
<BUG>public abstract class Device {
private final double minIntervalMultiplicator = 1.3;
private final d... | public static final int TOUGHNESS_HARD = 0; // hardest reset possible (ie atz)
public static final int TOUGHNESS_MEDIUM = 1; // medium reset (i.e. atws)
public static final int TOUGHNESS_SOFT = 2; // softest reset (i.e atd for ELM)
public static final int TOUGHNESS_NONE = 100; // just clear error status
priva... |
25,481 | MainActivity.debug("Device: pollerThread == null");
setPollerActive(true);
Runnable r = new Runnable() {
@Override
public void run() {
<BUG>if(initDevice(0)) {
while (isPollerActive()) {</BUG>
MainActivity.debug("Device: inside poller thread");
if (applicationFields.size()+activityFieldsScheduled.size()+activityFieldsA... | if(initDevice(TOUGHNESS_HARD)) {
while (isPollerActive()) {
|
25,482 | Bundle savedInstanceState) {
final View rootView = inflater.inflate(R.layout.tab_qibla, container, false);
final QiblaCompassView qiblaCompassView = (QiblaCompassView)rootView.findViewById(R.id.qibla_compass);
qiblaCompassView.setConstants(((TextView)rootView.findViewById(R.id.bearing_north)), getText(R.string.bearing_... | sOrientationListener = new android.hardware.SensorListener() {
|
25,483 | import org.xwiki.observation.ObservationManager;
import com.xpn.xwiki.XWiki;
import com.xpn.xwiki.XWikiContext;
import com.xpn.xwiki.XWikiException;
import com.xpn.xwiki.doc.XWikiDocument;
<BUG>import com.xpn.xwiki.objects.BaseObject;
public abstract class AbstractRatingsManager implements RatingsManager</BUG>
{
@Injec... | import com.xpn.xwiki.objects.BaseProperty;
public abstract class AbstractRatingsManager implements RatingsManager
|
25,484 | int result = (int) getXWiki().ParamAsLong("xwiki.ratings", 0);
return (getXWiki().getXWikiPreferenceAsInt("ratings", result, getXWikiContext()) == 1);
}
public boolean isAverageRatingStored()
{
<BUG>int result = (int) getXWiki().ParamAsLong("xwiki.ratings.averagerating.stored", 1);
return (getXWiki().getXWikiPreferenc... | String result = getXWiki().Param("xwiki.ratings.averagerating.stored", "1");
result = getXWiki().getXWikiPreference("ratings_averagerating_stored", result, getXWikiContext());
return (getConfigParameter(RatingsManager.RATINGS_CONFIG_CLASS_FIELDNAME_STORE_AVERAGE_RATING, result) == "1");
|
25,485 | import java.util.Locale;
import java.util.Map;
import java.util.TreeMap;
public class DependencyConvergenceReport
extends AbstractProjectInfoReport
<BUG>{
private List reactorProjects;
private static final int PERCENTAGE = 100;</BUG>
public String getOutputName()
{
| private static final int PERCENTAGE = 100;
private static final List SUPPORTED_FONT_FAMILY_NAMES = Arrays.asList( GraphicsEnvironment
.getLocalGraphicsEnvironment().getAvailableFontFamilyNames() );
|
25,486 | sink.section1();
sink.sectionTitle1();
sink.text( getI18nString( locale, "title" ) );
sink.sectionTitle1_();
Map dependencyMap = getDependencyMap();
<BUG>generateLegend( locale, sink );
generateStats( locale, sink, dependencyMap );
generateConvergence( locale, sink, dependencyMap );
sink.section1_();</BUG>
sink.body_()... | sink.lineBreak();
sink.section1_();
|
25,487 | Iterator it = artifactMap.keySet().iterator();
while ( it.hasNext() )
{
String version = (String) it.next();
sink.tableRow();
<BUG>sink.tableCell();
sink.text( version );</BUG>
sink.tableCell_();
sink.tableCell();
generateVersionDetails( sink, artifactMap, version );
| sink.tableCell( String.valueOf( cellWidth ) + "px" );
sink.text( version );
|
25,488 | sink.tableCell();
sink.text( getI18nString( locale, "legend.shared" ) );
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableCell();
iconError( sink );</BUG>
sink.tableCell_();
sink.tableCell();
sink.text( getI18nString( locale, "legend.different" ) );
| sink.tableCell( "15px" ); // according /images/icon_error_sml.gif
iconError( sink );
|
25,489 | sink.tableCaption();
sink.text( getI18nString( locale, "stats.caption" ) );
sink.tableCaption_();</BUG>
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.subprojects" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
sink.text( String.valueOf( reactorProjects.size() ) );
s... | sink.bold();
sink.bold_();
sink.tableCaption_();
sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.subprojects" ) );
sink.tableHeaderCell_();
|
25,490 | sink.tableCell();
sink.text( String.valueOf( reactorProjects.size() ) );
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.dependencies" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
sink.text( String.valueOf( depCount ) );
| sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.dependencies" ) );
sink.tableHeaderCell_();
|
25,491 | sink.text( String.valueOf( convergence ) + "%" );
sink.bold_();
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.readyrelease" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
if ( convergence >= PERCENTAGE && snapshotCount <= 0 )
| sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.readyrelease" ) );
sink.tableHeaderCell_();
|
25,492 | {
ReverseDependencyLink p1 = (ReverseDependencyLink) o1;
ReverseDependencyLink p2 = (ReverseDependencyLink) o2;
return p1.getProject().getId().compareTo( p2.getProject().getId() );
}
<BUG>else
{</BUG>
return 0;
}
}
| iconError( sink );
|
25,493 | package com.skin.ayada.runtime;
<BUG>import java.io.IOException;
import java.text.MessageFormat;</BUG>
import java.util.HashMap;
import java.util.Iterator;
import java.util.Locale;
| import java.io.Writer;
import java.text.MessageFormat;
|
25,494 | package com.skin.ayada.jstl.core;
import com.skin.ayada.tagext.Tag;
import com.skin.ayada.tagext.TagSupport;
<BUG>public class BreakTag extends TagSupport
</BUG>
{
@Override
public int doStartTag()
| import com.skin.ayada.tagext.BreakTagSupport;
public class BreakTag extends TagSupport implements BreakTagSupport
|
25,495 | package com.skin.ayada.demo;
<BUG>import java.io.StringWriter;
import com.skin.ayada.runtime.PageContext;</BUG>
import com.skin.ayada.source.ClassPathSourceFactory;
import com.skin.ayada.source.SourceFactory;
import com.skin.ayada.template.DefaultTemplateContext;
| import com.skin.ayada.runtime.DefaultExpressionFactory;
import com.skin.ayada.runtime.ExpressionFactory;
import com.skin.ayada.runtime.PageContext;
|
25,496 | System.out.println(TemplateUtil.toString(template));
System.out.println("-------------- System.out.print --------------");
</BUG>
template.execute(pageContext);
<BUG>System.out.println("-------------- run result --------------");
System.out.println(writer.toString());</BUG>
}
catch(Exception e)
{
e.printStackTrace();
| System.out.println("-------------- System.out.println --------------");
System.out.println("-------------- result --------------");
System.out.println(writer.toString());
|
25,497 | package com.skin.ayada.runtime;
import java.io.Writer;
<BUG>import com.skin.ayada.jstl.TagLibrary;
import com.skin.ayada.jstl.TagLibraryFactory;</BUG>
public class JspFactory
{
public static PageContext getDefaultPageContext(Writer writer)
| [DELETED] |
25,498 | public static PageContext getDefaultPageContext(Writer writer, int buffserSize, boolean autoFlush)
{
JspWriter out = new JspWriter(writer, buffserSize, autoFlush);
DefaultPageContext pageContext = new DefaultPageContext(out);
ExpressionContext expressionContext = DefaultExpressionFactory.getDefaultExpressionContext(pag... | [DELETED] |
25,499 | } else {
updateMemo();
callback.updateMemo();
}
dismiss();
<BUG>}else{
</BUG>
Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show();
}
}
| [DELETED] |
25,500 | }
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_memo);
<BUG>ChinaPhoneHelper.setStatusBar(this,true);
</BUG>
topicId = getIntent().getLongExtra("topicId", -1);
if (topicId == -1) {
finish();
| ChinaPhoneHelper.setStatusBar(this, true);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.