id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
39,701 | .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]);
</BUG>
boolean isWorldRegion = false;
if (region == null) {
| String regionName = parse.args[1];
IRegion region = FGManager.getInstance().getRegion(regionName).orElse(null);
|
39,702 | </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 exists with the name \"" + regionName + "\"!"));
if (region instanceof IGlobal) {
|
39,703 | 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[1]);
if (handler == null)
throw new ArgumentParseException(Text.of("No handler exists with that name!"), parse.args[1], 1);
if (handler instanceof GlobalHandler)</BUG>
throw new CommandException(Text.of("You may not delete the global handler!"));
| Optional<IHandler> handlerOpt = FGManager.getInstance().gethandler(parse.args[1]);
if (!handlerOpt.isPresent())
IHandler handler = handlerOpt.get();
if (handler instanceof GlobalHandler)
|
39,704 | .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 + args)
.collect(GuavaCollectors.toImmutableList());
else if (parse.current.index == 1) {
| return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
39,705 | .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 + args)
.collect(GuavaCollectors.toImmutableList());
else if (parse.current.index == 1) {
| return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
39,706 | @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 static FoxGuardMain instanceField;</BUG>
@Inject
private Logger logger;
| private static FoxGuardMain instanceField;
|
39,707 | 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;
}
|
39,708 | return configDirectory;
}
public boolean isLoaded() {
return loaded;
}
<BUG>public static Cause getCause() {
return instance().pluginCause;
}</BUG>
public EconomyService getEconomyService() {
return economyService;
| [DELETED] |
39,709 | 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 CommandHere extends FCCommandBase {
private static final String[] PRIORITY_ALIASES = {"priority", "prio", "p"};
private static final FlagMapper MAPPER = map -> key -> value -> {
| import java.util.stream.Stream;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
|
39,710 | .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 + args)
.collect(GuavaCollectors.toImmutableList());
else if (parse.current.index > 0) {
| return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
39,711 | 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 = new CacheMap<>((k, m) -> {</BUG>
if (k instanceof IFGObject) {
m.put((IFGObject) k, true);
return true;
| 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) -> {
|
39,712 | 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 {
fgObject.save(singleDir);
| 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(name.toLowerCase());
logger.info((shouldSave ? "S" : "Force s") + "aving handler " + logName + " in directory: " + singleDir);
|
39,713 | 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 {
fgObject.save(singleDir);
| Path singleDir = serverDir.resolve(name.toLowerCase());
logger.info((shouldSave ? "S" : "Force s") + "aving world region " + logName + " in directory: " + singleDir);
|
39,714 | 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(entry -> {
<BUG>IRegion region = FGManager.getInstance().getRegion(entry.getKey());
if (region != null) {
logger.info("Loading links for region \"" + region.getName() + "\"");</BUG>
String handlersString = entry.getValue();
| Optional<IRegion> regionOpt = FGManager.getInstance().getRegion(entry.getKey());
if (regionOpt.isPresent()) {
IRegion region = regionOpt.get();
logger.info("Loading links for region \"" + region.getName() + "\"");
|
39,715 | 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("links", Serializer.STRING, Serializer.STRING).createOrOpen();
linksMap.entrySet().forEach(entry -> {
<BUG>IRegion region = FGManager.getInstance().getWorldRegion(world, entry.getKey());
if (region != null) {
logger.info("Loading links for world region \"" + region.getName() + "\"");</BUG>
String handlersString = entry.getValue();
| 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() + "\"");
|
39,716 | 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
|
39,717 | .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))
.collect(GuavaCollectors.toImmutableList());
else if (parse.current.index == 1) {
| return Stream.of("region", "worldregion", "handler", "controller")
|
39,718 | import eu.optique.r2rml.api.model.RefObjectMap;
import eu.optique.r2rml.api.model.SQLBaseTableOrView;
import eu.optique.r2rml.api.model.SubjectMap;
import eu.optique.r2rml.api.model.Template;
import eu.optique.r2rml.api.model.TriplesMap;
<BUG>import eu.optique.r2rml.api.model.TermMap;
import org.apache.commons.rdf.api.RDF;</BUG>
import org.apache.commons.rdf.api.RDFTerm;
public class MappingFactoryImpl implements MappingFactory {
private RDF rdf;
| import org.apache.commons.rdf.api.IRI;
import org.apache.commons.rdf.api.RDF;
|
39,719 | @Override
public TriplesMap createTriplesMap(LogicalTable lt, SubjectMap sm, String triplesMapIdentifier) {
return new TriplesMapImpl(rdf, lt, sm, triplesMapIdentifier);
}
@Override
<BUG>public TriplesMap createTriplesMap(LogicalTable lt, SubjectMap sm,
PredicateObjectMap pom) {</BUG>
TriplesMap tm = new TriplesMapImpl(rdf, lt, sm);
tm.addPredicateObjectMap(pom);
| public TriplesMap createTriplesMap(LogicalTable lt, SubjectMap sm) {
return new TriplesMapImpl(rdf, lt, sm);
public TriplesMap createTriplesMap(LogicalTable lt, SubjectMap sm, PredicateObjectMap pom) {
|
39,720 | TriplesMap tm = new TriplesMapImpl(rdf, lt, sm, triplesMapIdentifier);
tm.addPredicateObjectMap(pom);
return tm;
}
@Override
<BUG>public TriplesMap createTriplesMap(LogicalTable lt, SubjectMap sm,
List<PredicateObjectMap> listOfPom) {</BUG>
TriplesMap tm = new TriplesMapImpl(rdf, lt, sm);
for (PredicateObjectMap pom : listOfPom) {
| public TriplesMap createTriplesMap(LogicalTable lt, SubjectMap sm, List<PredicateObjectMap> listOfPom) {
|
39,721 | tm.addPredicateObjectMap(pom);
}
return tm;
}
@Override
<BUG>public PredicateObjectMap createPredicateObjectMap(PredicateMap pm,
ObjectMap om) {</BUG>
return new PredicateObjectMapImpl(rdf, pm, om);
}
| [DELETED] |
39,722 |
ObjectMap om) {</BUG>
return new PredicateObjectMapImpl(rdf, pm, om);
}
@Override
<BUG>public PredicateObjectMap createPredicateObjectMap(PredicateMap pm,
RefObjectMap rom) {</BUG>
return new PredicateObjectMapImpl(rdf, pm, rom);
}
| tm.addPredicateObjectMap(pom);
return tm;
public TriplesMap createTriplesMap(LogicalTable lt, SubjectMap sm, PredicateObjectMap pom, String triplesMapIdentifier) {
TriplesMap tm = new TriplesMapImpl(rdf, lt, sm, triplesMapIdentifier);
tm.addPredicateObjectMap(pom);
return tm;
|
39,723 |
RefObjectMap rom) {</BUG>
return new PredicateObjectMapImpl(rdf, pm, rom);
}
@Override
<BUG>public PredicateObjectMap createPredicateObjectMap(List<PredicateMap> pms,
List<ObjectMap> oms, List<RefObjectMap> roms) {</BUG>
return new PredicateObjectMapImpl(rdf, pms, oms, roms);
}
| tm.addPredicateObjectMap(pom);
return tm;
public TriplesMap createTriplesMap(LogicalTable lt, SubjectMap sm, PredicateObjectMap pom, String triplesMapIdentifier) {
TriplesMap tm = new TriplesMapImpl(rdf, lt, sm, triplesMapIdentifier);
tm.addPredicateObjectMap(pom);
return tm;
|
39,724 | String columnOrConst) {
super(c, termMapType, columnOrConst);</BUG>
classList = new ArrayList<>();
graphList = new ArrayList<>();
<BUG>}
public SubjectMapImpl(RDF c, TermMap.TermMapType termMapType,
RDFTerm columnOrConst) {
super(c, termMapType, columnOrConst);</BUG>
classList = new ArrayList<>();
graphList = new ArrayList<>();
| import org.apache.commons.rdf.api.Triple;
public class SubjectMapImpl extends TermMapImpl implements SubjectMap {
private List<IRI> validTermTypes = Arrays.asList(
getRDF().createIRI(R2RMLVocabulary.TERM_IRI),
getRDF().createIRI(R2RMLVocabulary.TERM_BLANK_NODE));
private ArrayList<IRI> classList;
private ArrayList<GraphMap> graphList;
SubjectMapImpl(RDF c, Template template) {
super(c, template);
|
39,725 | Collection<RDFTerm> graphDecl = graph.stream(node, getRDF().createIRI(R2RMLVocabulary.PROP_GRAPH), null)
.map(Triple::getObject)
.collect(toSet());
if (graphDecl.size() > 0) {
for (RDFTerm val : graphDecl) {
<BUG>graphMapList.add(mfact.createGraphMap(TermMap.TermMapType.CONSTANT_VALUED, val));
}</BUG>
} else {
Collection<RDFTerm> graphMaps = graph.stream(node, getRDF().createIRI(R2RMLVocabulary.PROP_GRAPH_MAP), null)
.map(Triple::getObject)
| graphMapList.add(mfact.createGraphMap((IRI)val));
}
|
39,726 | private SubjectMap readSubjectMap(BlankNodeOrIRI node)
throws InvalidR2RMLMappingException {
RDFTerm subject = readResource(node,
getRDF().createIRI(R2RMLVocabulary.PROP_SUBJECT));
if (subject != null) {
<BUG>return mfact.createSubjectMap(TermMap.TermMapType.CONSTANT_VALUED, subject);
} else {</BUG>
Collection<RDFTerm> subjectMapNode = graph.stream(node, getRDF().createIRI(R2RMLVocabulary.PROP_SUBJECT_MAP), null)
.map(Triple::getObject)
.collect(toSet());
| return mfact.createSubjectMap(subject);
} else {
|
39,727 | List<PredicateMap> predicateMaps = new ArrayList<PredicateMap>();
Collection<RDFTerm> predicates = readResources(node,
getRDF().createIRI(R2RMLVocabulary.PROP_PREDICATE));
if (predicates != null) {
for (RDFTerm predicate : predicates) {
<BUG>predicateMaps.add(mfact.createPredicateMap(
TermMap.TermMapType.CONSTANT_VALUED, predicate));</BUG>
}
}
| predicateMaps.add(mfact.createPredicateMap((IRI)predicate));
|
39,728 | Collection<RDFTerm> objects = readResources(node,
getRDF().createIRI(R2RMLVocabulary.PROP_OBJECT));
if (objects != null) {
for (RDFTerm object : objects) {
objectMaps.add(mfact.createObjectMap(
<BUG>TermMap.TermMapType.CONSTANT_VALUED, object));
}</BUG>
}
Collection<RDFTerm> objectMapNodes = graph.stream(node, getRDF().createIRI(R2RMLVocabulary.PROP_OBJECT_MAP), null)
.map(Triple::getObject)
| [DELETED] |
39,729 | return mfact.createSubjectMap(mfact.createTemplate(((Literal) resource).getLexicalForm()));
}
} else if (type.equals(getRDF().createIRI(R2RMLVocabulary.PROP_PREDICATE_MAP))) {
switch (termMapType){
case COLUMN_VALUED:
<BUG>return mfact.createPredicateMap(termMapType, ((Literal) resource).getLexicalForm());
case CONSTANT_VALUED:
return mfact.createPredicateMap(termMapType, resource);
</BUG>
case TEMPLATE_VALUED:
| return mfact.createPredicateMap(((Literal) resource).getLexicalForm());
return mfact.createPredicateMap((IRI)resource);
|
39,730 | return mfact.createObjectMap(mfact.createTemplate(((Literal) resource).getLexicalForm()));
}
} else if (type.equals(getRDF().createIRI(R2RMLVocabulary.PROP_GRAPH_MAP))) {
switch (termMapType){
case COLUMN_VALUED:
<BUG>return mfact.createGraphMap(termMapType, ((Literal) resource).getLexicalForm());
case CONSTANT_VALUED:
return mfact.createGraphMap(termMapType, resource);
</BUG>
case TEMPLATE_VALUED:
| return mfact.createGraphMap(((Literal) resource).getLexicalForm());
return mfact.createGraphMap((IRI)resource);
|
39,731 | public void removeLanguageTag() {
langTag = null;
}
@Override
public Set<Triple> serialize() {
<BUG>Set<Triple> stmtSet = new HashSet<Triple>();
stmtSet.addAll(super.serialize());</BUG>
stmtSet.add(getRDF().createTriple(getNode(),
getRDF().createIRI("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),
getRDF().createIRI(R2RMLVocabulary.TYPE_OBJECT_MAP)));
| Set<Triple> stmtSet = new HashSet<>();
stmtSet.addAll(super.serialize());
|
39,732 | result.setName(MavenJDOMUtil.findChildValueByPath(xmlProject, "name"));
readModelBody(result, result.getBuild(), xmlProject);
result.setProfiles(collectProfiles(file, xmlProject, problems, alwaysOnProfiles));
return new RawModelReadResult(result, problems, alwaysOnProfiles);
}
<BUG>private void readModelBody(MavenModelBase mavenModelBase, MavenBuildBase mavenBuildBase, Element xmlModel) {
</BUG>
mavenModelBase.setModules(MavenJDOMUtil.findChildrenValuesByPath(xmlModel, "modules", "module"));
collectProperties(MavenJDOMUtil.findChildByPath(xmlModel, "properties"), mavenModelBase);
Element xmlBuild = MavenJDOMUtil.findChildByPath(xmlModel, "build");
| private static void readModelBody(MavenModelBase mavenModelBase, MavenBuildBase mavenBuildBase, Element xmlModel) {
|
39,733 | 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;
|
39,734 | 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 gaugeValueDao;
private final GaugeNameDao gaugeNameDao;
private final TransactionTypeDao transactionTypeDao;
| private final EnvironmentDao agentDao;
|
39,735 | private final TransactionTypeDao transactionTypeDao;
private final FullQueryTextDao fullQueryTextDao;
private final TraceAttributeNameDao traceAttributeNameDao;
RepoAdminImpl(DataSource dataSource, List<CappedDatabase> rollupCappedDatabases,
CappedDatabase traceCappedDatabase, ConfigRepository configRepository,
<BUG>AgentDao agentDao, GaugeValueDao gaugeValueDao, GaugeNameDao gaugeNameDao,
</BUG>
TransactionTypeDao transactionTypeDao, FullQueryTextDao fullQueryTextDao,
TraceAttributeNameDao traceAttributeNameDao) {
this.dataSource = dataSource;
| EnvironmentDao agentDao, GaugeValueDao gaugeValueDao, GaugeNameDao gaugeNameDao,
|
39,736 | this.fullQueryTextDao = fullQueryTextDao;
this.traceAttributeNameDao = traceAttributeNameDao;
}
@Override
public void deleteAllData() throws Exception {
<BUG>Environment environment = agentDao.readEnvironment("");
dataSource.deleteAll();</BUG>
agentDao.reinitAfterDeletingDatabase();
gaugeValueDao.reinitAfterDeletingDatabase();
gaugeNameDao.invalidateCache();
| Environment environment = agentDao.read("");
dataSource.deleteAll();
|
39,737 | 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 transactionTypeDao;</BUG>
private final AggregateDao aggregateDao;
private final TraceAttributeNameDao traceAttributeNameDao;
private final TraceDao traceDao;
| private final EnvironmentDao environmentDao;
private final TransactionTypeDao transactionTypeDao;
|
39,738 | 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(dataSource);
</BUG>
transactionTypeDao = new TransactionTypeDao(dataSource);
rollupLevelService = new RollupLevelService(configRepository, clock);
FullQueryTextDao fullQueryTextDao = new FullQueryTextDao(dataSource);
| environmentDao = new EnvironmentDao(dataSource);
|
39,739 | traceDao = new TraceDao(dataSource, traceCappedDatabase, transactionTypeDao,
fullQueryTextDao, traceAttributeNameDao);
GaugeNameDao gaugeNameDao = new GaugeNameDao(dataSource);
gaugeValueDao = new GaugeValueDao(dataSource, gaugeNameDao, clock);
repoAdmin = new RepoAdminImpl(dataSource, rollupCappedDatabases, traceCappedDatabase,
<BUG>configRepository, agentDao, gaugeValueDao, gaugeNameDao, transactionTypeDao,
</BUG>
fullQueryTextDao, traceAttributeNameDao);
if (backgroundExecutor == null) {
reaperRunnable = null;
| configRepository, environmentDao, gaugeValueDao, gaugeNameDao, transactionTypeDao,
|
39,740 | 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 getTransactionTypeRepository() {
| public EnvironmentDao getEnvironmentDao() {
return environmentDao;
|
39,741 | 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;
|
39,742 | 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.MonotonicNonNull;</BUG>
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.glowroot.agent.collector.Collector.AgentConfigUpdater;
| import com.google.common.collect.ImmutableList;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
39,743 | 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.common.live.LiveTraceRepository.LiveTraceRepositoryNop;
import org.glowroot.common.repo.ConfigRepository;
import org.glowroot.common.util.Clock;</BUG>
import org.glowroot.common.util.OnlyUsedByTests;
import org.glowroot.ui.CreateUiModuleBuilder;
| import org.glowroot.common.repo.AgentRepository;
import org.glowroot.common.repo.ImmutableAgentRollup;
import org.glowroot.common.util.Clock;
|
39,744 | SimpleRepoModule simpleRepoModule = new SimpleRepoModule(dataSource,
dataDir, clock, ticker, configRepository, backgroundExecutor);
simpleRepoModule.registerMBeans(new PlatformMBeanServerLifecycleImpl(
agentModule.getLazyPlatformMBeanServer()));
CollectorImpl collectorImpl = new CollectorImpl(
<BUG>simpleRepoModule.getAgentDao(), simpleRepoModule.getAggregateDao(),
simpleRepoModule.getTraceDao(),</BUG>
simpleRepoModule.getGaugeValueDao());
collectorProxy.setInstance(collectorImpl);
collectorImpl.init(baseDir, EnvironmentCreator.create(glowrootVersion),
| simpleRepoModule.getEnvironmentDao(),
simpleRepoModule.getTraceDao(),
|
39,745 | .baseDir(baseDir)
.glowrootDir(glowrootDir)
.ticker(ticker)
.clock(clock)
.liveJvmService(agentModule.getLiveJvmService())
<BUG>.configRepository(simpleRepoModule.getConfigRepository())
.agentRepository(simpleRepoModule.getAgentDao())
</BUG>
.transactionTypeRepository(simpleRepoModule.getTransactionTypeRepository())
.traceAttributeNameRepository(
| .agentRepository(new AgentRepositoryImpl())
.environmentRepository(simpleRepoModule.getEnvironmentDao())
|
39,746 | .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())
|
39,747 | }
@Override
public void lazyRegisterMBean(Object object, String name) {
lazyPlatformMBeanServer.lazyRegisterMBean(object, name);
}
<BUG>}
}
</BUG>
| void initEmbeddedServer() throws Exception {
if (simpleRepoModule == null) {
return;
|
39,748 | 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 (GaugeConfig loopConfig : configs) {
if (Versions.getVersion(loopConfig.toProto()).equals(version)) {
throw new IllegalStateException("This exact gauge already exists");
}
}
configs.add(GaugeConfig.create(gaugeConfig));</BUG>
configService.updateGaugeConfigs(configs);
| [DELETED] |
39,749 | 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;
for (ListIterator<GaugeConfig> i = configs.listIterator(); i.hasNext();) {
| GaugeConfig config = GaugeConfig.create(gaugeConfig);
synchronized (writeLock) {
|
39,750 | 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 (loopConfig.mbeanObjectName().equals(gaugeConfig.getMbeanObjectName())) {
throw new DuplicateMBeanObjectNameException();
| i.set(config);
|
39,751 | 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);
PluginDescriptor pluginDescriptor = getPluginDescriptor(pluginId);
i.set(PluginConfig.create(pluginDescriptor, properties));</BUG>
found = true;
break;
| for (ListIterator<GaugeConfig> i = configs.listIterator(); i.hasNext();) {
GaugeConfig loopConfig = i.next();
String loopVersion = Versions.getVersion(loopConfig.toProto());
if (loopVersion.equals(version)) {
i.remove();
|
39,752 | 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));
found = true;
break;
}</BUG>
}
| i.set(config);
} else if (loopConfig.equals(config)) {
throw new IllegalStateException("This exact instrumentation already exists");
|
39,753 | 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.glowroot.agent.embedded.repo.TraceDao;
import org.glowroot.wire.api.model.AgentConfigOuterClass.AgentConfig;
| import org.glowroot.agent.embedded.repo.EnvironmentDao;
import org.glowroot.agent.embedded.repo.GaugeValueDao;
|
39,754 | </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 = aggregateRepository;
this.traceDao = traceRepository;
| 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 {
private final EnvironmentDao agentDao;
CollectorImpl(EnvironmentDao agentDao, AggregateDao aggregateRepository,
TraceDao traceRepository, GaugeValueDao gaugeValueRepository) {
this.agentDao = agentDao;
|
39,755 | }});
}
@Override
protected void onResume() {
super.onResume();
<BUG>Camera.Size size = mCamera.getParameters().getPreviewSize();
visualize.initializeImages( size.width, size.height );</BUG>
}
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int pos, long id ) {
| [DELETED] |
39,756 | paintWideLine.setColor(Color.RED);
paintWideLine.setStrokeWidth(3);
textPaint.setColor(Color.BLUE);
textPaint.setTextSize(60);
}
<BUG>public void initializeImages( int width , int height ) {
graySrc = new ImageFloat32(width,height);</BUG>
grayDst = new ImageFloat32(width,height);
bitmapSrc = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
bitmapDst = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
| if( graySrc != null && graySrc.width == width && graySrc.height == height )
return;
graySrc = new ImageFloat32(width,height);
|
39,757 | public void setMatches( List<AssociatedPair> matches ) {
this.locationSrc.clear();
this.locationDst.clear();
for( int i = 0; i < matches.size(); i++ ) {
AssociatedPair p = matches.get(i);
<BUG>locationSrc.add( p.p1 );
locationDst.add( p.p2 );
</BUG>
}
| locationSrc.add( p.p1.copy() );
locationDst.add( p.p2.copy() );
|
39,758 | hasRight = true;
grayDst.setTo(image);
ConvertBitmap.grayToBitmap(image,bitmapDst,storage);
}
}
<BUG>public synchronized void render(Canvas canvas, double tranX , double tranY , double scale ) {
this.scale = scale;</BUG>
this.tranX = tranX;
this.tranY = tranY;
int startX = bitmapSrc.getWidth()+SEPARATION;
| public void render(Canvas canvas, double tranX , double tranY , double scale ) {
this.scale = scale;
|
39,759 | String libraryName = ((LibraryOrderEntry)entry).getLibraryName();
if (libraryName == null) {
final String[] urls = libraryEntry.getRootUrls(OrderRootType.CLASSES);
if (urls.length > 0) {
VirtualFile file = VirtualFileManager.getInstance().findFileByUrl(urls[0]);
<BUG>file = JarFileSystem.getInstance().getVirtualFileForJar(file);
libraryName = file != null ? file.getName() : null;</BUG>
}
if (libraryName == null) {
| final VirtualFile fileForJar = JarFileSystem.getInstance().getVirtualFileForJar(file);
if (fileForJar != null) {
file = fileForJar;
libraryName = file != null ? file.getName() : null;
|
39,760 | import io.gravitee.gateway.api.Response;
import io.gravitee.gateway.api.handler.Handler;
import io.gravitee.gateway.core.Reactor;
import io.gravitee.gateway.core.definition.Api;
import io.gravitee.gateway.core.event.ApiEvent;
<BUG>import io.gravitee.gateway.core.reactor.handler.ContextHandlerFactory;
import io.gravitee.gateway.core.reactor.handler.ContextReactorHandler;
import io.gravitee.gateway.core.reactor.handler.ReactorHandler;
import io.gravitee.gateway.core.reactor.handler.ResponseTimeHandler;
import io.gravitee.gateway.core.reactor.handler.impl.api.ApiReactorHandler;</BUG>
import io.gravitee.gateway.core.reactor.handler.reporter.ReporterHandler;
| import io.gravitee.gateway.core.reactor.handler.*;
|
39,761 | LOGGER.error("Unable to remove reactor handler", e);
}
});
contextPaths.clear();
}
<BUG>public void setContextHandlerFactory(ContextHandlerFactory contextHandlerFactory) {
this.contextHandlerFactory = contextHandlerFactory;
}</BUG>
@Override
protected void doStart() throws Exception {
| public void setReactorHandlerManager(ReactorHandlerManager reactorHandlerManager) {
this.reactorHandlerManager = reactorHandlerManager;
|
39,762 | package io.gravitee.gateway.core.policy.impl;
import io.gravitee.common.component.AbstractLifecycleComponent;
import io.gravitee.definition.model.Policy;
import io.gravitee.gateway.core.policy.PolicyClassLoaderFactory;
<BUG>import io.gravitee.gateway.core.reactor.handler.ContextReactorHandler;
import io.gravitee.plugin.policy.PolicyDefinition;</BUG>
import io.gravitee.policy.api.PolicyConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
| import io.gravitee.gateway.core.reactor.handler.ReactorHandler;
import io.gravitee.plugin.policy.PolicyDefinition;
|
39,763 | import java.util.Map;
import java.util.Set;
public class DefaultScopedPolicyManager extends AbstractLifecycleComponent<io.gravitee.gateway.core.policy.ScopedPolicyManager>
implements io.gravitee.gateway.core.policy.ScopedPolicyManager {
private final Logger LOGGER = LoggerFactory.getLogger(DefaultScopedPolicyManager.class);
<BUG>@Autowired
private ContextReactorHandler reactorHandler;
</BUG>
@Autowired
private io.gravitee.plugin.policy.PolicyManager policyManager;
| private final ReactorHandler reactorHandler;
|
39,764 | searchClient.stop();
}
}
@Test
public void can_load() {
<BUG>BaseIndex index = getIndex(this.searchClient);
assertThat(index).isNotNull();</BUG>
}
@Test
public void creates_domain_index() {
| BaseIndex index = getIndex(searchClient);
assertThat(index).isNotNull();
|
39,765 | import org.junit.rules.ExternalResource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.sonar.api.database.DatabaseProperties;
import org.sonar.api.resources.Language;
<BUG>import org.sonar.process.NetworkUtils;
import org.sonar.process.ProcessConstants;
import org.sonar.process.Props;
import org.sonar.search.SearchServer;</BUG>
import org.sonar.server.platform.BackendCleanup;
| import org.sonar.server.es.EsServerHolder;
|
39,766 | import org.sonar.process.ProcessConstants;
import org.sonar.process.Props;
import org.sonar.search.SearchServer;</BUG>
import org.sonar.server.platform.BackendCleanup;
import org.sonar.server.platform.Platform;
<BUG>import org.sonar.server.ws.WsTester;
import javax.annotation.Nullable;</BUG>
import java.io.File;
import java.util.Arrays;
import java.util.List;
| import org.sonar.server.es.EsServerHolder;
import org.sonar.test.TestUtils;
import javax.annotation.Nullable;
|
39,767 | for (Map.Entry<Object, Object> entry : System.getProperties().entrySet()) {
String key = entry.getKey().toString();
if (key.startsWith(PROP_PREFIX)) {
properties.put(StringUtils.substringAfter(key, PROP_PREFIX), entry.getValue());
}
<BUG>}
try {
LOG.info("Starting elasticsearch server");
searchServer.start();
searchServer.isReady();
LOG.info("Elasticsearch server started");</BUG>
platform.init(properties);
| platform = new Platform();
|
39,768 | package org.jclouds.glacier;
import static com.google.common.util.concurrent.MoreExecutors.sameThreadExecutor;
import static org.jclouds.Constants.PROPERTY_MAX_RETRIES;
import static org.jclouds.Constants.PROPERTY_SO_TIMEOUT;
<BUG>import static org.jclouds.glacier.util.TestUtils.buildPayload;
import static org.testng.Assert.assertEquals;</BUG>
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertTrue;
| import static com.google.common.base.Charsets.UTF_8;
import static org.jclouds.util.Strings2.urlEncode;
import static org.testng.Assert.assertEquals;
|
39,769 | return size()+offset;
}
public PlaLineInt[] to_array()
{
return a_list.toArray(new PlaLineInt[size()]);
<BUG>}
@Override</BUG>
public Iterator<PlaLineInt> iterator()
{
return a_list.iterator();
| public ArrayList<PlaLineInt>to_alist()
return a_list;
@Override
|
39,770 | while (Math.abs(prev_dist) < c_epsilon)
{
++corners_skipped_before;
int curr_no = p_start_no - corners_skipped_before;
if (curr_no < 0) return null;
<BUG>prev_corner = p_line_arr[curr_no].intersection_approx(p_line_arr[curr_no + 1]);
</BUG>
prev_dist = translate_line.distance_signed(prev_corner);
}
double next_dist = translate_line.distance_signed(next_corner);
| prev_corner = p_line_arr.get(curr_no).intersection_approx(p_line_arr.get(curr_no + 1));
|
39,771 | </BUG>
{
return null;
}
<BUG>next_corner = p_line_arr[curr_no].intersection_approx(p_line_arr[curr_no + 1]);
</BUG>
next_dist = translate_line.distance_signed(next_corner);
}
if (Signum.of(prev_dist) != Signum.of(next_dist))
{
| double next_dist = translate_line.distance_signed(next_corner);
while (Math.abs(next_dist) < c_epsilon)
++corners_skipped_after;
int curr_no = p_start_no + 3 + corners_skipped_after;
if (curr_no >= p_line_arr.size() - 2)
next_corner = p_line_arr.get(curr_no).intersection_approx(p_line_arr.get(curr_no + 1));
|
39,772 | check_ok = r_board.check_trace(shape_to_check, curr_layer, curr_net_no_arr, curr_cl_type, contact_pins);
}
delta_dist /= 2;
if (check_ok)
{
<BUG>result = curr_lines[p_start_no + 2];
</BUG>
if (translate_dist == max_translate_dist) break;
translate_dist += delta_dist;
}
| result = curr_lines.get(p_start_no + 2);
|
39,773 | translate_dist -= shorten_value;
delta_dist -= shorten_value;
}
}
if (result == null) return null;
<BUG>PlaPointFloat new_prev_corner = curr_lines[p_start_no].intersection_approx(curr_lines[p_start_no + 1]);
PlaPointFloat new_next_corner = curr_lines[p_start_no + 3].intersection_approx(curr_lines[p_start_no + 4]);
</BUG>
r_board.changed_area.join(new_prev_corner, curr_layer);
| PlaPointFloat new_prev_corner = curr_lines.get(p_start_no).intersection_approx(curr_lines.get(p_start_no + 1));
PlaPointFloat new_next_corner = curr_lines.get(p_start_no + 3).intersection_approx(curr_lines.get(p_start_no + 4));
|
39,774 | import java.util.LinkedHashMap;
import java.util.List;
import java.util.Properties;
import java.util.TreeMap;
import com.ibm.ets.ita.ce.store.client.web.ServletStateManager;
<BUG>import com.ibm.ets.ita.ce.store.model.CeAnnotation;
import com.ibm.ets.ita.ce.store.model.CeClause;
import com.ibm.ets.ita.ce.store.model.CeConcatenatedValue;</BUG>
import com.ibm.ets.ita.ce.store.model.CeConcept;
import com.ibm.ets.ita.ce.store.model.CeConceptualModel;
| [DELETED] |
39,775 | private final static Log _log = new Log(SAMRawSession.class);
private I2PSession session = null;
private SAMRawReceiver recv = null;
private SAMRawSessionHandler handler = null;
public SAMRawSession(String dest, Properties props,
<BUG>SAMRawReceiver recv) throws DataFormatException, I2PSessionException {
</BUG>
ByteArrayInputStream bais;
bais = new ByteArrayInputStream(Base64.decode(dest));
initSAMRawSession(bais, props, recv);
| SAMRawReceiver recv) throws IOException, DataFormatException, I2PSessionException {
|
39,776 | public void startHandling() {
thread = new I2PThread(this, "SAMHandler");
thread.start();
}
protected abstract void handle();
<BUG>protected void writeBytes(byte[] data) throws IOException {
synchronized (socketWLock) {</BUG>
if (socketOS == null) {
socketOS = socket.getOutputStream();
}
| protected void writeBytes(byte[] data) throws IOException {
synchronized (socketWLock) {
|
39,777 | package com.projecttango.examples.java.augmentedreality;
import com.google.atap.tangoservice.Tango;
import com.google.atap.tangoservice.Tango.OnTangoUpdateListener;
import com.google.atap.tangoservice.TangoCameraIntrinsics;
import com.google.atap.tangoservice.TangoConfig;
<BUG>import com.google.atap.tangoservice.TangoCoordinateFramePair;
import com.google.atap.tangoservice.TangoEvent;</BUG>
import com.google.atap.tangoservice.TangoOutOfDateException;
import com.google.atap.tangoservice.TangoPoseData;
import com.google.atap.tangoservice.TangoXyzIjData;
| import com.google.atap.tangoservice.TangoErrorException;
import com.google.atap.tangoservice.TangoEvent;
|
39,778 | super.onResume();
if (!mIsConnected) {
mTango = new Tango(AugmentedRealityActivity.this, new Runnable() {
@Override
public void run() {
<BUG>try {
connectTango();</BUG>
setupRenderer();
mIsConnected = true;
} catch (TangoOutOfDateException e) {
| TangoSupport.initialize();
connectTango();
|
39,779 | if (lastFramePose.statusCode == TangoPoseData.POSE_VALID) {
mRenderer.updateRenderCameraPose(lastFramePose, mExtrinsics);
mCameraPoseTimestamp = lastFramePose.timestamp;</BUG>
} else {
<BUG>Log.w(TAG, "Can't get device pose at time: " + mRgbTimestampGlThread);
}</BUG>
}
}
}
@Override
| mRenderer.updateRenderCameraPose(lastFramePose);
mCameraPoseTimestamp = lastFramePose.timestamp;
Log.w(TAG, "Can't get device pose at time: " +
|
39,780 | import org.rajawali3d.materials.Material;
import org.rajawali3d.materials.methods.DiffuseMethod;
import org.rajawali3d.materials.textures.ATexture;
import org.rajawali3d.materials.textures.StreamingTexture;
import org.rajawali3d.materials.textures.Texture;
<BUG>import org.rajawali3d.math.Matrix4;
import org.rajawali3d.math.vector.Vector3;</BUG>
import org.rajawali3d.primitives.ScreenQuad;
import org.rajawali3d.primitives.Sphere;
import org.rajawali3d.renderer.RajawaliRenderer;
| import org.rajawali3d.math.Quaternion;
import org.rajawali3d.math.vector.Vector3;
|
39,781 | translationMoon.setRepeatMode(Animation.RepeatMode.INFINITE);
translationMoon.setTransformable3D(moon);
getCurrentScene().registerAnimation(translationMoon);
translationMoon.play();
}
<BUG>public void updateRenderCameraPose(TangoPoseData devicePose, DeviceExtrinsics extrinsics) {
Pose cameraPose = ScenePoseCalculator.toOpenGlCameraPose(devicePose, extrinsics);
getCurrentCamera().setRotation(cameraPose.getOrientation());
getCurrentCamera().setPosition(cameraPose.getPosition());
}</BUG>
public int getTextureId() {
| public void updateRenderCameraPose(TangoPoseData cameraPose) {
float[] rotation = cameraPose.getRotationAsFloats();
float[] translation = cameraPose.getTranslationAsFloats();
Quaternion quaternion = new Quaternion(rotation[3], rotation[0], rotation[1], rotation[2]);
getCurrentCamera().setRotation(quaternion.conjugate());
getCurrentCamera().setPosition(translation[0], translation[1], translation[2]);
|
39,782 | package com.projecttango.examples.java.helloareadescription;
import com.google.atap.tangoservice.Tango;
<BUG>import com.google.atap.tangoservice.Tango.OnTangoUpdateListener;
import com.google.atap.tangoservice.TangoConfig;</BUG>
import com.google.atap.tangoservice.TangoCoordinateFramePair;
import com.google.atap.tangoservice.TangoErrorException;
import com.google.atap.tangoservice.TangoEvent;
| import com.google.atap.tangoservice.TangoAreaDescriptionMetaData;
import com.google.atap.tangoservice.TangoConfig;
|
39,783 | customTokens.put("%%mlFinalForestsPerHost%%", hubConfig.finalForestsPerHost.toString());
customTokens.put("%%mlTraceAppserverName%%", hubConfig.traceHttpName);
customTokens.put("%%mlTracePort%%", hubConfig.tracePort.toString());
customTokens.put("%%mlTraceDbName%%", hubConfig.traceDbName);
customTokens.put("%%mlTraceForestsPerHost%%", hubConfig.traceForestsPerHost.toString());
<BUG>customTokens.put("%%mlModulesDbName%%", hubConfig.modulesDbName);
}</BUG>
public void init() {
try {
LOGGER.error("PLUGINS DIR: " + pluginsDir.toString());
| customTokens.put("%%mlTriggersDbName%%", hubConfig.triggersDbName);
customTokens.put("%%mlSchemasDbName%%", hubConfig.schemasDbName);
}
|
39,784 | OnViewChangedNotifier previousNotifier = OnViewChangedNotifier.replaceNotifier(onViewChangedNotifier_);
init_(savedInstanceState);
super.onCreate(savedInstanceState);
OnViewChangedNotifier.replaceNotifier(previousNotifier);
setContentView(layout.new_request);
<BUG>}
@Override</BUG>
public void setContentView(int layoutResID) {
super.setContentView(layoutResID);
onViewChangedNotifier_.notifyViewChanged(this);
| private void init_(Bundle savedInstanceState) {
OnViewChangedNotifier.registerOnViewChangedListener(this);
injectExtras_();
@Override
|
39,785 | if (((SdkVersionHelper.getSdkInt()< 5)&&(keyCode == KeyEvent.KEYCODE_BACK))&&(event.getRepeatCount() == 0)) {
onBackPressed();
}
return super.onKeyDown(keyCode, event);
}
<BUG>public static EditRequestActivity_.IntentBuilder_ intent(Context context) {
return new EditRequestActivity_.IntentBuilder_(context);
}
public static EditRequestActivity_.IntentBuilder_ intent(Fragment supportFragment) {
return new EditRequestActivity_.IntentBuilder_(supportFragment);
}</BUG>
@Override
| [DELETED] |
39,786 | public void onClick(View view) {
EditRequestActivity_.this.addressChange();
}
}
);
<BUG>}
if (hasViews.findViewById(id.requestSend)!= null) {
hasViews.findViewById(id.requestSend).setOnClickListener(new OnClickListener() {
@Override</BUG>
public void onClick(View view) {
| View view = hasViews.findViewById(id.requestSend);
if (view!= null) {
view.setOnClickListener(new OnClickListener() {
@Override
|
39,787 | }
@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("/bin/sh", "-c", "\"echo " + i + "\"")));
}
| return Task.named("exec", "/bin/sh").ofType(Exec.Result.class)
.in(() -> task1)
|
39,788 | 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, sum, fib));
}
| return Task.named("MyTask", parameter).ofType(String.class)
.in(() -> Adder.create(parameter.length(), PLUS))
|
39,789 | 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<String> task2 = Task.ofType(String.class).named("Baz", 40)
.in(() -> task1)</BUG>
.ins(() -> singletonList(task1))
| Task<Long> task1 = Task.named("Foo", "Bar", 39).ofType(Long.class)
Task<String> task2 = Task.named("Baz", 40).ofType(String.class)
.in(() -> task1)
|
39,790 | 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 + " causes an outer reference");</BUG>
serialize(task);
}
@Test
| Task<String> task = Task.named("WithRef").ofType(String.class)
.process(() -> instanceField + " causes an outer reference");
|
39,791 | 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.evaluate(des).consume(val);
| Task<String> task = Task.named("WithLocalRef").ofType(String.class)
.process(() -> local + " won't cause an outer reference");
|
39,792 | }
@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);
|
39,793 | 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);
|
39,794 | 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);
|
39,795 | 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(() -> n);
| TaskBuilder<Long> fib = Task.named("Fib", n).ofType(Long.class);
|
39,796 | 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 PatchUtils {
| import java.text.DateFormat;
import java.util.Date;
import java.util.List;
|
39,797 | 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;
|
39,798 | 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"),
MISC_FILES("misc-files"),
| APPLIES_TO_VERSION("applies-to-version"),
BUNDLES("bundles"),
|
39,799 | 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_VERSION:
if(type == Patch.PatchType.CUMULATIVE) {
| [DELETED] |
39,800 | 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, bytesToHexString(item.getContentHash()));
}
if(type != ModificationType.ADD) {
| if (item.isDirectory()) {
writer.writeAttribute(Attribute.DIRECTORY.name, "true");
if(type != ModificationType.REMOVE) {
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.