id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
36,201 | 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(),
|
36,202 | .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())
|
36,203 | .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())
|
36,204 | }
@Override
public void lazyRegisterMBean(Object object, String name) {
lazyPlatformMBeanServer.lazyRegisterMBean(object, name);
}
<BUG>}
}
</BUG>
| void initEmbeddedServer() throws Exception {
if (simpleRepoModule == null) {
return;
|
36,205 | 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] |
36,206 | 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) {
|
36,207 | 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);
|
36,208 | 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();
|
36,209 | 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");
|
36,210 | 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;
|
36,211 | </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 ... |
36,212 | } else {
updateMemo();
callback.updateMemo();
}
dismiss();
<BUG>}else{
</BUG>
Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show();
}
}
| [DELETED] |
36,213 | }
@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);
|
36,214 | 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);
|
36,215 | 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(
|
36,216 | 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 {
|
36,217 | 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;
|
36,218 | 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) {
|
36,219 | 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;
|
36,220 | <BUG>package org.apache.hadoop.metrics2.sink.timeline.cache;
import org.apache.commons.logging.Log;</BUG>
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;
| import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import org.apache.commons.logging.Log;
|
36,221 | import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;
import org.apache.hadoop.metrics2.sink.timeline.TimelineMetric;
import org.apache.hadoop.metrics2.sink.timeline.TimelineMetrics;
<BUG>import java.util.Arra... | import java.util.Collection;
|
36,222 | import org.junit.Test;
import java.util.Map;
import java.util.TreeMap;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
<BUG>import static org.junit.Assert.assertNotNull;
public class TimelineMetricsCacheTest {</BUG>
private static final long DEFAULT_START_TIME = 1411023766;
priv... | import static org.junit.Assert.assertTrue;
public class TimelineMetricsCacheTest {
|
36,223 | assertEquals(20, cachedMetric.getMetricValues().get(6L), delta);
assertEquals(110, cachedMetric.getMetricValues().get(7L), delta);
assertEquals(70, cachedMetric.getMetricValues().get(8L), delta);
}
@Test
<BUG>public void testMaxRecsPerName() throws Exception {
int maxRecsPerName = 2;
</BUG>
int maxEvictionTime = Timel... | public void testMaxRecsPerNameForTimelineMetricWrapperCache() throws Exception {
int maxRecsPerName = 3;
|
36,224 | TimelineMetric timelineMetric2 = metricsIterator.next().getMetrics().get(0);
Assert.assertEquals(2, timelineMetric2.getMetricValues().size());
timestamps = timelineMetric2.getMetricValues().keySet().iterator();
Assert.assertEquals(new Long(now + 200l), timestamps.next());
Assert.assertEquals(new Long(now + 300l), times... | Assert.assertEquals(new Double(4.0), values.next());
|
36,225 | 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.*;
|
36,226 | .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);
|
36,227 | </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... |
36,228 | 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)
|
36,229 | .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))
|
36,230 | .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))
|
36,231 | @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;
|
36,232 | 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;
}
|
36,233 | return configDirectory;
}
public boolean isLoaded() {
return loaded;
}
<BUG>public static Cause getCause() {
return instance().pluginCause;
}</BUG>
public EconomyService getEconomyService() {
return economyService;
| [DELETED] |
36,234 | 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.*;
|
36,235 | .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))
|
36,236 | 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) -> {
|
36,237 | 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... |
36,238 | 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);
|
36,239 | 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() + "\"");
|
36,240 | 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() + "\"");
|
36,241 | 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
|
36,242 | .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")
|
36,243 | package org.oliot.epcis.security;
import java.util.List;
<BUG>import com.mongodb.DBObject;
import com.restfb.DefaultFacebookClient;</BUG>
import com.restfb.FacebookClient;
import com.restfb.Version;
import com.restfb.exception.FacebookOAuthException;
| import org.bson.BsonDocument;
import com.restfb.DefaultFacebookClient;
|
36,244 | import javax.servlet.ServletContextListener;
import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.json.JSONObject;
<BUG>import org.oliot.epcis.service.query.mongodb.MongoSubscription;
public class Configuration implements ServletContextListener {</BUG>
pub... | import com.mongodb.MongoClient;
import com.mongodb.client.MongoDatabase;
public class Configuration implements ServletContextListener {
|
36,245 | public static String wsdlPath;
public static boolean isCaptureVerfificationOn;
public static boolean isServiceRegistryReportOn;
public static String onsAddress;
public static boolean isQueryAccessControlOn;
<BUG>public static String facebookAppID;
@Override</BUG>
public void contextDestroyed(ServletContextEvent arg0) {... | public static MongoClient mongoClient;
public static MongoDatabase mongoDatabase;
|
36,246 | 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;
|
36,247 | 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;
|
36,248 | 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,
|
36,249 | 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();
|
36,250 | 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;
|
36,251 | 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);
|
36,252 | 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,
|
36,253 | 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;
|
36,254 | 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;
|
36,255 | 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;
|
36,256 | 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;
|
36,257 | 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(),
|
36,258 | .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())
|
36,259 | .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())
|
36,260 | }
@Override
public void lazyRegisterMBean(Object object, String name) {
lazyPlatformMBeanServer.lazyRegisterMBean(object, name);
}
<BUG>}
}
</BUG>
| void initEmbeddedServer() throws Exception {
if (simpleRepoModule == null) {
return;
|
36,261 | 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] |
36,262 | 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) {
|
36,263 | 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);
|
36,264 | 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();
|
36,265 | 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");
|
36,266 | 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;
|
36,267 | </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 ... |
36,268 | } else {
updateMemo();
callback.updateMemo();
}
dismiss();
<BUG>}else{
</BUG>
Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show();
}
}
| [DELETED] |
36,269 | }
@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);
|
36,270 | 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);
|
36,271 | 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(
|
36,272 | 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 {
|
36,273 | 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;
|
36,274 | 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) {
|
36,275 | 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;
|
36,276 | public class DropDownChoiceBehavior extends JQueryUIBehavior implements IJQueryAjaxAware
{
private static final long serialVersionUID = 1L;
public static final String METHOD = "selectmenu";
private final ISelectionChangedListener listener;
<BUG>private JQueryAjaxBehavior onChangeAjaxBehavior;
</BUG>
public DropDownChoi... | private JQueryAjaxBehavior onChangeAjaxBehavior = null;
|
36,277 | this.listener = Args.notNull(listener, "listener");
}
@Override
public void bind(Component component)
{
<BUG>super.bind(component);
this.onChangeAjaxBehavior = new OnChangeAjaxBehavior(this);
component.add(this.onChangeAjaxBehavior);
}</BUG>
@Override
| if (this.listener.isSelectionChangedEventEnabled())
|
36,278 | component.add(this.onChangeAjaxBehavior);
}</BUG>
@Override
public void onConfigure(Component component)
{
<BUG>super.onConfigure(component);
this.setOption("change", this.onChangeAjaxBehavior.getCallbackFunction());
}</BUG>
@Override
public void onAjax(AjaxRequestTarget target, JQueryEvent event)
| }
}
if (this.onChangeAjaxBehavior != null)
}
}
|
36,279 | protected void onError(AjaxRequestTarget target, Form<?> form)
{
target.add(AjaxSpinnerPage.this.feedback);
}
@Override
<BUG>protected void onSubmit(AjaxRequestTarget target, Form<?> unused)
</BUG>
{
AjaxSpinnerPage.this.info(this, form);
target.add(form);
| protected void onSubmit(AjaxRequestTarget target, Form<?> form)
|
36,280 | AjaxSpinnerPage.this.info(this, form);
target.add(form);
}
});
}
<BUG>private void info(Component component, Form<Integer> form)
</BUG>
{
this.info(component.getMarkupId() + " has been clicked");
this.info("The model object is: " + form.getModelObject());
| private void info(Component component, Form<?> form)
|
36,281 | super(source);
}
@Override
protected CallbackParameter[] getCallbackParameters()
{
<BUG>return new CallbackParameter[] { CallbackParameter.context("e"), CallbackParameter.resolved("data", "kendo.stringify(e.data)") };
}</BUG>
@Override
public CharSequence getCallbackFunctionBody(CallbackParameter... parameters)
{
| return new CallbackParameter[] { // lf
CallbackParameter.context("e"), // lf
CallbackParameter.resolved("data", "kendo.stringify(e.data)"), // lf
CallbackParameter.resolved("timezoneOffset", "new Date().getTimezoneOffset()") };
|
36,282 | return KendoUIBehavior.widget(JQueryWidget.getSelector(component), method);
}
@Override
public void destroy(IPartialPageRequestHandler handler)
{
<BUG>if (this.datasources != null)
{
for (IKendoDataSource datasource : this.datasources)
{
datasource.destroy(handler);
}
}</BUG>
handler.prependJavaScript(String.format("va... | [DELETED] |
36,283 | if (windowSize < 1 && windowSize + increment > 0) {
releaseBackLog(increment);
}
super.incrementWindowSize(increment);
}
<BUG>}
private void releaseBackLog(int increment) {
</BUG>
if (backLogSize < increment) {
for (AbstractStream stream : backLogStreams.keySet()) {
| private synchronized void releaseBackLog(int increment) {
|
36,284 | class StreamOutputBuffer implements OutputBuffer {
private final ByteBuffer buffer = ByteBuffer.allocate(8 * 1024);
private volatile long written = 0;
private volatile boolean closed = false;
@Override
<BUG>public int doWrite(ByteChunk chunk) throws IOException {
</BUG>
if (closed) {
throw new IllegalStateException();
... | public synchronized int doWrite(ByteChunk chunk) throws IOException {
|
36,285 | import com.github.jknack.handlebars.Handlebars;
import com.google.common.base.Optional;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
import com.google.inject.Binder;
<BUG>import com.google.inject.Provides;
import com.google.inject.Singleton;</BUG>
import com.google.inject.name.Named;
i... | import com.google.inject.Scopes;
import com.google.inject.Singleton;
|
36,286 | import com.hubspot.baragon.agent.managed.BootstrapManaged;
import com.hubspot.baragon.agent.managed.LifecycleHelper;
import com.hubspot.baragon.agent.managers.AgentRequestManager;
import com.hubspot.baragon.agent.models.FilePathFormatType;
import com.hubspot.baragon.agent.models.LbConfigTemplate;
<BUG>import com.hubspo... | import com.hubspot.baragon.agent.resources.BargonAgentResourcesModule;
|
36,287 | .setObjectMapper(objectMapper);
return new ApacheHttpClient(configBuilder.build());
}
@Singleton
@Provides
<BUG>public CuratorFramework provideCurator(ZooKeeperConfiguration config, BaragonConnectionStateListener connectionStateListener, ResyncListener resyncListener) {
CuratorFramework client = CuratorFrameworkFactory... | public CuratorFramework provideCurator(ZooKeeperConfiguration config, BaragonConnectionStateListener connectionStateListener) {
CuratorFramework client = CuratorFrameworkFactory.newClient(
|
36,288 | config.getQuorum(),
config.getSessionTimeoutMillis(),
config.getConnectTimeoutMillis(),
new ExponentialBackoffRetry(config.getRetryBaseSleepTimeMilliseconds(), config.getRetryMaxTries()));
client.getConnectionStateListenable().addListener(connectionStateListener);
<BUG>client.getConnectionStateListenable().addListener(... | [DELETED] |
36,289 | import com.hubspot.baragon.data.BaragonLoadBalancerDatastore;
import com.hubspot.baragon.models.BaragonAgentMetadata;
import com.hubspot.baragon.models.BaragonAgentState;
import com.hubspot.baragon.models.BaragonKnownAgentMetadata;
import io.dropwizard.lifecycle.Managed;
<BUG>import org.apache.curator.framework.recipes... | [DELETED] |
36,290 | private final LeaderLatch leaderLatch;
private final BaragonKnownAgentsDatastore knownAgentsDatastore;
private final BaragonAgentMetadata baragonAgentMetadata;
private final ScheduledExecutorService executorService;
private final AgentHeartbeatWorker agentHeartbeatWorker;
<BUG>private final LifecycleHelper lifecycleHel... | private final CuratorFramework curatorFramework;
private final ResyncListener resyncListener;
private final ConfigChecker configChecker;
|
36,291 | public BootstrapManaged(BaragonKnownAgentsDatastore knownAgentsDatastore,
BaragonLoadBalancerDatastore loadBalancerDatastore,
BaragonAgentConfiguration configuration,
AgentHeartbeatWorker agentHeartbeatWorker,
BaragonAgentMetadata baragonAgentMetadata,
<BUG>LifecycleHelper lifecycleHelper,
ConfigChecker configChecker,<... | CuratorFramework curatorFramework,
ResyncListener resyncListener,
ConfigChecker configChecker,
|
36,292 | LOG.info("Adding to known-agents...");
knownAgentsDatastore.addKnownAgent(configuration.getLoadBalancerConfiguration().getName(), BaragonKnownAgentMetadata.fromAgentMetadata(baragonAgentMetadata, System.currentTimeMillis()));
LOG.info("Starting agent heartbeat...");
requestWorkerFuture = executorService.scheduleAtFixed... | LOG.info("Adding resync listener");
curatorFramework.getConnectionStateListenable().addListener(resyncListener);
lifecycleHelper.writeStateFileIfConfigured();
|
36,293 | import com.hubspot.baragon.data.BaragonLoadBalancerDatastore;
import com.hubspot.baragon.data.BaragonRequestDatastore;
import com.hubspot.baragon.data.BaragonResponseHistoryDatastore;
import com.hubspot.baragon.data.BaragonStateDatastore;
import com.hubspot.baragon.data.BaragonWorkerDatastore;
<BUG>import com.hubspot.b... | import com.hubspot.baragon.managers.BaragonAuthManager;
import com.hubspot.baragon.migrations.UpstreamsMigration;
|
36,294 | package org.qcri.rheem.core.function;
import org.qcri.rheem.core.optimizer.ProbabilisticDoubleInterval;
<BUG>import org.qcri.rheem.core.optimizer.costs.LoadEstimator;
</BUG>
import org.qcri.rheem.core.types.BasicDataUnitType;
import org.qcri.rheem.core.types.DataUnitType;
import java.util.Optional;
| import org.qcri.rheem.core.optimizer.costs.LoadProfileEstimator;
|
36,295 | private final SerializableFunction<Input, Iterable<Output>> javaImplementation;
private ProbabilisticDoubleInterval selectivity;
public FlatMapDescriptor(SerializableFunction<Input, Iterable<Output>> javaImplementation,
Class<Input> inputTypeClass,
Class<Output> outputTypeClass) {
<BUG>this(javaImplementation, inputTyp... | this(javaImplementation, inputTypeClass, outputTypeClass, (ProbabilisticDoubleInterval) null);
|
36,296 | }</BUG>
public FlatMapDescriptor(SerializableFunction<Input, Iterable<Output>> javaImplementation,
Class<Input> inputTypeClass,
Class<Output> outputTypeClass,
<BUG>LoadEstimator cpuLoadEstimator,
LoadEstimator ramLoadEstimator) {
this(javaImplementation,
inputTypeClass,
outputTypeClass,
null,
cpuLoadEstimator,
ramLoad... | ProbabilisticDoubleInterval selectivity) {
this(javaImplementation, inputTypeClass, outputTypeClass, selectivity, null);
|
36,297 | package org.qcri.rheem.basic.operators;
import org.qcri.rheem.core.function.TransformationDescriptor;
<BUG>import org.qcri.rheem.core.optimizer.costs.DefaultLoadEstimator;
import org.qcri.rheem.core.plan.rheemplan.UnarySink;</BUG>
import org.qcri.rheem.core.types.DataSetType;
import java.util.Objects;
public class Text... | import org.qcri.rheem.core.optimizer.costs.NestableLoadProfileEstimator;
import org.qcri.rheem.core.plan.rheemplan.UnarySink;
|
36,298 | this(
textFileUrl,
new TransformationDescriptor<>(
Objects::toString,
typeClass,
<BUG>String.class,
new DefaultLoadEstimator(1, 1, .99d, (in, out) -> 10 * in[0]),
new DefaultLoadEstimator(1, 1, .99d, (in, out) -> 1000)
)</BUG>
);
| new NestableLoadProfileEstimator(
|
36,299 | package org.qcri.rheem.core.function;
import org.qcri.rheem.core.optimizer.ProbabilisticDoubleInterval;
<BUG>import org.qcri.rheem.core.optimizer.costs.LoadEstimator;
</BUG>
import org.qcri.rheem.core.types.BasicDataUnitType;
import org.qcri.rheem.core.types.DataUnitType;
import java.util.Optional;
| import org.qcri.rheem.core.optimizer.costs.LoadProfileEstimator;
|
36,300 | private final SerializableFunction<Iterable<Input>, Iterable<Output>> javaImplementation;
private ProbabilisticDoubleInterval selectivity;
public MapPartitionsDescriptor(SerializableFunction<Iterable<Input>, Iterable<Output>> javaImplementation,
Class<Input> inputTypeClass,
Class<Output> outputTypeClass) {
<BUG>this(ja... | this(javaImplementation, inputTypeClass, outputTypeClass, (ProbabilisticDoubleInterval) null);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.