id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
22,601 | 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 );
|
22,602 | 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 );
|
22,603 | 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_();
|
22,604 | 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_();
|
22,605 | 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_();
|
22,606 | {
ReverseDependencyLink p1 = (ReverseDependencyLink) o1;
ReverseDependencyLink p2 = (ReverseDependencyLink) o2;
return p1.getProject().getId().compareTo( p2.getProject().getId() );
}
<BUG>else
{</BUG>
return 0;
}
}
| iconError( sink );
|
22,607 | return iterator();
}
long checkTime = fromTime + DateUtils.getTimeDiff();
QueryBuilder<PlayerWarnData, Integer> query = queryBuilder();
Where<PlayerWarnData, Integer> where = query.where();
<BUG>where
.ge("created", checkTime)
.or()
.ge("updated", checkTime);</BUG>
query.setWhere(where);
| where.ge("created", checkTime);
|
22,608 | public abstract class RxFragment extends DialogFragment {</BUG>
private BlockingProgressFragment blockingProgressFragment;
private Toolbar toolbar;
private boolean traceLog;
<BUG>private final BehaviorSubject<LifecycleEvent> lifecycleSubject = BehaviorSubject.create();
private Observable<LifecycleEvent> lifecycle() {
r... | import rx.Subscription;
import rx.android.app.AppObservable;
import rx.functions.Action0;
@SuppressWarnings("UnusedDeclaration")
public abstract class RxFragment extends DialogFragment {
|
22,609 | abstract protected boolean isDebug();
protected void enableTraceLog(boolean enable) {
traceLog = enable;
}
@Override
<BUG>public void onAttach(android.app.Activity activity) {
if (traceLog) Log.d("TRACE", "--> RxFragment.onAttach()");
super.onAttach(activity);
lifecycleSubject.onNext(LifecycleEvent.ATTACH);</BUG>
}
| [DELETED] |
22,610 | if (traceLog) Log.d("TRACE", "--> RxFragment.onAttach()");
super.onAttach(activity);
lifecycleSubject.onNext(LifecycleEvent.ATTACH);</BUG>
}
@Override
<BUG>public void onCreate(Bundle savedInstanceState) {
if (traceLog) Log.d("TRACE", "--> RxFragment.onCreate()");
super.onCreate(savedInstanceState);
lifecycleSubject.on... | abstract protected boolean isDebug();
protected void enableTraceLog(boolean enable) {
traceLog = enable;
|
22,611 | if (traceLog) Log.d("TRACE", "--> RxFragment.onCreate()");
super.onCreate(savedInstanceState);
lifecycleSubject.onNext(LifecycleEvent.CREATE);</BUG>
}
@Override
<BUG>public void onActivityCreated(Bundle savedInstanceState) {
if (traceLog) Log.d("TRACE", "--> RxFragment.onActivityCreated()");
super.onActivityCreated(sav... | abstract protected boolean isDebug();
protected void enableTraceLog(boolean enable) {
traceLog = enable;
public void onAttach(android.app.Activity activity) {
if (traceLog) {
Log.d("TRACE", "--> RxFragment.onAttach()");
super.onAttach(activity);
|
22,612 | if (traceLog) Log.d("TRACE", "--> RxFragment.onStart()");
super.onStart();
lifecycleSubject.onNext(LifecycleEvent.START);</BUG>
}
@Override
<BUG>public void onResume() {
if (traceLog) Log.d("TRACE", "--> RxFragment.onResume()");
super.onResume();
lifecycleSubject.onNext(LifecycleEvent.RESUME);</BUG>
}
| abstract protected boolean isDebug();
protected void enableTraceLog(boolean enable) {
traceLog = enable;
|
22,613 | if (traceLog) Log.d("TRACE", "--> RxFragment.onResume()");
super.onResume();
lifecycleSubject.onNext(LifecycleEvent.RESUME);</BUG>
}
@Override
<BUG>public void onPause() {
if (traceLog) Log.d("TRACE", "--> RxFragment.onPause()");
lifecycleSubject.onNext(LifecycleEvent.PAUSE);
super.onPause();</BUG>
}
| abstract protected boolean isDebug();
protected void enableTraceLog(boolean enable) {
traceLog = enable;
|
22,614 | if (traceLog) Log.d("TRACE", "--> RxFragment.onPause()");
lifecycleSubject.onNext(LifecycleEvent.PAUSE);
super.onPause();</BUG>
}
@Override
<BUG>public void onStop() {
if (traceLog) Log.d("TRACE", "--> RxFragment.onStop()");
lifecycleSubject.onNext(LifecycleEvent.STOP);
super.onStop();</BUG>
}
| abstract protected boolean isDebug();
protected void enableTraceLog(boolean enable) {
traceLog = enable;
|
22,615 | if (traceLog) Log.d("TRACE", "--> RxFragment.onStop()");
lifecycleSubject.onNext(LifecycleEvent.STOP);
super.onStop();</BUG>
}
@Override
<BUG>public void onDestroyView() {
if (traceLog) Log.d("TRACE", "--> RxFragment.onDestroyView()");
lifecycleSubject.onNext(LifecycleEvent.DESTROY_VIEW);
super.onDestroyView();</BUG>
}... | abstract protected boolean isDebug();
protected void enableTraceLog(boolean enable) {
traceLog = enable;
|
22,616 | if (traceLog) Log.d("TRACE", "--> RxFragment.onDestroyView()");
lifecycleSubject.onNext(LifecycleEvent.DESTROY_VIEW);
super.onDestroyView();</BUG>
}
@Override
<BUG>public void onDetach() {
if (traceLog) Log.d("TRACE", "--> RxFragment.onDetach()");
lifecycleSubject.onNext(LifecycleEvent.DETACH);
super.onDetach();</BUG>
... | abstract protected boolean isDebug();
protected void enableTraceLog(boolean enable) {
traceLog = enable;
|
22,617 | package edu.stanford.nlp.graph;
<BUG>import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.HashSet;
import java.util.Set;
</BUG>
import edu.stanford.nlp.util.CollectionUtils;
| import java.util.*;
|
22,618 | 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() {
|
22,619 | private String[] args;
private BootLogger bootLogger;
private Duration shutdownTimeout;
private Supplier<Collection<BQModule>> modulesSource;
private BQCoreModule() {
<BUG>this.shutdownTimeout = Duration.ofMillis(10000l);
</BUG>
}
public static Builder builder() {
return new Builder();
| this.shutdownTimeout = Duration.ofMillis(10000L);
|
22,620 | public static Builder builder() {
return new Builder();
}
public static BQCoreModuleExtender extend(Binder binder) {
return new BQCoreModuleExtender(binder);
<BUG>}
public static Multibinder<Command> contributeCommands(Binder binder) {</BUG>
return Multibinder.newSetBinder(binder, Command.class);
}
@Deprecated
| public static Multibinder<Command> contributeCommands(Binder binder) {
|
22,621 | extend(binder).setApplicationDescription(description);
binder.bind(ApplicationDescription.class).toInstance(new ApplicationDescription(description));
}
@Deprecated
public static void setDefaultCommand(Binder binder, Class<? extends Command> commandType) {
<BUG>binder.bind(Key.get(Command.class, DefaultCommand.class)).t... | extend(binder).setDefaultCommand(commandType);
extend(binder).setDefaultCommand(command);
|
22,622 | binder.bind(String[].class).annotatedWith(Args.class).toInstance(Objects.requireNonNull(args));
binder.bind(Duration.class).annotatedWith(ShutdownTimeout.class)
.toInstance(Objects.requireNonNull(shutdownTimeout));
binder.bind(ConfigurationFactory.class).toProvider(JsonNodeConfigurationFactoryProvider.class).in(Singlet... | BQCoreModule.extend(binder).addCommand(HelpCommand.class);
BQCoreModule.extend(binder).addCommand(HelpConfigCommand.class);
}
|
22,623 | Set<DeclaredVariable> declaredVariables,
ModulesMetadata modulesMetadata) {
ApplicationMetadata.Builder builder = ApplicationMetadata
.builder()
.description(descriptionHolder.getDescription())
<BUG>.addOptions(options);
commandManager.getCommands().values().forEach(c -> {
builder.addCommand(c.getMetadata());
});</BUG>... | commandManager.getCommands().values().forEach(c -> builder.addCommand(c.getMetadata()));
|
22,624 | assertFalse(runtime.getInstance(Cli.class).hasOption("help"));
}
@Test
public void testOverlappingOptions() {
BQRuntime runtime = runtimeFactory.app("--o1")
<BUG>.module(b -> BQCoreModule.extend(b).setOptions(
</BUG>
OptionMetadata.builder("o1").build(),
OptionMetadata.builder("o2").build()
))
| .module(b -> BQCoreModule.extend(b).addOptions(
|
22,625 | runtime.getInstance(Cli.class);
}
@Test(expected = ProvisionException.class)
public void testCommand_IllegalShort() {
BQRuntime runtime = runtimeFactory.app("-x")
<BUG>.module(b -> BQCoreModule.contributeCommands(b).addBinding().to(XaCommand.class))
.createRuntime();</BUG>
runtime.getInstance(Cli.class);
}
@Test
| .module(b -> BQCoreModule.extend(b).addCommand(XaCommand.class))
.createRuntime();
|
22,626 | assertFalse(commandManager.getDefaultCommand().isPresent());
assertSame(runtime.getInstance(HelpCommand.class), commandManager.getHelpCommand().get());
}
@Test
public void testDefaultAndHelpAndModuleCommands() {
<BUG>Command defaultCommand = cli -> CommandOutcome.succeeded();
Module defaultCommandModule =
binder -> BQC... | Module defaultCommandModule = binder -> BQCoreModule.extend(binder).setDefaultCommand(defaultCommand);
|
22,627 | mockCommand = mock(Command.class);
when(mockCommand.getMetadata()).thenReturn(CommandMetadata.builder("m0command").build());
}
@Override
public void configure(Binder binder) {
<BUG>BQCoreModule.contributeCommands(binder).addBinding().toInstance(mockCommand);
}</BUG>
}
static class M1 implements Module {
static final Co... | BQCoreModule.extend(binder).addCommand(mockCommand);
|
22,628 | private Binder binder;
private MapBinder<String, String> properties;
private MapBinder<String, String> variables;
private MapBinder<String, Level> logLevels;
private Multibinder<DeclaredVariable> declaredVariables;
<BUG>private Multibinder<OptionMetadata> options;
protected BQCoreModuleExtender(Binder binder) {</BUG>
t... | private Multibinder<Command> commands;
protected BQCoreModuleExtender(Binder binder) {
|
22,629 | import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.security.DigestOutputStream;
import java.security.MessageDigest;
<BUG>import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;</BUG>
public final class ... | import java.text.DateFormat;
import java.util.Date;
import java.util.List;
|
22,630 | package org.jboss.as.patching.runner;
<BUG>import org.jboss.as.boot.DirectoryStructure;
import org.jboss.as.patching.LocalPatchInfo;</BUG>
import org.jboss.as.patching.PatchInfo;
import org.jboss.as.patching.PatchLogger;
import org.jboss.as.patching.PatchMessages;
| import static org.jboss.as.patching.runner.PatchUtils.generateTimestamp;
import org.jboss.as.patching.CommonAttributes;
import org.jboss.as.patching.LocalPatchInfo;
|
22,631 | private static final String PATH_DELIMITER = "/";
public static final byte[] NO_CONTENT = PatchingTask.NO_CONTENT;
enum Element {
ADDED_BUNDLE("added-bundle"),
ADDED_MISC_CONTENT("added-misc-content"),
<BUG>ADDED_MODULE("added-module"),
BUNDLES("bundles"),</BUG>
CUMULATIVE("cumulative"),
DESCRIPTION("description"),
MIS... | APPLIES_TO_VERSION("applies-to-version"),
BUNDLES("bundles"),
|
22,632 | final int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
final String value = reader.getAttributeValue(i);
final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
<BUG>case APPLIES_TO_VERSION:
builder.addAppliesTo(value);
break;</BUG>
case RESULTING_VE... | [DELETED] |
22,633 | final StringBuilder path = new StringBuilder();
for(final String p : item.getPath()) {
path.append(p).append(PATH_DELIMITER);
}
path.append(item.getName());
<BUG>writer.writeAttribute(Attribute.PATH.name, path.toString());
if(type != ModificationType.REMOVE) {</BUG>
writer.writeAttribute(Attribute.HASH.name, bytesToHex... | if (item.isDirectory()) {
writer.writeAttribute(Attribute.DIRECTORY.name, "true");
if(type != ModificationType.REMOVE) {
|
22,634 | package org.jboss.as.patching;
import org.jboss.as.controller.OperationFailedException;
import org.jboss.as.patching.runner.PatchingException;
import org.jboss.logging.Messages;
import org.jboss.logging.annotations.Message;
<BUG>import org.jboss.logging.annotations.MessageBundle;
import java.io.IOException;</BUG>
impor... | import org.jboss.logging.annotations.Cause;
import java.io.IOException;
|
22,635 | RecordingSize supportedRecordingSize = wrapper.getSupportedRecordingSize(320, 240);
assertEquals(supportedRecordingSize.width, 640);
assertEquals(supportedRecordingSize.height, 480);
}
@Test
<BUG>public void getSupportedVideoSizesHoneyComb() {
NativeCamera mockCamera = mock(NativeCamera.class);
configureMockCameraParam... | NativeCamera mockCamera = createCameraWithMockParameters(640, 480, 1280, 960);
final CameraWrapper wrapper = new CameraWrapper(mockCamera, Surface.ROTATION_0);
List<Size> supportedVideoSizes = wrapper.getSupportedVideoSizes(VERSION_CODES.HONEYCOMB);
|
22,636 | verify(mockCamera, times(1)).updateNativeCameraParameters(mockParameters);
}
@Test
public void setPreviewFormatWhenConfiguringCamera() throws Exception {
NativeCamera mockCamera = mock(NativeCamera.class);
<BUG>Parameters mockParameters = createMockParametersWithPreviewSize(800, 600);
</BUG>
doReturn(mockParameters).wh... | Parameters mockParameters = createMockParameters(0, 0, 800, 600);
|
22,637 | verify(mockParameters, times(1)).setPreviewFormat(ImageFormat.NV21);
}
@Test
public void setPreviewSizeWhenConfiguringCamera() throws Exception {
NativeCamera mockCamera = mock(NativeCamera.class);
<BUG>Parameters mockParameters = createMockParametersWithPreviewSize(300, 700);
</BUG>
doReturn(mockParameters).when(mockC... | Parameters mockParameters = createMockParameters(0, 0, 300, 700);
|
22,638 | verify(mockParameters, times(1)).setPreviewSize(300, 700);
}
@Test
public void updateParametersWhenConfiguringCamera() throws Exception {
NativeCamera mockCamera = mock(NativeCamera.class);
<BUG>Parameters mockParameters = createMockParametersWithPreviewSize(800, 600);
</BUG>
doReturn(mockParameters).when(mockCamera).g... | Parameters mockParameters = createMockParameters(0, 0, 800, 600);
|
22,639 | 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);
|
22,640 | .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) {
|
22,641 | package org.apache.sling.ide.eclipse.core.internal;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
<BUG>import java.util.Set;
import org.eclipse.core.resources.IFile;</BUG>
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
i... | import org.apache.sling.ide.eclipse.core.debug.PluginLogger;
import org.eclipse.core.resources.IFile;
|
22,642 | package org.apache.sling.ide.eclipse.core.internal;
<BUG>import org.apache.sling.ide.eclipse.core.ServiceUtil;
import org.apache.sling.ide.filter.FilterLocator;</BUG>
import org.apache.sling.ide.osgi.OsgiClientFactory;
import org.apache.sling.ide.serialization.SerializationManager;
import org.apache.sling.ide.transport... | import org.apache.sling.ide.eclipse.core.debug.PluginLogger;
import org.apache.sling.ide.eclipse.core.debug.PluginLoggerRegistrar;
import org.apache.sling.ide.filter.FilterLocator;
|
22,643 | serializationManager.open();
filterLocator = new ServiceTracker<FilterLocator, FilterLocator>(context, FilterLocator.class, null);
filterLocator.open();
osgiClientFactory = new ServiceTracker<OsgiClientFactory, OsgiClientFactory>(context, OsgiClientFactory.class,
null);
<BUG>osgiClientFactory.open();
}
public void stop... | ServiceReference<Object> reference = (ServiceReference<Object>) tracerRegistration.getReference();
tracer = new ServiceTracker<Object, Object>(context, reference, null);
tracer.open();
tracerRegistration.unregister();
repositoryFactory.close();
|
22,644 | }
public void stop(BundleContext context) throws Exception {
repositoryFactory.close();</BUG>
serializationManager.close();
filterLocator.close();
<BUG>osgiClientFactory.close();
plugin = null;</BUG>
super.stop(context);
}
public static Activator getDefault() {
| tracerRegistration.unregister();
repositoryFactory.close();
tracer.close();
plugin = null;
|
22,645 | public static String getSyncDirectoryValue(IProject project) {
String value = null;
try {
value = project.getPersistentProperty(new QualifiedName(Activator.PLUGIN_ID, PROPERTY_SYNC_ROOT));
} catch (CoreException e) {
<BUG>Activator.getDefault().getLog().log(new Status(Status.ERROR, Activator.PLUGIN_ID, e.getMessage(), ... | Activator.getDefault().getPluginLogger().error(e.getMessage(), e);
}
|
22,646 | package org.glowroot.agent.config;
import com.google.common.collect.ImmutableList;
<BUG>import org.immutables.value.Value;
import org.glowroot.wire.api.model.AgentConfigOuterClass.AgentConfig;</BUG>
@Value.Immutable
public abstract class UiConfig {
@Value.Default
| import org.glowroot.common.config.ConfigDefaults;
import org.glowroot.wire.api.model.AgentConfigOuterClass.AgentConfig;
|
22,647 | class RepoAdminImpl implements RepoAdmin {
private final DataSource dataSource;
private final List<CappedDatabase> rollupCappedDatabases;
private final CappedDatabase traceCappedDatabase;
private final ConfigRepository configRepository;
<BUG>private final AgentDao agentDao;
</BUG>
private final GaugeValueDao gaugeValue... | private final EnvironmentDao agentDao;
|
22,648 | private final TransactionTypeDao transactionTypeDao;
private final FullQueryTextDao fullQueryTextDao;
private final TraceAttributeNameDao traceAttributeNameDao;
RepoAdminImpl(DataSource dataSource, List<CappedDatabase> rollupCappedDatabases,
CappedDatabase traceCappedDatabase, ConfigRepository configRepository,
<BUG>Ag... | EnvironmentDao agentDao, GaugeValueDao gaugeValueDao, GaugeNameDao gaugeNameDao,
|
22,649 | this.fullQueryTextDao = fullQueryTextDao;
this.traceAttributeNameDao = traceAttributeNameDao;
}
@Override
public void deleteAllData() throws Exception {
<BUG>Environment environment = agentDao.readEnvironment("");
dataSource.deleteAll();</BUG>
agentDao.reinitAfterDeletingDatabase();
gaugeValueDao.reinitAfterDeletingDat... | Environment environment = agentDao.read("");
dataSource.deleteAll();
|
22,650 | public class SimpleRepoModule {
private static final long SNAPSHOT_REAPER_PERIOD_MINUTES = 5;
private final DataSource dataSource;
private final ImmutableList<CappedDatabase> rollupCappedDatabases;
private final CappedDatabase traceCappedDatabase;
<BUG>private final AgentDao agentDao;
private final TransactionTypeDao t... | private final EnvironmentDao environmentDao;
private final TransactionTypeDao transactionTypeDao;
|
22,651 | 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);
|
22,652 | 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,
|
22,653 | 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;
|
22,654 | 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;
|
22,655 | 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;
|
22,656 | 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;
|
22,657 | 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(),
|
22,658 | .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())
|
22,659 | .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())
|
22,660 | }
@Override
public void lazyRegisterMBean(Object object, String name) {
lazyPlatformMBeanServer.lazyRegisterMBean(object, name);
}
<BUG>}
}
</BUG>
| void initEmbeddedServer() throws Exception {
if (simpleRepoModule == null) {
return;
|
22,661 | 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] |
22,662 | 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) {
|
22,663 | 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);
|
22,664 | 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();
|
22,665 | 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");
|
22,666 | 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;
|
22,667 | </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 ... |
22,668 | chart.addYAxisLabels(AxisLabelsFactory.newAxisLabels(labels));
chart.addXAxisLabels(AxisLabelsFactory.newNumericRangeAxisLabels(0, max));
chart.setBarWidth(BarChart.AUTO_RESIZE);
chart.setSize(600, 500);
chart.setHorizontal(true);
<BUG>chart.setTitle("Total Evaluations by User");
showChartImg(resp, chart.toURLString())... | chart.setDataEncoding(DataEncoding.TEXT);
return chart;
}
|
22,669 | checkEvaluationsEqual(eval4, foundissueProto.getEvaluations(0));
checkEvaluationsEqual(eval5, foundissueProto.getEvaluations(1));
}
public void testGetRecentEvaluationsNoneFound() throws Exception {
DbIssue issue = createDbIssue("fad", persistenceHelper);
<BUG>DbEvaluation eval1 = createEvaluation(issue, "someone", 100... | [DELETED] |
22,670 | public int read() throws IOException {
return inputStream.read();
}
});
}
<BUG>}
protected DbEvaluation createEvaluation(DbIssue issue, String who, long when) {</BUG>
DbUser user;
Query query = getPersistenceManager().newQuery("select from " + persistenceHelper.getDbUserClass().getName()
+ " where openid == :myopenid")... | @SuppressWarnings({"unchecked"})
protected DbEvaluation createEvaluation(DbIssue issue, String who, long when) {
|
22,671 | eval.setComment("my comment");
eval.setDesignation("MUST_FIX");
eval.setIssue(issue);
eval.setWhen(when);
eval.setWho(user.createKeyObject());
<BUG>eval.setEmail(who);
return eval;</BUG>
}
protected PersistenceManager getPersistenceManager() {
return testHelper.getPersistenceManager();
| issue.addEvaluation(eval);
return eval;
|
22,672 | encodingLength += MESSAGE_HEADER_ENCODER.encodedLength();
encodingLength += encode(CAR_ENCODER_0, directBuffer, bufferOffset);
final String encodingFilename = System.getProperty(ENCODING_FILENAME);
if (encodingFilename != null)
{
<BUG>try (final FileChannel channel = new FileOutputStream(encodingFilename).getChannel())... | try (FileChannel channel = new FileOutputStream(encodingFilename).getChannel())
|
22,673 | encodingLength += MESSAGE_HEADER_ENCODER.encodedLength();
encodingLength += encode(CAR_ENCODER, directBuffer, bufferOffset);
final String encodingFilename = System.getProperty(ENCODING_FILENAME);
if (encodingFilename != null)
{
<BUG>try (final FileChannel channel = new FileOutputStream(encodingFilename).getChannel())
{... | try (FileChannel channel = new FileOutputStream(encodingFilename).getChannel())
|
22,674 | final File inputFile = new File(fileName);
final String inputFilename = inputFile.getName();
final int nameEnd = inputFilename.lastIndexOf('.');
final String namePart = inputFilename.substring(0, nameEnd);
final File fullPath = new File(outputDirName, namePart + ".sbeir");
<BUG>try (final IrEncoder irEncoder = new IrEn... | try (IrEncoder irEncoder = new IrEncoder(fullPath.getAbsolutePath(), ir))
{
|
22,675 | .builder()
.xsdFilename(System.getProperty(VALIDATION_XSD))
.stopOnError(Boolean.parseBoolean(System.getProperty(VALIDATION_STOP_ON_ERROR)))
.warningsFatal(Boolean.parseBoolean(System.getProperty(VALIDATION_WARNINGS_FATAL)))
.suppressOutput(Boolean.parseBoolean(System.getProperty(VALIDATION_SUPPRESS_OUTPUT)));
<BUG>try... | try (BufferedInputStream in = new BufferedInputStream(new FileInputStream(sbeSchemaFilename)))
{
|
22,676 | } else {
updateMemo();
callback.updateMemo();
}
dismiss();
<BUG>}else{
</BUG>
Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show();
}
}
| [DELETED] |
22,677 | }
@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);
|
22,678 | 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);
|
22,679 | 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(
|
22,680 | 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 {
|
22,681 | 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;
|
22,682 | 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) {
|
22,683 | 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;
|
22,684 | package jetbrains.mps.refactoring.framework;
<BUG>import com.intellij.openapi.actionSystem.AnActionEvent;
import jetbrains.mps.project.IModule;</BUG>
import jetbrains.mps.project.MPSProject;
import jetbrains.mps.refactoring.framework.IRefactoringTarget.TargetType;
import jetbrains.mps.refactoring.framework.RefactoringU... | import com.intellij.openapi.actionSystem.DataKey;
import jetbrains.mps.project.IModule;
|
22,685 | });
boolean isOneTarget = !myRefactoring.getRefactoringTarget().allowMultipleTargets();
final RefactoringContext context = new RefactoringContext(myRefactoring);
context.setCurrentOperationContext(e.getData(MPSDataKeys.OPERATION_CONTEXT));
context.setSelectedNode(e.getData(MPSDataKeys.NODE));
<BUG>context.setSelectedNo... | context.setSelectedNodes(getNodes(e, isOneTarget));
context.setSelectedModels(getModels(e, isOneTarget));
context.setSelectedModules(getModules(e, isOneTarget));
context.setSelectedProject(e.getData(MPSDataKeys.PROJECT));
|
22,686 | package com.liato.bankdroid.utils;
<BUG>import android.support.annotation.Nullable;
import java.lang.reflect.InvocationTargetException;</BUG>
import java.util.Arrays;
import timber.log.Timber;
public class ExceptionUtils {
| import android.support.annotation.NonNull;
import android.support.annotation.VisibleForTesting;
import java.lang.reflect.InvocationTargetException;
|
22,687 | } catch (IllegalAccessException e) {
newClass = newClass.getSuperclass();
}
}
return null;
<BUG>}
private static StackTraceElement[] bankdroidifyStacktrace(final StackTraceElement[] rawStack) {
for (int i = 0; i < rawStack.length; i++) {</BUG>
StackTraceElement stackTraceElement = rawStack[i];
if (stackTraceElement.get... | @VisibleForTesting
@NonNull
for (int i = 0; i < rawStack.length; i++) {
|
22,688 | public String open(String url, List<NameValuePair> postData)
throws ClientProtocolException, IOException {
try {
return open(url, postData, false);
} catch (IOException e) {
<BUG>throw ExceptionUtils.bankdroidifyException(e);
}</BUG>
}
public String open(String url, List<NameValuePair> postData, boolean forcePost)
thro... | ExceptionUtils.blameBankdroid(e);
throw e;
|
22,689 | HttpEntity entity = (postData == null || postData.isEmpty()) && !forcePost ? null
: new UrlEncodedFormEntity(postData, this.charset);
try {
return openAsHttpResponse(url, entity, forcePost);
} catch (IOException e) {
<BUG>throw ExceptionUtils.bankdroidifyException(e);
}</BUG>
}
public HttpResponse openAsHttpResponse(St... | ExceptionUtils.blameBankdroid(e);
throw e;
|
22,690 | return openAsHttpResponse(url, entity, HttpMethod.GET);
} else {
return openAsHttpResponse(url, entity, HttpMethod.POST);
}
} catch (IOException e) {
<BUG>throw ExceptionUtils.bankdroidifyException(e);
}</BUG>
}
public HttpResponse openAsHttpResponse(String url, HttpMethod method)
throws ClientProtocolException, IOExce... | ExceptionUtils.blameBankdroid(e);
throw e;
|
22,691 | }
@RootTask
static Task<Exec.Result> exec(String parameter, int number) {
Task<String> task1 = MyTask.create(parameter);
Task<Integer> task2 = Adder.create(number, number + 2);
<BUG>return Task.ofType(Exec.Result.class).named("exec", "/bin/sh")
.in(() -> task1)</BUG>
.in(() -> task2)
.process(Exec.exec((str, i) -> args... | return Task.named("exec", "/bin/sh").ofType(Exec.Result.class)
.in(() -> task1)
|
22,692 | return args;
}
static class MyTask {
static final int PLUS = 10;
static Task<String> create(String parameter) {
<BUG>return Task.ofType(String.class).named("MyTask", parameter)
.in(() -> Adder.create(parameter.length(), PLUS))</BUG>
.in(() -> Fib.create(parameter.length()))
.process((sum, fib) -> something(parameter, s... | return Task.named("MyTask", parameter).ofType(String.class)
.in(() -> Adder.create(parameter.length(), PLUS))
|
22,693 | final String instanceField = "from instance";
final TaskContext context = TaskContext.inmem();
final AwaitingConsumer<String> val = new AwaitingConsumer<>();
@Test
public void shouldJavaUtilSerialize() throws Exception {
<BUG>Task<Long> task1 = Task.ofType(Long.class).named("Foo", "Bar", 39)
.process(() -> 9999L);
Task... | Task<Long> task1 = Task.named("Foo", "Bar", 39).ofType(Long.class)
Task<String> task2 = Task.named("Baz", 40).ofType(String.class)
.in(() -> task1)
|
22,694 | assertEquals(des.id().name(), "Baz");
assertEquals(val.awaitAndGet(), "[9999] hello 10004");
}
@Test(expected = NotSerializableException.class)
public void shouldNotSerializeWithInstanceFieldReference() throws Exception {
<BUG>Task<String> task = Task.ofType(String.class).named("WithRef")
.process(() -> instanceField +... | Task<String> task = Task.named("WithRef").ofType(String.class)
.process(() -> instanceField + " causes an outer reference");
|
22,695 | serialize(task);
}
@Test
public void shouldSerializeWithLocalReference() throws Exception {
String local = instanceField;
<BUG>Task<String> task = Task.ofType(String.class).named("WithLocalRef")
.process(() -> local + " won't cause an outer reference");</BUG>
serialize(task);
Task<String> des = deserialize();
context.e... | Task<String> task = Task.named("WithLocalRef").ofType(String.class)
.process(() -> local + " won't cause an outer reference");
|
22,696 | }
@RootTask
public static Task<String> standardArgs(int first, String second) {
firstInt = first;
secondString = second;
<BUG>return Task.ofType(String.class).named("StandardArgs", first, second)
.process(() -> second + " " + first * 100);</BUG>
}
@Test
public void shouldParseFlags() throws Exception {
| return Task.named("StandardArgs", first, second).ofType(String.class)
.process(() -> second + " " + first * 100);
|
22,697 | assertThat(parsedEnum, is(CustomEnum.BAR));
}
@RootTask
public static Task<String> enums(CustomEnum enm) {
parsedEnum = enm;
<BUG>return Task.ofType(String.class).named("Enums", enm)
.process(enm::toString);</BUG>
}
@Test
public void shouldParseCustomTypes() throws Exception {
| return Task.named("Enums", enm).ofType(String.class)
.process(enm::toString);
|
22,698 | assertThat(parsedType.content, is("blarg parsed for you!"));
}
@RootTask
public static Task<String> customType(CustomType myType) {
parsedType = myType;
<BUG>return Task.ofType(String.class).named("Types", myType.content)
.process(() -> myType.content);</BUG>
}
public enum CustomEnum {
BAR
| return Task.named("Types", myType.content).ofType(String.class)
.process(() -> myType.content);
|
22,699 | TaskContext taskContext = TaskContext.inmem();
TaskContext.Value<Long> value = taskContext.evaluate(fib92);
value.consume(f92 -> System.out.println("fib(92) = " + f92));
}
static Task<Long> create(long n) {
<BUG>TaskBuilder<Long> fib = Task.ofType(Long.class).named("Fib", n);
</BUG>
if (n < 2) {
return fib
.process(() ... | TaskBuilder<Long> fib = Task.named("Fib", n).ofType(Long.class);
|
22,700 | SLinkOperations.getTarget(thisNode, "superclass", true) :
new _Quotations.QuotationClass_28().createNode()
);
}
public static List<SNode> virtual_getOwnMethods_1906502351318572840(SNode thisNode) {
<BUG>List<SNode> baseMethodDeclarations = SLinkOperations.getTargets(thisNode, "method", true);
ListSequence.fromList(base... | List<SNode> baseMethodDeclarations = new ArrayList<SNode>();
ListSequence.fromList(baseMethodDeclarations).addSequence(ListSequence.fromList(SLinkOperations.getTargets(thisNode, "method", true)));
ListSequence.fromList(baseMethodDeclarations).addSequence(ListSequence.fromList(SLinkOperations.getTargets(thisNode, "stati... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.