id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
28,301 | rollupCappedDatabases.add(new CappedDatabase(file, sizeKb, ticker));
}
this.rollupCappedDatabases = ImmutableList.copyOf(rollupCappedDatabases);
traceCappedDatabase = new CappedDatabase(new File(dataDir, "trace-detail.capped.db"),
storageConfig.traceCappedDatabaseSizeMb() * 1024, ticker);
<BUG>agentDao = new AgentDao(d... | environmentDao = new EnvironmentDao(dataSource);
|
28,302 | traceDao = new TraceDao(dataSource, traceCappedDatabase, transactionTypeDao,
fullQueryTextDao, traceAttributeNameDao);
GaugeNameDao gaugeNameDao = new GaugeNameDao(dataSource);
gaugeValueDao = new GaugeValueDao(dataSource, gaugeNameDao, clock);
repoAdmin = new RepoAdminImpl(dataSource, rollupCappedDatabases, traceCappe... | configRepository, environmentDao, gaugeValueDao, gaugeNameDao, transactionTypeDao,
|
28,303 | new TraceCappedDatabaseStats(traceCappedDatabase),
"org.glowroot:type=TraceCappedDatabase");
platformMBeanServerLifecycle.lazyRegisterMBean(new H2DatabaseStats(dataSource),
"org.glowroot:type=H2Database");
}
<BUG>public AgentDao getAgentDao() {
return agentDao;
</BUG>
}
public TransactionTypeRepository getTransactionTy... | public EnvironmentDao getEnvironmentDao() {
return environmentDao;
|
28,304 | package org.glowroot.agent.embedded.init;
import java.io.Closeable;
import java.io.File;
<BUG>import java.lang.instrument.Instrumentation;
import java.util.Map;</BUG>
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
| import java.util.List;
import java.util.Map;
|
28,305 | import java.util.concurrent.ScheduledExecutorService;
import javax.annotation.Nullable;
import com.google.common.base.MoreObjects;
import com.google.common.base.Stopwatch;
import com.google.common.base.Supplier;
<BUG>import com.google.common.base.Ticker;
import org.checkerframework.checker.nullness.qual.MonotonicNonNul... | import com.google.common.collect.ImmutableList;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
28,306 | import org.glowroot.agent.init.EnvironmentCreator;
import org.glowroot.agent.init.GlowrootThinAgentInit;
import org.glowroot.agent.init.JRebelWorkaround;
import org.glowroot.agent.util.LazyPlatformMBeanServer;
import org.glowroot.common.live.LiveAggregateRepository.LiveAggregateRepositoryNop;
<BUG>import org.glowroot.c... | import org.glowroot.common.repo.AgentRepository;
import org.glowroot.common.repo.ImmutableAgentRollup;
import org.glowroot.common.util.Clock;
|
28,307 | SimpleRepoModule simpleRepoModule = new SimpleRepoModule(dataSource,
dataDir, clock, ticker, configRepository, backgroundExecutor);
simpleRepoModule.registerMBeans(new PlatformMBeanServerLifecycleImpl(
agentModule.getLazyPlatformMBeanServer()));
CollectorImpl collectorImpl = new CollectorImpl(
<BUG>simpleRepoModule.get... | simpleRepoModule.getEnvironmentDao(),
simpleRepoModule.getTraceDao(),
|
28,308 | .baseDir(baseDir)
.glowrootDir(glowrootDir)
.ticker(ticker)
.clock(clock)
.liveJvmService(agentModule.getLiveJvmService())
<BUG>.configRepository(simpleRepoModule.getConfigRepository())
.agentRepository(simpleRepoModule.getAgentDao())
</BUG>
.transactionTypeRepository(simpleRepoModule.getTransactionTypeRepository())
.t... | .agentRepository(new AgentRepositoryImpl())
.environmentRepository(simpleRepoModule.getEnvironmentDao())
|
28,309 | .baseDir(baseDir)
.glowrootDir(glowrootDir)
.ticker(ticker)
.clock(clock)
.liveJvmService(null)
<BUG>.configRepository(simpleRepoModule.getConfigRepository())
.agentRepository(simpleRepoModule.getAgentDao())
</BUG>
.transactionTypeRepository(simpleRepoModule.getTransactionTypeRepository())
.traceAttributeNameRepository... | .liveJvmService(agentModule.getLiveJvmService())
.agentRepository(new AgentRepositoryImpl())
.environmentRepository(simpleRepoModule.getEnvironmentDao())
|
28,310 | }
@Override
public void lazyRegisterMBean(Object object, String name) {
lazyPlatformMBeanServer.lazyRegisterMBean(object, name);
}
<BUG>}
}
</BUG>
| void initEmbeddedServer() throws Exception {
if (simpleRepoModule == null) {
return;
|
28,311 | List<GaugeConfig> configs = Lists.newArrayList(configService.getGaugeConfigs());
for (GaugeConfig loopConfig : configs) {
if (loopConfig.mbeanObjectName().equals(gaugeConfig.getMbeanObjectName())) {
throw new DuplicateMBeanObjectNameException();
}
<BUG>}
String version = Versions.getVersion(gaugeConfig);
for (GaugeConf... | [DELETED] |
28,312 | configService.updateGaugeConfigs(configs);
}
}
@Override
public void updateGaugeConfig(String agentId, AgentConfig.GaugeConfig gaugeConfig,
<BUG>String priorVersion) throws Exception {
synchronized (writeLock) {</BUG>
List<GaugeConfig> configs = Lists.newArrayList(configService.getGaugeConfigs());
boolean found = false... | GaugeConfig config = GaugeConfig.create(gaugeConfig);
synchronized (writeLock) {
|
28,313 | boolean found = false;
for (ListIterator<GaugeConfig> i = configs.listIterator(); i.hasNext();) {
GaugeConfig loopConfig = i.next();
String loopVersion = Versions.getVersion(loopConfig.toProto());
if (loopVersion.equals(priorVersion)) {
<BUG>i.set(GaugeConfig.create(gaugeConfig));
found = true;
break;</BUG>
} else if (... | i.set(config);
|
28,314 | boolean found = false;
for (ListIterator<PluginConfig> i = configs.listIterator(); i.hasNext();) {
PluginConfig loopPluginConfig = i.next();
if (pluginId.equals(loopPluginConfig.id())) {
String loopVersion = Versions.getVersion(loopPluginConfig.toProto());
<BUG>checkVersionsEqual(loopVersion, priorVersion);
PluginDescr... | for (ListIterator<GaugeConfig> i = configs.listIterator(); i.hasNext();) {
GaugeConfig loopConfig = i.next();
String loopVersion = Versions.getVersion(loopConfig.toProto());
if (loopVersion.equals(version)) {
i.remove();
|
28,315 | boolean found = false;
for (ListIterator<InstrumentationConfig> i = configs.listIterator(); i.hasNext();) {
InstrumentationConfig loopConfig = i.next();
String loopVersion = Versions.getVersion(loopConfig.toProto());
if (loopVersion.equals(priorVersion)) {
<BUG>i.set(InstrumentationConfig.create(instrumentationConfig))... | i.set(config);
} else if (loopConfig.equals(config)) {
throw new IllegalStateException("This exact instrumentation already exists");
|
28,316 | package org.glowroot.agent.embedded.init;
import java.io.File;
import java.util.List;
import org.glowroot.agent.collector.Collector;
<BUG>import org.glowroot.agent.embedded.repo.AgentDao;
import org.glowroot.agent.embedded.repo.AggregateDao;
import org.glowroot.agent.embedded.repo.GaugeValueDao;</BUG>
import org.glowro... | import org.glowroot.agent.embedded.repo.EnvironmentDao;
import org.glowroot.agent.embedded.repo.GaugeValueDao;
|
28,317 | </BUG>
private final AggregateDao aggregateDao;
private final TraceDao traceDao;
private final GaugeValueDao gaugeValueDao;
<BUG>CollectorImpl(AgentDao agentDao, AggregateDao aggregateRepository, TraceDao traceRepository,
GaugeValueDao gaugeValueRepository) {
this.agentDao = agentDao;</BUG>
this.aggregateDao = aggrega... | import org.glowroot.wire.api.model.CollectorServiceOuterClass.Environment;
import org.glowroot.wire.api.model.CollectorServiceOuterClass.GaugeValue;
import org.glowroot.wire.api.model.CollectorServiceOuterClass.LogEvent;
import org.glowroot.wire.api.model.TraceOuterClass.Trace;
class CollectorImpl implements Collector ... |
28,318 | public static void transformConfigFile(InputStream sourceStream, String destPath) throws Exception {
try {
Yaml yaml = new Yaml();
final Object loadedObject = yaml.load(sourceStream);
if (loadedObject instanceof Map) {
<BUG>final Map<String, Object> result = (Map<String, Object>) loadedObject;
ByteArrayOutputStream ni... | final Map<String, Object> loadedMap = (Map<String, Object>) loadedObject;
ConfigSchema configSchema = new ConfigSchema(loadedMap);
if (!configSchema.isValid()) {
throw new InvalidConfigurationException("Failed to transform config file due to:" + configSchema.getValidationIssuesAsString());
}
writeNiFiProperties(configS... |
28,319 | writer.println("nifi.h2.url.append=;LOCK_TIMEOUT=25000;WRITE_DELAY=0;AUTO_SERVER=FALSE");
writer.println();
writer.println("# FlowFile Repository");
writer.println("nifi.flowfile.repository.implementation=org.apache.nifi.controller.repository.WriteAheadFlowFileRepository");
writer.println("nifi.flowfile.repository.dire... | writer.println("nifi.flowfile.repository.partitions=" + flowfileRepoSchema.getPartitions());
writer.println("nifi.flowfile.repository.checkpoint.interval=" + flowfileRepoSchema.getCheckpointInterval());
writer.println("nifi.flowfile.repository.always.sync=" + flowfileRepoSchema.getAlwaysSync());
|
28,320 | writer.println("# cluster manager properties (only configure for cluster manager) #");
writer.println("nifi.cluster.is.manager=false");
} catch (NullPointerException e) {
throw new ConfigurationChangeException("Failed to parse the config YAML while creating the nifi.properties", e);
} finally {
<BUG>if (writer != null)... | if (writer != null) {
|
28,321 | writer.flush();
writer.close();
}
}
}
<BUG>private static DOMSource createFlowXml(Map<String, Object> topLevelYaml) throws IOException, ConfigurationChangeException {
</BUG>
try {
final DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
docFactory.setNamespaceAware(true);
| private static DOMSource createFlowXml(ConfigSchema configSchema) throws IOException, ConfigurationChangeException {
|
28,322 | docFactory.setNamespaceAware(true);
final DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
final Document doc = docBuilder.newDocument();
final Element rootNode = doc.createElement("flowController");
doc.appendChild(rootNode);
<BUG>Map<String, Object> processorConfig = (Map<String, Object>) topLevelYaml.ge... | CorePropertiesSchema coreProperties = configSchema.getCoreProperties();
addTextElement(rootNode, "maxTimerDrivenThreadCount", String.valueOf(coreProperties.getMaxConcurrentThreads()));
addTextElement(rootNode, "maxEventDrivenThreadCount", String.valueOf(coreProperties.getMaxConcurrentThreads()));
addProcessGroup(rootNo... |
28,323 | throw new ConfigurationChangeException("Failed to parse the config YAML while trying to add the Provenance Reporting Task", e);
}
}
private static void addConfiguration(final Element element, Map<String, Object> elementConfig) {
final Document doc = element.getOwnerDocument();
<BUG>if (elementConfig == null){
</BUG>
re... | if (elementConfig == null) {
|
28,324 | } else {
updateMemo();
callback.updateMemo();
}
dismiss();
<BUG>}else{
</BUG>
Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show();
}
}
| [DELETED] |
28,325 | }
@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);
|
28,326 | MemoEntry.COLUMN_REF_TOPIC__ID + " = ?"
, new String[]{String.valueOf(topicId)});
}
public Cursor selectMemo(long topicId) {
Cursor c = db.query(MemoEntry.TABLE_NAME, null, MemoEntry.COLUMN_REF_TOPIC__ID + " = ?", new String[]{String.valueOf(topicId)}, null, null,
<BUG>MemoEntry._ID + " DESC", null);
</BUG>
if (c != nu... | MemoEntry.COLUMN_ORDER + " ASC", null);
|
28,327 | MemoEntry._ID + " = ?",
new String[]{String.valueOf(memoId)});
}
public long updateMemoContent(long memoId, String memoContent) {
ContentValues values = new ContentValues();
<BUG>values.put(MemoEntry.COLUMN_CONTENT, memoContent);
return db.update(</BUG>
MemoEntry.TABLE_NAME,
values,
MemoEntry._ID + " = ?",
| return db.update(
|
28,328 | import android.widget.RelativeLayout;
import android.widget.TextView;
import com.kiminonawa.mydiary.R;
import com.kiminonawa.mydiary.db.DBManager;
import com.kiminonawa.mydiary.shared.EditMode;
<BUG>import com.kiminonawa.mydiary.shared.ThemeManager;
import java.util.List;
public class MemoAdapter extends RecyclerView.A... | import com.marshalchen.ultimaterecyclerview.dragsortadapter.DragSortAdapter;
public class MemoAdapter extends DragSortAdapter<DragSortAdapter.ViewHolder> implements EditMode {
|
28,329 | private DBManager dbManager;
private boolean isEditMode = false;
private EditMemoDialogFragment.MemoCallback callback;
private static final int TYPE_HEADER = 0;
private static final int TYPE_ITEM = 1;
<BUG>public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMe... | public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback, RecyclerView recyclerView) {
super(recyclerView);
this.mActivity = activity;
|
28,330 | this.memoList = memoList;
this.dbManager = dbManager;
this.callback = callback;
}
@Override
<BUG>public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
</BUG>
View view;
if (isEditMode) {
if (viewType == TYPE_HEADER) {
| public DragSortAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
28,331 | editMemoDialogFragment.show(mActivity.getSupportFragmentManager(), "editMemoDialogFragment");
}
});
}
}
<BUG>protected class MemoViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
private View rootView;
private TextView TV_memo_item_content;</BUG>
private ImageView IV_memo_item_delete;
| protected class MemoViewHolder extends DragSortAdapter.ViewHolder implements View.OnClickListener, View.OnLongClickListener {
private ImageView IV_memo_item_dot;
private TextView TV_memo_item_content;
|
28,332 | import jetbrains.mps.project.structure.modules.ModuleReference;
import jetbrains.mps.reloading.ClassLoaderManager;
import jetbrains.mps.smodel.*;
import jetbrains.mps.util.Computable;
import jetbrains.mps.util.Condition;
<BUG>import jetbrains.mps.util.ConditionalIterable;
import jetbrains.mps.workbench.actions.goTo.ind... | import jetbrains.mps.workbench.action.BaseAction;
import jetbrains.mps.workbench.actions.goTo.index.MPSChooseSNodeDescriptor;
|
28,333 | import java.awt.Frame;
import java.util.ArrayList;
import java.util.List;
public class ImportHelper {
public static void addModelImport(final Project project, final IModule module, final SModelDescriptor model,
<BUG>@Nullable ShortcutSet checkboxShortcut) {
BaseModelModel goToModelModel = new BaseModelModel(project) {<... | @Nullable BaseAction parentAction) {
BaseModelModel goToModelModel = new BaseModelModel(project) {
|
28,334 | @Nullable
public String getPromptText() {
return "Import model:";
}
};
<BUG>ChooseByNamePopup popup = MpsPopupFactory.createPackagePopup(project, goToModelModel);
if (checkboxShortcut != null) {
popup.setCheckBoxShortcut(checkboxShortcut);
}</BUG>
popup.invoke(new ChooseByNamePopupComponent.Callback() {
| ChooseByNamePopup popup = MpsPopupFactory.createPackagePopup(project, goToModelModel, parentAction);
|
28,335 | ((NavigationItem) element).navigate(true);
}
}, ModalityState.current(), true);
}
public static void addLanguageImport(Project project, final IModule contextModule, final SModelDescriptor model,
<BUG>@Nullable ShortcutSet checkboxShortcut) {
BaseLanguageModel goToLanguageModel = new BaseLanguageModel(project) {</BUG>
p... | @Nullable BaseAction parentAction) {
BaseLanguageModel goToLanguageModel = new BaseLanguageModel(project) {
|
28,336 | @Nullable
public String getPromptText() {
return "Import language:";
}
};
<BUG>ChooseByNamePopup popup = MpsPopupFactory.createPackagePopup(project, goToLanguageModel);
if (checkboxShortcut != null) {
popup.setCheckBoxShortcut(checkboxShortcut);
}</BUG>
popup.invoke(new ChooseByNamePopupComponent.Callback() {
| ChooseByNamePopup popup = MpsPopupFactory.createPackagePopup(project, goToLanguageModel, parentAction);
|
28,337 | @Nullable
public String getPromptText() {
return "Import model that contains root:";
}
};
<BUG>ChooseByNamePopup popup = MpsPopupFactory.createNodePopup(project, goToNodeModel, initialText);
if (checkboxShortcut != null) {
popup.setCheckBoxShortcut(checkboxShortcut);
}</BUG>
popup.invoke(new ChooseByNamePopupComponent... | return "Import language:";
ChooseByNamePopup popup = MpsPopupFactory.createPackagePopup(project, goToLanguageModel, parentAction);
|
28,338 | mLocalTachyonClusterResource.get().getWorkerAddress(),
mExecutorService, ClientContext.getConf(),
1 /* fake session id */, true, new ClientMetrics());
try {
Assert.assertFalse(blockWorkerClient.isConnected());
<BUG>clearLoginUser();
blockWorkerClient.connect();</BUG>
} finally {
blockWorkerClient.close();
ClientContext... | LoginUserTestUtils.updateLoginUser(ClientContext.getConf(), "no-tachyon");
blockWorkerClient.connect();
|
28,339 | mFsShell.close();
System.setOut(mOldOutput);
}
@Before
public final void before() throws Exception {
<BUG>Whitebox.setInternalState(LoginUser.class, "sLoginUser", (String) null);
mLocalTachyonCluster = mLocalTachyonClusterResource.get();</BUG>
mTfs = mLocalTachyonCluster.getClient();
mFsShell = new TfsShell(new Tachyon... | cleanLoginUser();
mLocalTachyonCluster = mLocalTachyonClusterResource.get();
|
28,340 | FileSystemMasterClient masterClient =
new FileSystemMasterClient(mLocalTachyonClusterResource.get().getMaster().getAddress(),
ClientContext.getConf());
try {
Assert.assertFalse(masterClient.isConnected());
<BUG>clearLoginUser();
masterClient.connect();</BUG>
} finally {
masterClient.close();
}
| LoginUserTestUtils.updateLoginUser(ClientContext.getConf(), "no-tachyon");
masterClient.connect();
|
28,341 | masterClient.createFile(new TachyonURI(filename), CreateFileOptions.defaults());
Assert.assertNotNull(masterClient.getStatus(new TachyonURI(filename)));
masterClient.disconnect();
masterClient.close();
}
<BUG>private void clearLoginUser() throws Exception {
Field field = LoginUser.class.getDeclaredField("sLoginUser");
... | LoginUserTestUtils.resetLoginUser();
|
28,342 | timeWarp = new OwnLabel(getFormattedTimeWrap(), skin, "warp");
timeWarp.setName("time warp");
Container wrapWrapper = new Container(timeWarp);
wrapWrapper.width(60f * GlobalConf.SCALE_FACTOR);
wrapWrapper.align(Align.center);
<BUG>VerticalGroup timeGroup = new VerticalGroup().align(Align.left).space(3 * GlobalConf.SCAL... | VerticalGroup timeGroup = new VerticalGroup().align(Align.left).columnAlign(Align.left).space(3 * GlobalConf.SCALE_FACTOR).padTop(3 * GlobalConf.SCALE_FACTOR);
|
28,343 | focusListScrollPane.setFadeScrollBars(false);
focusListScrollPane.setScrollingDisabled(true, false);
focusListScrollPane.setHeight(tree ? 200 * GlobalConf.SCALE_FACTOR : 100 * GlobalConf.SCALE_FACTOR);
focusListScrollPane.setWidth(160);
}
<BUG>VerticalGroup objectsGroup = new VerticalGroup().align(Align.left).space(3 *... | VerticalGroup objectsGroup = new VerticalGroup().align(Align.left).columnAlign(Align.left).space(3 * GlobalConf.SCALE_FACTOR);
|
28,344 | headerGroup.addActor(expandIcon);
headerGroup.addActor(detachIcon);
addActor(headerGroup);
expandIcon.setChecked(expanded);
}
<BUG>public void expand() {
</BUG>
if (!expandIcon.isChecked()) {
expandIcon.setChecked(true);
}
| public void expandPane() {
|
28,345 | </BUG>
if (!expandIcon.isChecked()) {
expandIcon.setChecked(true);
}
}
<BUG>public void collapse() {
</BUG>
if (expandIcon.isChecked()) {
expandIcon.setChecked(false);
}
| headerGroup.addActor(expandIcon);
headerGroup.addActor(detachIcon);
addActor(headerGroup);
expandIcon.setChecked(expanded);
public void expandPane() {
public void collapsePane() {
|
28,346 | });
playstop.addListener(new TextTooltip(txt("gui.tooltip.playstop"), skin));
TimeComponent timeComponent = new TimeComponent(skin, ui);
timeComponent.initialize();
CollapsiblePane time = new CollapsiblePane(ui, txt("gui.time"), timeComponent.getActor(), skin, true, playstop);
<BUG>time.align(Align.left);
mainActors.ad... | time.align(Align.left).columnAlign(Align.left);
mainActors.add(time);
|
28,347 | panes.put(visualEffectsComponent.getClass().getSimpleName(), visualEffects);
ObjectsComponent objectsComponent = new ObjectsComponent(skin, ui);
objectsComponent.setSceneGraph(sg);
objectsComponent.initialize();
CollapsiblePane objects = new CollapsiblePane(ui, txt("gui.objects"), objectsComponent.getActor(), skin, fal... | objects.align(Align.left).columnAlign(Align.left);
mainActors.add(objects);
|
28,348 | if (Constants.desktop) {
MusicComponent musicComponent = new MusicComponent(skin, ui);
musicComponent.initialize();
Actor[] musicActors = MusicActorsManager.getMusicActors() != null ? MusicActorsManager.getMusicActors().getActors(skin) : null;
CollapsiblePane music = new CollapsiblePane(ui, txt("gui.music"), musicCompo... | music.align(Align.left).columnAlign(Align.left);
mainActors.add(music);
|
28,349 | long before = ticker.read();
benchmarkMethod.invoke(benchmark, intReps);
return ticker.read() - before;
}
}
<BUG>public final class Pico extends RuntimeWorker {
</BUG>
@Inject Pico(@Benchmark Object benchmark,
@BenchmarkMethod Method method, Random random, Ticker ticker,
@WorkerOptions Map<String, String> workerOptions... | public static final class Pico extends RuntimeWorker {
|
28,350 | import static com.google.common.base.Preconditions.checkState;
import com.google.caliper.api.ResultProcessor;
import com.google.caliper.config.VmConfig.Builder;
import com.google.caliper.util.Util;
import com.google.common.annotations.VisibleForTesting;
<BUG>import com.google.common.base.Objects;
import com.google.comm... | import com.google.common.base.Predicate;
import com.google.common.collect.Collections2;
import com.google.common.collect.HashBiMap;
|
28,351 | public ImmutableMap<String, String> properties() {
return properties;
}
public VmConfig getDefaultVmConfig() {
return new Builder(new File(System.getProperty("java.home")))
<BUG>.addAllOptions(ManagementFactory.getRuntimeMXBean().getInputArguments())
.addAllOptions(getArgs(subgroupMap(properties, "vm")))</BUG>
.build(... | .addAllOptions(Collections2.filter(ManagementFactory.getRuntimeMXBean().getInputArguments(),
new Predicate<String>() {
@Override public boolean apply(@Nullable String input) {
return !input.startsWith("-agentlib:jdwp");
}))
.addAllOptions(getArgs(subgroupMap(properties, "vm")))
|
28,352 | fail("" + reps);
}
}
@Test
public void testExceptionInConstructor() throws Exception {
<BUG>try {
CaliperMain.exitlessMain(
new String[] {ExceptionInConstructorBenchmark.class.getName()}, out, err);</BUG>
fail();
} catch (UserCodeException expected) {}
| runner.forBenchmark(ExceptionInConstructorBenchmark.class).run();
|
28,353 | fail("" + reps);
}
}
@Test
public void testExceptionInMethod() throws Exception {
<BUG>try {
CaliperMain.exitlessMain(
new String[] {ExceptionInMethodBenchmark.class.getName()}, out, err);</BUG>
fail();
} catch (UserCodeException expected) {}
| public void testExceptionInConstructor() throws Exception {
runner.forBenchmark(ExceptionInConstructorBenchmark.class).run();
|
28,354 | return this.hashCode();
}
}
@Test
public void testComplexNonDeterministicAllocation_noTrackAllocations() throws Exception {
<BUG>runAllocationWorker(ComplexNonDeterministicAllocationBenchmark.class, false);
}</BUG>
@Test
public void testComplexNonDeterministicAllocation_trackAllocations() throws Exception {
| runner.forBenchmark(ComplexNonDeterministicAllocationBenchmark.class)
.instrument("allocation")
.options("-Cinstrument.allocation.options.trackAllocations=" + false)
.run();
|
28,355 | } else {
updateMemo();
callback.updateMemo();
}
dismiss();
<BUG>}else{
</BUG>
Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show();
}
}
| [DELETED] |
28,356 | }
@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);
|
28,357 | MemoEntry.COLUMN_REF_TOPIC__ID + " = ?"
, new String[]{String.valueOf(topicId)});
}
public Cursor selectMemo(long topicId) {
Cursor c = db.query(MemoEntry.TABLE_NAME, null, MemoEntry.COLUMN_REF_TOPIC__ID + " = ?", new String[]{String.valueOf(topicId)}, null, null,
<BUG>MemoEntry._ID + " DESC", null);
</BUG>
if (c != nu... | MemoEntry.COLUMN_ORDER + " ASC", null);
|
28,358 | MemoEntry._ID + " = ?",
new String[]{String.valueOf(memoId)});
}
public long updateMemoContent(long memoId, String memoContent) {
ContentValues values = new ContentValues();
<BUG>values.put(MemoEntry.COLUMN_CONTENT, memoContent);
return db.update(</BUG>
MemoEntry.TABLE_NAME,
values,
MemoEntry._ID + " = ?",
| return db.update(
|
28,359 | import android.widget.RelativeLayout;
import android.widget.TextView;
import com.kiminonawa.mydiary.R;
import com.kiminonawa.mydiary.db.DBManager;
import com.kiminonawa.mydiary.shared.EditMode;
<BUG>import com.kiminonawa.mydiary.shared.ThemeManager;
import java.util.List;
public class MemoAdapter extends RecyclerView.A... | import com.marshalchen.ultimaterecyclerview.dragsortadapter.DragSortAdapter;
public class MemoAdapter extends DragSortAdapter<DragSortAdapter.ViewHolder> implements EditMode {
|
28,360 | private DBManager dbManager;
private boolean isEditMode = false;
private EditMemoDialogFragment.MemoCallback callback;
private static final int TYPE_HEADER = 0;
private static final int TYPE_ITEM = 1;
<BUG>public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMe... | public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback, RecyclerView recyclerView) {
super(recyclerView);
this.mActivity = activity;
|
28,361 | this.memoList = memoList;
this.dbManager = dbManager;
this.callback = callback;
}
@Override
<BUG>public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
</BUG>
View view;
if (isEditMode) {
if (viewType == TYPE_HEADER) {
| public DragSortAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
28,362 | editMemoDialogFragment.show(mActivity.getSupportFragmentManager(), "editMemoDialogFragment");
}
});
}
}
<BUG>protected class MemoViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
private View rootView;
private TextView TV_memo_item_content;</BUG>
private ImageView IV_memo_item_delete;
| protected class MemoViewHolder extends DragSortAdapter.ViewHolder implements View.OnClickListener, View.OnLongClickListener {
private ImageView IV_memo_item_dot;
private TextView TV_memo_item_content;
|
28,363 | if (planManagerOptional.isPresent()) {
Plan plan = planManagerOptional.get().getPlan();
if (plan.isComplete()) {
plan.restart();
}
<BUG>plan.getStrategy().proceed();
return Response.status(Response.Status.OK)</BUG>
.entity(new CommandResultInfo("Received cmd: start"))
.build();
} else {
| PlanManager planManager = planManagerOptional.get();
return Response
.status(planManager.getPlan().isComplete() ? 200 : 503)
.entity(PlanInfo.forPlan(planManager.getPlan()))
|
28,364 | @Path("/plans/{planName}/stop")
public Response stopPlan(@PathParam("planName") String planName) {
final Optional<PlanManager> planManagerOptional = getPlanManager(planName);
if (planManagerOptional.isPresent()) {
Plan plan = planManagerOptional.get().getPlan();
<BUG>plan.getStrategy().interrupt();
plan.restart();</BUG... | plan.interrupt();
plan.restart();
|
28,365 | @POST
@Path("/plans/{planName}/continue")
public Response continueCommand(@PathParam("planName") String planName) {
final Optional<PlanManager> planManagerOptional = getPlanManager(planName);
if (planManagerOptional.isPresent()) {
<BUG>planManagerOptional.get().getPlan().getStrategy().proceed();
return Response.status(... | @Path("/plans/{planName}/stop")
public Response stopPlan(@PathParam("planName") String planName) {
Plan plan = planManagerOptional.get().getPlan();
plan.interrupt();
plan.restart();
return Response.status(Response.Status.OK)
.entity(new CommandResultInfo("Received cmd: stop"))
|
28,366 | @POST
@Path("/plans/{planName}/interrupt")
public Response interruptCommand(@PathParam("planName") String planName) {
final Optional<PlanManager> planManagerOptional = getPlanManager(planName);
if (planManagerOptional.isPresent()) {
<BUG>planManagerOptional.get().getPlan().getStrategy().interrupt();
return Response.sta... | @Path("/plans/{planName}/stop")
public Response stopPlan(@PathParam("planName") String planName) {
Plan plan = planManagerOptional.get().getPlan();
plan.interrupt();
plan.restart();
return Response.status(Response.Status.OK)
.entity(new CommandResultInfo("Received cmd: stop"))
|
28,367 | private Optional<Step> getStep(PlanManager manager, String phaseId, String stepId) {
List<Phase> phases = manager.getPlan().getChildren().stream()
.filter(phase -> phase.getId().equals(UUID.fromString(phaseId)))
.collect(Collectors.toList());
if (phases.size() == 1) {
<BUG>Element<Step> phase = phases.stream().findFirs... | List<Step> steps = phases.get(0).getChildren().stream()
|
28,368 | package com.mesosphere.sdk.scheduler.plan;
import com.mesosphere.sdk.scheduler.plan.strategy.DependencyStrategyHelper;
import com.mesosphere.sdk.scheduler.plan.strategy.Strategy;
import java.util.Collection;
<BUG>@SuppressWarnings("rawtypes")
public abstract class ElementBuilder<P extends Element<C>, C extends Element>... | public abstract class ElementBuilder<P extends ParentElement<? extends Element>, C extends Element> {
|
28,369 | </BUG>
protected final DependencyStrategyHelper<C> dependencyStrategyHelper = new DependencyStrategyHelper<>();
protected String name;
public ElementBuilder(String name) {
this.name = name;
<BUG>}
public ElementBuilder<P, C> addAll(C element)
throws DependencyStrategyHelper.InvalidDependencyException {</BUG>
dependency... | package com.mesosphere.sdk.scheduler.plan;
import com.mesosphere.sdk.scheduler.plan.strategy.DependencyStrategyHelper;
import com.mesosphere.sdk.scheduler.plan.strategy.Strategy;
import java.util.Collection;
public abstract class ElementBuilder<P extends ParentElement<? extends Element>, C extends Element> {
public Ele... |
28,370 | return this;
}
public ElementBuilder<P, C> addAll(Collection<C> elements)
throws DependencyStrategyHelper.InvalidDependencyException {
for (C element : elements) {
<BUG>addAll(element);
}</BUG>
return this;
}
public ElementBuilder<P, C> addDependency(C child, C parent) {
| add(element);
|
28,371 | public interface Element<C extends Element> extends Observable {
UUID getId();</BUG>
String getName();
Status getStatus();
<BUG>List<C> getChildren();
Strategy<C> getStrategy();</BUG>
void update(TaskStatus status);
void restart();
void forceComplete();
String getMessage();
| import org.apache.mesos.Protos.TaskStatus;
import com.mesosphere.sdk.scheduler.Observable;
import com.mesosphere.sdk.scheduler.plan.strategy.Strategy;
import java.util.List;
import java.util.UUID;
public interface Element extends Observable {
UUID getId();
|
28,372 | .map(taskInfoOptional -> taskInfoOptional.get())
.collect(Collectors.toList());
try {
Status status = taskInfos.isEmpty() ? Status.PENDING : getStatus(podInstance, taskInfos);
String stepName = TaskUtils.getStepName(podInstance, tasksToLaunch);
<BUG>return new DefaultStep(
</BUG>
stepName,
status,
PodInstanceRequiremen... | return new DeploymentStep(
|
28,373 | import org.apache.mesos.Protos;
import java.util.*;
public class DefaultPlanManager extends ChainedObserver implements PlanManager {
private final Plan plan;
public DefaultPlanManager(final Plan plan) {
<BUG>plan.getStrategy().interrupt();
this.plan = plan;</BUG>
this.plan.subscribe(this);
}
@Override
| plan.interrupt();
this.plan = plan;
|
28,374 | .map(taskSpec -> taskSpec.getName())
.collect(Collectors.toList());
try {
steps.add(stepFactory.getStep(podInstance, tasksToLaunch));
} catch (Step.InvalidStepException | InvalidRequirementException e) {
<BUG>steps.add(new DefaultStep(
</BUG>
PodInstance.getName(podSpec, i),
Status.ERROR,
PodInstanceRequirement.create(... | steps.add(new DeploymentStep(
|
28,375 | import javax.swing.JPanel;
import javax.swing.JSlider;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import tufts.vue.gui.DockWindow;
<BUG>import tufts.vue.gui.GUI;
public class PrototypePanel extends JPanel implements ChangeListener {</BUG>
public static final long serialVersionUID = ... | import tufts.vue.gui.WidgetStack;
public class PrototypePanel extends JPanel implements ChangeListener {
|
28,376 | constraints.weighty = 0.0;
constraints.gridx = 0;
constraints.gridy = 0;
constraints.gridheight = 1;
constraints.gridwidth = 1;
<BUG>constraints.insets = halfGutterInsets;
zoomSelButton = new JButton();</BUG>
zoomSelButton.setAction(tufts.vue.Actions.ZoomToSelection);
zoomPanel.add(zoomSelButton, constraints);
zoomMapB... | zoomPanel = new JPanel();
zoomPanel.setLayout(new GridBagLayout());
zoomSelButton = new JButton();
|
28,377 | zoomLockCheckBox = new JCheckBox("Lock On");
zoomLockCheckBox.addChangeListener(this);
constraints.gridx = 1;
constraints.gridy = 0;
constraints.gridheight = 2;
<BUG>zoomPanel.add(zoomLockCheckBox, constraints);
fadeLabel = new JLabel("Opacity");</BUG>
constraints.gridx = 0;
constraints.gridheight = 1;
fadePanel.add(fa... | fadePanel = new JPanel();
fadePanel.setLayout(new GridBagLayout());
fadeLabel = new JLabel("Opacity");
|
28,378 | fadeLabel.setOpaque(true);
fadeSlider.setBackground(Color.BLUE);
fadeSlider.setOpaque(true);
zoomPanel.setBackground(Color.ORANGE);
zoomPanel.setOpaque(true);
<BUG>linePanel.setBackground(Color.ORANGE);
linePanel.setOpaque(true);</BUG>
fadePanel.setBackground(Color.ORANGE);
fadePanel.setOpaque(true);
}
| [DELETED] |
28,379 | public void finalize() {
zoomLockCheckBox = null;
zoomSelButton = null;
zoomMapButton = null;
fadeSlider = null;
<BUG>fadeLabel = null;
}</BUG>
public static void zoomIfLocked() {
if (zoomLockCheckBox.isSelected()) {
zoom();
| zoomPanel = null;
fadePanel = null;
widgetStack = null;
}
|
28,380 | docElement.getTextContent();
} catch (final Throwable e) {
domLevel3 = false;
}
for (org.w3c.dom.Node node : new IterableNodeList(docElement.getChildNodes())) {
<BUG>final String nodeName = node.getNodeName();
</BUG>
if ("network".equals(nodeName)) {
handleNetwork(node);
} else if ("group".equals(nodeName)) {
| final String nodeName = cleanNodeName(node.getNodeName());
|
28,381 | final String value = att.getNodeValue();
interfaces.setEnabled(checkTrue(value));
}
}
for (org.w3c.dom.Node n : new IterableNodeList(node.getChildNodes())) {
<BUG>if ("interface".equalsIgnoreCase(n.getNodeName())) {
</BUG>
final String value = getTextContent(n).trim();
interfaces.addInterface(value);
}
| if ("interface".equalsIgnoreCase(cleanNodeName(n.getNodeName()))) {
|
28,382 | invoke(target, method, value);
}
}
for (org.w3c.dom.Node n : new IterableNodeList(node.getChildNodes())) {
final String value = getTextContent(n).trim();
<BUG>String methodName = "set" + getMethodName(n.getNodeName());
</BUG>
Method method = getMethod(target, methodName);
invoke(target, method, value);
}
| String methodName = "set" + getMethodName(cleanNodeName(n.getNodeName()));
|
28,383 | if (att.getNodeName().equals("auto-increment")) {
config.setPortAutoIncrement(checkTrue(value));
}
}
}
<BUG>private void handleQueue(final org.w3c.dom.Node node) {
</BUG>
final Node attName = node.getAttributes().getNamedItem("name");
final String name = getTextContent(attName);
final QueueConfig qConfig = new QueueCon... | public void handleQueue(final org.w3c.dom.Node node) {
|
28,384 | final Node attName = node.getAttributes().getNamedItem("name");
final String name = getTextContent(attName);
final QueueConfig qConfig = new QueueConfig();
qConfig.setName(name);
for (org.w3c.dom.Node n : new IterableNodeList(node.getChildNodes())) {
<BUG>final String nodeName = n.getNodeName().toLowerCase();
</BUG>
fi... | final String nodeName = cleanNodeName(n.getNodeName());
|
28,385 | qConfig.setTimeToLiveSeconds(getIntegerValue("time-to-live-seconds", value, QueueConfig.DEFAULT_TTL_SECONDS));
}
}
this.config.getQConfigs().put(name, qConfig);
}
<BUG>private void handleMap(final org.w3c.dom.Node node) throws Exception {
</BUG>
final Node attName = node.getAttributes().getNamedItem("name");
final Stri... | public void handleMap(final org.w3c.dom.Node node) throws Exception {
|
28,386 | final Node attName = node.getAttributes().getNamedItem("name");
final String name = getTextContent(attName);
final MapConfig mapConfig = new MapConfig();
mapConfig.setName(name);
for (org.w3c.dom.Node n : new IterableNodeList(node.getChildNodes())) {
<BUG>final String nodeName = n.getNodeName().toLowerCase();
</BUG>
fi... | final String nodeName = cleanNodeName(n.getNodeName());
|
28,387 | if (att.getNodeName().equals("enabled")) {
mapStoreConfig.setEnabled(checkTrue(value));
}
}
for (org.w3c.dom.Node n : new IterableNodeList(node.getChildNodes())) {
<BUG>final String nodeName = n.getNodeName().toLowerCase();
</BUG>
final String value = getTextContent(n).trim();
if ("class-name".equals(nodeName)) {
mapSt... | final String nodeName = cleanNodeName(n.getNodeName());
|
28,388 | join.getTcpIpConfig().addAddress(new Address(hostStr, Integer.parseInt(portStr), true));
} catch (UnknownHostException e) {
e.printStackTrace();
}
}
<BUG>} else if ("interface".equalsIgnoreCase(n.getNodeName())) {
</BUG>
final int indexStar = value.indexOf('*');
final int indexDash = value.indexOf('-');
if (indexStar =... | } else if ("interface".equals(cleanNodeName(n.getNodeName()))) {
|
28,389 | final String name = getTextContent(attName);
final TopicConfig tConfig = new TopicConfig();
tConfig.setName(name);
for (org.w3c.dom.Node n : new IterableNodeList(node.getChildNodes())) {
final String value = getTextContent(n).trim();
<BUG>if (n.getNodeName().equalsIgnoreCase("global-ordering-enabled")) {
</BUG>
tConfig... | if (cleanNodeName(n.getNodeName()).equals("global-ordering-enabled")) {
|
28,390 | return this;
}
public Config setProperty(String name, String value) {
properties.put(name, value);
return this;
<BUG>}
public Properties getProperties() {</BUG>
return properties;
}
public String getProperty(String name) {
| public void setProperties(final Properties properties) {
this.properties = properties;
public Properties getProperties() {
|
28,391 | this.mapTopicConfigs = mapTopicConfigs;
return this;
}
public Map<String, QueueConfig> getQConfigs() {
return mapQueueConfigs;
<BUG>}
public Config setMapQConfigs(Map<String, QueueConfig> mapQConfigs) {</BUG>
this.mapQueueConfigs = mapQConfigs;
return this;
}
| public void setQConfigs(Map<String, QueueConfig> mapQConfigs) {
public Config setMapQConfigs(Map<String, QueueConfig> mapQConfigs) {
|
28,392 | public class UserControllerTest
{
private static final Logger LOGGER = Logger.getLogger( UserControllerTest.class.getName() );
Properties properties = new Properties();
InputStream input = null;
<BUG>private String neo4jServerPort = System.getProperty( "neo4j.server.port" );
private String neo4jRemoteShellPort = System... | private String dbmsConnectorHttpPort = System.getProperty( "dbms.connector.http.port" );
private String dbmsConnectorBoltPort = System.getProperty( "dbms.connector.bolt.port" );
private String dbmsShellPort = System.getProperty( "dbms.shell.port" );
private String dbmsDirectoriesData = System.getProperty( "dbms.directo... |
28,393 | @Bean
public Configuration getConfiguration()
{
if ( StringUtils.isEmpty( url ) )
{
<BUG>url = "http://localhost:" + port;
</BUG>
}
Configuration config = new Configuration();
config.driverConfiguration().setDriverClassName( HttpDriver.class.getName() )
| url = "http://localhost:" + dbmsConnectorHttpPort;
|
28,394 | import de.jungblut.math.DoubleVector;
import de.jungblut.math.dense.DenseDoubleMatrix;</BUG>
import de.jungblut.math.dense.DenseDoubleVector;
<BUG>import de.jungblut.math.minimize.Minimizer;
public final class LogisticRegression extends AbstractClassifier {
public static long SEED = System.currentTimeMillis();</BUG>
pr... | import de.jungblut.math.DoubleVector.DoubleVectorElement;
import de.jungblut.math.dense.DenseDoubleMatrix;
import de.jungblut.math.sparse.SparseDoubleRowMatrix;
import de.jungblut.math.sparse.SparseDoubleVector;
|
28,395 | super();
this.lambda = lambda;
this.minimizer = minimizer;
this.numIterations = numIterations;
this.verbose = verbose;
<BUG>this.random = new Random(SEED);
}</BUG>
public LogisticRegression(DoubleVector theta) {
this(0d, null, 1, false);
this.theta = theta;
| this.random = new Random();
}
|
28,396 | package de.jungblut.classification.regression;
import static org.junit.Assert.assertEquals;
<BUG>import static org.junit.Assert.assertTrue;
import org.junit.Test;
import de.jungblut.classification.Classifier;</BUG>
import de.jungblut.classification.eval.Evaluator;
import de.jungblut.classification.eval.Evaluator.Evalua... | import java.util.Random;
|
28,397 | import org.junit.Test;
import de.jungblut.classification.Classifier;</BUG>
import de.jungblut.classification.eval.Evaluator;
import de.jungblut.classification.eval.Evaluator.EvaluationResult;
import de.jungblut.math.DoubleVector;
<BUG>import de.jungblut.math.dense.DenseDoubleMatrix;
import de.jungblut.math.dense.DenseD... | [DELETED] |
28,398 | assertEquals("Training error was: " + trainingError
+ " and should have been between 9 and 13.", trainingError, 11, 2d);
}
@Test
public void testRegressionEvaluation() {
<BUG>Classifier clf = new LogisticRegression(1.0d, new Fmincg(), 1000, false);
EvaluationResult eval = Evaluator.evaluateClassifier(clf, features,</B... | LogisticRegression clf = new LogisticRegression(1.0d, new Fmincg(), 1000,
clf.setRandom(new Random(0));
EvaluationResult eval = Evaluator.evaluateClassifier(clf, features,
|
28,399 | nameMappings = new HashMap<AbstractElement, String>() {
private static final long serialVersionUID = 1L;
{
put(grammarAccess.getShape_ImplAccess().getAlternatives_3(), "rule__Shape_Impl__Alternatives_3");
put(grammarAccess.getShape_ImplAccess().getAlternatives_8(), "rule__Shape_Impl__Alternatives_8");
<BUG>put(grammarA... | [DELETED] |
28,400 | put(grammarAccess.getShape_ImplAccess().getGroup(), "rule__Shape_Impl__Group__0");
put(grammarAccess.getTriangleAccess().getGroup(), "rule__Triangle__Group__0");
put(grammarAccess.getTriangleAccess().getGroup_2(), "rule__Triangle__Group_2__0");
put(grammarAccess.getTriangleAccess().getGroup_5(), "rule__Triangle__Group_... | [DELETED] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.