id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
18,001 | 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;
|
18,002 | </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;
|
18,003 | package org.exist.xquery.functions.text;
import org.exist.xquery.AbstractInternalModule;
<BUG>import org.exist.xquery.FunctionDef;
public class TextModule extends AbstractInternalModule {</BUG>
public static final String NAMESPACE_URI = "http://exist-db.org/xquery/text";
public static final String PREFIX = "text";
public final static String INCLUSION_DATE = "2004-03-01";
| import org.exist.xquery.functions.FunMatches;
public class TextModule extends AbstractInternalModule {
|
18,004 | new FunctionDef(HighlightMatches.signature, HighlightMatches.class),
new FunctionDef(KWICDisplay.signatures[0], KWICDisplay.class),
new FunctionDef(KWICDisplay.signatures[1], KWICDisplay.class),
new FunctionDef(RegexpFilter.signatures[0], RegexpFilter.class),
new FunctionDef(RegexpFilter.signatures[1], RegexpFilter.class),
<BUG>new FunctionDef(RegexpFilter.signatures[2], RegexpFilter.class),
new FunctionDef(Tokenize.signature, Tokenize.class),</BUG>
new FunctionDef(MatchRegexp.signatures[0], MatchRegexp.class),
new FunctionDef(MatchRegexp.signatures[1], MatchRegexp.class),
new FunctionDef(MatchRegexp.signatures[2], MatchRegexp.class),
| new FunctionDef(RegexpFilter.signatures[3], RegexpFilter.class),
new FunctionDef(RegexpFilter.signatures[4], RegexpFilter.class),
new FunctionDef(Tokenize.signature, Tokenize.class),
|
18,005 | import org.exist.xquery.value.ValueSequence;
public class RegexpFilter extends BasicFunction {
protected static final FunctionParameterSequenceType FLAGS_PARAM = new FunctionParameterSequenceType("flags", Type.STRING, Cardinality.EXACTLY_ONE, "The flags");
protected static final FunctionParameterSequenceType REGEX_PARAM = new FunctionParameterSequenceType("regularexpression", Type.STRING, Cardinality.EXACTLY_ONE, "The regular expression to perform against the text");
protected static final FunctionParameterSequenceType TEXT_PARAM = new FunctionParameterSequenceType("text", Type.STRING, Cardinality.EXACTLY_ONE, "The text to filter");
<BUG>public final static FunctionSignature signatures[] = {new FunctionSignature(
new QName("filter", TextModule.NAMESPACE_URI, TextModule.PREFIX),</BUG>
"Filter substrings that match the regular expression in the text.",
new SequenceType[]{
TEXT_PARAM,
| public final static FunctionSignature signatures[] = {
new QName("filter", TextModule.NAMESPACE_URI, TextModule.PREFIX),
|
18,006 | new FunctionSignature(
new QName("groups", TextModule.NAMESPACE_URI, TextModule.PREFIX),
"Tries to match the string in $text to the regular expression, using " +
"the flags specified. Returns an empty sequence if the string does "+
"not match, or a sequence whose first item is the entire string, and whose " +
<BUG>"following items are the matched groups.",
new SequenceType[] {</BUG>
TEXT_PARAM,
REGEX_PARAM,
FLAGS_PARAM,
| new QName("filter", TextModule.NAMESPACE_URI, TextModule.PREFIX),
"Filter substrings that match the regular expression in the text.",
new SequenceType[]{
REGEX_PARAM
|
18,007 | import org.exist.xquery.value.FunctionParameterSequenceType;
import org.exist.xquery.value.FunctionReturnSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.Sequence;
import org.exist.xquery.value.SequenceType;
<BUG>import org.exist.xquery.value.Type;
import java.util.List;</BUG>
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
| import org.exist.xquery.functions.text.TextModule;
import java.util.List;
|
18,008 | 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 CommandDelete extends FCCommandBase {
private static final FlagMapper MAPPER = map -> key -> value -> {
map.put(key, value);
| import java.util.stream.Stream;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
|
18,009 | .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);
|
18,010 | </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) {
|
18,011 | 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)
|
18,012 | .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))
|
18,013 | .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))
|
18,014 | @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;
|
18,015 | 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;
}
|
18,016 | return configDirectory;
}
public boolean isLoaded() {
return loaded;
}
<BUG>public static Cause getCause() {
return instance().pluginCause;
}</BUG>
public EconomyService getEconomyService() {
return economyService;
| [DELETED] |
18,017 | 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.*;
|
18,018 | .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))
|
18,019 | 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) -> {
|
18,020 | 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);
|
18,021 | 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);
|
18,022 | 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() + "\"");
|
18,023 | 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() + "\"");
|
18,024 | 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
|
18,025 | .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")
|
18,026 | throw new BadRequestException("Request must contain one or more files");
}
File uploadDir = Files.createTempDirectory("importFile").toFile();
if (!uploadDir.exists()) {
throw new RuntimeException("Unable to create directory for file upload");
<BUG>}
Directory dir = new Directory(uploadDir);</BUG>
while(files.hasNext()) {
dir.accept(files.next());
}
| uploadDir.deleteOnExit();
Directory dir = new Directory(uploadDir);
|
18,027 | this.exclusionValues = exclusionValues;
this.displayTableFlag = displayTableFlag;
loadExclusionSet();
}
public String getInclusionFlag() {
<BUG>return inclusionFlag.toString();
}</BUG>
public String getExclusionValues() {
return exclusionValues;
}
| return ObjectUtils.toString(inclusionFlag);
|
18,028 | if (reader != null) {
try {
reader.close();
} catch (IOException ignore) {
}
<BUG>}
}</BUG>
return null;
}
private boolean excludePoint(String label,int index)
| IOUtils.closeQuietly(inputReader);
IOUtils.closeQuietly(in);
|
18,029 | case EXCLUDE_BY_COLUMN:
try {
if (LOGGER.isLoggable(Level.FINEST))
LOGGER.finest(inclusionFlag + " CSV Column: " + str);
colExclusionSet.add(Integer.valueOf(str));
<BUG>} catch (NumberFormatException nfe) {
}</BUG>
break;
}
}
| retVal = colExclusionSet.contains(Integer.valueOf(index));
|
18,030 | import org.bytesoft.compensable.aware.CompensableBeanFactoryAware;
import org.bytesoft.transaction.TransactionRecovery;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class CompensableWork implements Work, CompensableBeanFactoryAware {
<BUG>static final Logger logger = LoggerFactory.getLogger(CompensableWork.class.getSimpleName());
static final long SECOND_MILLIS = 1000L;</BUG>
private long stopTimeMillis = -1;
private long delayOfStoping = SECOND_MILLIS * 15;
private long recoveryInterval = SECOND_MILLIS * 60;
| static final Logger logger = LoggerFactory.getLogger(CompensableWork.class);
static final long SECOND_MILLIS = 1000L;
|
18,031 | import org.bytesoft.transaction.xa.TransactionXid;
import org.bytesoft.transaction.xa.XidFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class TransactionManagerImpl implements TransactionManager, CompensableBeanFactoryAware {
<BUG>static final Logger logger = LoggerFactory.getLogger(TransactionManagerImpl.class.getSimpleName());
private CompensableBeanFactory beanFactory;</BUG>
public void begin() throws NotSupportedException, SystemException {
TransactionManager transactionManager = this.beanFactory.getTransactionManager();
CompensableManager compensableManager = this.beanFactory.getCompensableManager();
| static final Logger logger = LoggerFactory.getLogger(TransactionManagerImpl.class);
private CompensableBeanFactory beanFactory;
|
18,032 | this.beginInCompensatingPhaseForRecovery(transaction); // recovery
} else {
this.beginInCompensatingPhaseForParticipant(transaction);
}
}
<BUG>protected void beginInTryingPhaseForCoordinator(CompensableInvocation invocation)
throws NotSupportedException, SystemException {
CompensableManager compensableManager = this.beanFactory.getCompensableManager();</BUG>
CompensableLogger compensableLogger = this.beanFactory.getCompensableLogger();
| protected void beginInTryingPhaseForCoordinator(CompensableInvocation invocation) throws NotSupportedException,
CompensableManager compensableManager = this.beanFactory.getCompensableManager();
|
18,033 | ByteUtils.byteArrayToString(compensableXid.getGlobalTransactionId()),
ByteUtils.byteArrayToString(transactionXid.getGlobalTransactionId()));
throw new SystemException("Error occurred while beginning a jta-transaction!");
}
}
<BUG>private void beginInCompensatingPhase(CompensableTransaction compensable)
throws NotSupportedException, SystemException {
XidFactory transactionXidFactory = this.beanFactory.getTransactionXidFactory();</BUG>
RemoteCoordinator transactionCoordinator = this.beanFactory.getTransactionCoordinator();
| private void beginInCompensatingPhase(CompensableTransaction compensable) throws NotSupportedException,
XidFactory transactionXidFactory = this.beanFactory.getTransactionXidFactory();
|
18,034 | this.invokeCommitForRecovery();
} else {
this.invokeCommit();
}
}
<BUG>public void invokeCommitForRecovery() throws RollbackException, HeuristicMixedException, HeuristicRollbackException,
SecurityException, IllegalStateException, SystemException {
</BUG>
TransactionManager transactionManager = this.beanFactory.getTransactionManager();
CompensableManager compensableManager = this.beanFactory.getCompensableManager();
| public void invokeCommitForRecovery() throws RollbackException, HeuristicMixedException,
HeuristicRollbackException, SecurityException, IllegalStateException, SystemException {
|
18,035 | import org.bytesoft.compensable.CompensableBeanFactory;
import org.bytesoft.compensable.aware.CompensableBeanFactoryAware;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public final class CompensableBeanRegistry implements CompensableBeanFactoryAware {
<BUG>static final Logger logger = LoggerFactory.getLogger(CompensableBeanRegistry.class.getSimpleName());
private static final CompensableBeanRegistry instance = new CompensableBeanRegistry();</BUG>
private CompensableBeanFactory beanFactory;
private RemoteCoordinator consumeCoordinator;
private Lock lock = new ReentrantLock();
| static final Logger logger = LoggerFactory.getLogger(CompensableBeanRegistry.class);
private static final CompensableBeanRegistry instance = new CompensableBeanRegistry();
|
18,036 | import org.bytesoft.transaction.xa.XidFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class SampleTransactionLogger extends VirtualLoggingSystemImpl
implements CompensableLogger, LoggingFlushable, CompensableBeanFactoryAware {
<BUG>static final Logger logger = LoggerFactory.getLogger(SampleTransactionLogger.class.getSimpleName());
private CompensableBeanFactory beanFactory;</BUG>
public void createTransaction(TransactionArchive archive) {
ArchiveDeserializer deserializer = this.beanFactory.getArchiveDeserializer();
try {
| static final Logger logger = LoggerFactory.getLogger(SampleTransactionLogger.class);
private CompensableBeanFactory beanFactory;
|
18,037 | import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.config.RuntimeBeanReference;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.GenericBeanDefinition;
public class CompensableConfigPostProcessor implements BeanFactoryPostProcessor {
<BUG>static final Logger logger = LoggerFactory.getLogger(CompensableConfigPostProcessor.class.getSimpleName());
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {</BUG>
String[] beanNameArray = beanFactory.getBeanDefinitionNames();
String applicationBeanId = null;
String registryBeanId = null;
| static final Logger logger = LoggerFactory.getLogger(CompensableConfigPostProcessor.class);
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
|
18,038 | import org.bytesoft.transaction.xa.TransactionXid;
import org.bytesoft.transaction.xa.XidFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class CompensableTransactionImpl extends TransactionListenerAdapter implements CompensableTransaction {
<BUG>static final Logger logger = LoggerFactory.getLogger(CompensableTransactionImpl.class.getSimpleName());
private final TransactionContext transactionContext;</BUG>
private final List<CompensableArchive> archiveList = new ArrayList<CompensableArchive>();
private final List<XAResourceArchive> resourceList = new ArrayList<XAResourceArchive>();
private Transaction transaction;
| static final Logger logger = LoggerFactory.getLogger(CompensableTransactionImpl.class);
private final TransactionContext transactionContext;
|
18,039 | compensableLogger.updateTransaction(this.getTransactionArchive());
boolean nativeSuccess = this.fireNativeParticipantConfirm();
boolean remoteSuccess = this.fireRemoteParticipantConfirm();
if (nativeSuccess && remoteSuccess) {
this.transactionStatus = Status.STATUS_COMMITTED;
<BUG>compensableLogger.deleteTransaction(this.getTransactionArchive());
} else {</BUG>
throw new SystemException();
}
}
| logger.info("{}| compensable transaction committed!",
ByteUtils.byteArrayToString(transactionContext.getXid().getGlobalTransactionId()));
} else {
|
18,040 | if (invocation == null) {
success = false;
byte[] globalTransactionId = transactionXid.getGlobalTransactionId();
byte[] branchQualifier = current.getTransactionXid().getBranchQualifier();
logger.error(
<BUG>"[{}] commit-transaction: error occurred while confirming service: {}, please check whether the params of method(compensable-service) supports serialization.",
ByteUtils.byteArrayToString(globalTransactionId), ByteUtils.byteArrayToString(branchQualifier));
} else {</BUG>
container.confirm(invocation);
| "{}| error occurred while confirming service: {}, please check whether the params of method(compensable-service) supports serialization.",
ByteUtils.byteArrayToString(globalTransactionId),
} else {
|
18,041 | TransactionXid globalXid = xidFactory.createGlobalXid(branchXid.getGlobalTransactionId());
try {
current.commit(globalXid, true);
current.setCommitted(true);
current.setCompleted(true);
<BUG>transactionLogger.updateCoordinator(current);
} catch (XAException ex) {
success = false;</BUG>
switch (ex.errorCode) {
case XAException.XA_HEURCOM:
| logger.info("{}| confirm remote branch: {}", ByteUtils.byteArrayToString(branchXid
.getGlobalTransactionId()), current.getDescriptor().getIdentifier());
|
18,042 | ByteUtils.byteArrayToString(branchXid.getGlobalTransactionId()), this.archive, ex);
}
} catch (RuntimeException rex) {
success = false;
TransactionXid transactionXid = this.transactionContext.getXid();
<BUG>logger.error("[{}] commit-transaction: error occurred while confirming branch: {}",
</BUG>
ByteUtils.byteArrayToString(transactionXid.getGlobalTransactionId()), this.archive, rex);
}
}
| logger.error("{}| error occurred while confirming branch: {}",
|
18,043 | } else {
boolean nativeSuccess = this.fireNativeParticipantCancel();
boolean remoteSuccess = this.fireRemoteParticipantCancel();
if (nativeSuccess && remoteSuccess) {
this.transactionStatus = Status.STATUS_ROLLEDBACK;
<BUG>compensableLogger.deleteTransaction(this.getTransactionArchive());
} else {</BUG>
throw new SystemException();
}
}
| logger.error("{}| error occurred while confirming branch: {}",
ByteUtils.byteArrayToString(branchXid.getGlobalTransactionId()), this.archive, ex);
|
18,044 | if (invocation == null) {
success = false;
byte[] globalTransactionId = transactionXid.getGlobalTransactionId();
byte[] branchQualifier = current.getTransactionXid().getBranchQualifier();
logger.error(
<BUG>"[{}] rollback-transaction: error occurred while cancelling service: {}, please check whether the params of method(compensable-service) supports serialization.",
ByteUtils.byteArrayToString(globalTransactionId), ByteUtils.byteArrayToString(branchQualifier));
} else {</BUG>
container.cancel(invocation);
| "{}| error occurred while cancelling service: {}, please check whether the params of method(compensable-service) supports serialization.",
ByteUtils.byteArrayToString(globalTransactionId),
} else {
|
18,045 | TransactionXid globalXid = this.transactionContext.getXid();
TransactionXid branchXid = xidFactory.createBranchXid(globalXid);
resourceArchive = new XAResourceArchive();
resourceArchive.setXid(branchXid);
resourceArchive.setDescriptor(descriptor);
<BUG>this.resourceList.add(resourceArchive);
}</BUG>
return true;
}
public boolean delistResource(XAResource xaRes, int flag) throws IllegalStateException, SystemException {
| logger.info("{}| enlist remote resource: {}.",
ByteUtils.byteArrayToString(globalXid.getGlobalTransactionId()), identifier);
|
18,046 | } else {
this.archiveList.add(archive);
this.transientArchiveList.add(archive);
}
}
<BUG>public void registerSynchronization(Synchronization sync) throws RollbackException, IllegalStateException, SystemException {
}</BUG>
public void registerTransactionListener(TransactionListener listener) {
}
public void registerTransactionResourceListener(TransactionResourceListener listener) {
| public void registerSynchronization(Synchronization sync) throws RollbackException, IllegalStateException,
|
18,047 | compensableLogger.updateTransaction(this.getTransactionArchive());
boolean nativeSuccess = this.fireNativeParticipantRecoveryConfirm();
boolean remoteSuccess = this.fireRemoteParticipantRecoveryConfirm();
if (nativeSuccess && remoteSuccess) {
this.transactionStatus = Status.STATUS_COMMITTED;
<BUG>compensableLogger.deleteTransaction(this.getTransactionArchive());
} else {</BUG>
throw new SystemException();
}
}
| logger.info("{}| compensable transaction recovery committed!",
ByteUtils.byteArrayToString(transactionContext.getXid().getGlobalTransactionId()));
} else {
|
18,048 | this.positive = true;
this.archive = current;
String identifier = current.getCompensableResourceKey();
if (StringUtils.isBlank(identifier)) {
if (previouConfirmed) {
<BUG>logger.warn(
"There is no valid resource participated in the current branch transaction, the status of the current branch transaction is unknown!");
</BUG>
} else {
logger.debug("There is no valid resource participated in the current branch transaction!");
| logger.warn("There is no valid resource participated in the current branch transaction, the status of the current branch transaction is unknown!");
|
18,049 | } catch (XAException xaex) {
switch (xaex.errorCode) {
case XAException.XAER_NOTA:
break;
case XAException.XAER_RMERR:
<BUG>logger.warn(
"The database table 'bytejta' cannot found, the status of the current branch transaction is unknown!");
</BUG>
break;
case XAException.XAER_RMFAIL:
| logger.warn("The database table 'bytejta' cannot found, the status of the current branch transaction is unknown!");
|
18,050 | TransactionXid globalXid = xidFactory.createGlobalXid(branchXid.getGlobalTransactionId());
try {
current.recoveryCommit(globalXid);
current.setCommitted(true);
current.setCompleted(true);
<BUG>transactionLogger.updateCoordinator(current);
} catch (XAException ex) {</BUG>
switch (ex.errorCode) {
case XAException.XA_HEURCOM:
current.setCommitted(true);
| logger.info("{}| recovery-confirm remote branch: {}", ByteUtils.byteArrayToString(branchXid
.getGlobalTransactionId()), current.getDescriptor().getIdentifier());
} catch (XAException ex) {
|
18,051 | ByteUtils.byteArrayToString(branchXid.getGlobalTransactionId()), this.archive, ex);
}
} catch (RuntimeException rex) {
success = false;
TransactionXid transactionXid = this.transactionContext.getXid();
<BUG>logger.error("[{}] recover-transaction: error occurred while confirming branch: {}",
</BUG>
ByteUtils.byteArrayToString(transactionXid.getGlobalTransactionId()), this.archive, rex);
}
}
| logger.error("{}| error occurred while confirming branch: {}",
|
18,052 | compensableLogger.updateTransaction(this.getTransactionArchive());
boolean nativeSuccess = this.fireNativeParticipantRecoveryCancel();
boolean remoteSuccess = this.fireRemoteParticipantRecoveryCancel();
if (nativeSuccess && remoteSuccess) {
this.transactionStatus = Status.STATUS_ROLLEDBACK;
<BUG>compensableLogger.deleteTransaction(this.getTransactionArchive());
} else {</BUG>
throw new SystemException();
}
}
| logger.info("{}| compensable transaction recovery rolled back!",
ByteUtils.byteArrayToString(transactionContext.getXid().getGlobalTransactionId()));
} else {
|
18,053 | switch (xaex.errorCode) {
case XAException.XAER_NOTA:
current.setTried(false);
continue;
case XAException.XAER_RMERR:
<BUG>logger.warn(
"The database table 'bytejta' cannot found, the status of the trying branch transaction is unknown!");
</BUG>
break;
case XAException.XAER_RMFAIL:
| logger.warn("The database table 'bytejta' cannot found, the status of the trying branch transaction is unknown!");
|
18,054 | this.positive = false;
this.archive = current;
String identifier = current.getCompensableResourceKey();
if (StringUtils.isBlank(identifier)) {
if (previouCancelled) {
<BUG>logger.warn(
"There is no valid resource participated in the current branch transaction, the status of the current branch transaction is unknown!");
</BUG>
} else {
logger.debug("There is no valid resource participated in the current branch transaction!");
| logger.warn("There is no valid resource participated in the current branch transaction, the status of the current branch transaction is unknown!");
|
18,055 | } catch (XAException xaex) {
switch (xaex.errorCode) {
case XAException.XAER_NOTA:
break;
case XAException.XAER_RMERR:
<BUG>logger.warn(
"The database table 'bytejta' cannot found, the status of the current branch transaction is unknown!");
</BUG>
break;
case XAException.XAER_RMFAIL:
| logger.warn("The database table 'bytejta' cannot found, the status of the current branch transaction is unknown!");
|
18,056 | </BUG>
ByteUtils.byteArrayToString(globalTransactionId), ByteUtils.byteArrayToString(branchQualifier));
} catch (RuntimeException rex) {
success = false;
<BUG>logger.error("[{}] rollback-transaction: error occurred while cancelling service: {}",
</BUG>
ByteUtils.byteArrayToString(transactionXid.getGlobalTransactionId()), this.archive, rex);
} finally {
this.archive = null;
this.positive = null;
| } catch (IllegalArgumentException rex) {
byte[] globalTransactionId = transactionXid.getGlobalTransactionId();
byte[] branchQualifier = current.getTransactionXid().getBranchQualifier();
logger.error(
"{}| error occurred while cancelling service: {}, please check whether the params of method(compensable-service) supports serialization.",
logger.error("{}| error occurred while cancelling service: {}",
|
18,057 | break;
case XAException.XAER_RMERR:
case XAException.XAER_RMFAIL:
default:
success = false;
<BUG>logger.error("forget-transaction: error occurred while forgetting branch: {}", branchXid, xaex);
}</BUG>
}
}
}
| logger.error("forget-transaction: error occurred while forgetting branch: {}", branchXid,
|
18,058 | break;
case XAException.XAER_RMERR:
case XAException.XAER_RMFAIL:
default:
success = false;
<BUG>logger.error("forget-transaction: error occurred while forgetting branch: {}", branchXid, xaex);
}</BUG>
}
}
}
| logger.error("forget-transaction: error occurred while forgetting branch: {}", branchXid,
|
18,059 | } catch (RuntimeException rex) {
success = false;
logger.error("forget-transaction: error occurred while forgetting branch: {}", branchXid, rex);
}
}
<BUG>if (success == false) {
throw new SystemException();</BUG>
}
}
public CompensableArchive getCompensableArchive() {
| if (success) {
logger.info("{}| forget transaction.",
ByteUtils.byteArrayToString(this.transactionContext.getXid().getGlobalTransactionId()));
} else {
throw new SystemException();
|
18,060 | import org.bytesoft.transaction.logging.ArchiveDeserializer;
import org.bytesoft.transaction.xa.TransactionXid;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ArchiveDeserializerImpl implements ArchiveDeserializer {
<BUG>static final Logger logger = LoggerFactory.getLogger(ArchiveDeserializerImpl.class.getSimpleName());
static final byte TYPE_TRANSACTION = 0x0;</BUG>
static final byte TYPE_XA_RESOURCE = 0x1;
static final byte TYPE_COMPENSABLE = 0x2;
private ArchiveDeserializer compensableArchiveDeserializer;
| static final Logger logger = LoggerFactory.getLogger(ArchiveDeserializerImpl.class);
static final byte TYPE_TRANSACTION = 0x0;
|
18,061 | import javax.transaction.RollbackException;
import javax.transaction.SystemException;
import javax.transaction.xa.XAException;
import javax.transaction.xa.XAResource;
import javax.transaction.xa.Xid;
<BUG>import org.bytesoft.bytejta.supports.wire.RemoteCoordinator;
import org.bytesoft.compensable.CompensableBeanFactory;</BUG>
import org.bytesoft.compensable.CompensableManager;
import org.bytesoft.compensable.CompensableTransaction;
import org.bytesoft.compensable.archive.TransactionArchive;
| import org.bytesoft.common.utils.ByteUtils;
import org.bytesoft.compensable.CompensableBeanFactory;
|
18,062 | import org.bytesoft.transaction.xa.TransactionXid;
import org.bytesoft.transaction.xa.XidFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class CompensableCoordinator implements RemoteCoordinator, CompensableBeanFactoryAware {
<BUG>static final Logger logger = LoggerFactory.getLogger(CompensableCoordinator.class.getSimpleName());
private CompensableBeanFactory beanFactory;</BUG>
public String getIdentifier() {
throw new IllegalStateException();
}
| static final Logger logger = LoggerFactory.getLogger(CompensableCoordinator.class);
private CompensableBeanFactory beanFactory;
|
18,063 | TransactionRepository compensableRepository = this.beanFactory.getCompensableRepository();
TransactionXid globalXid = transactionContext.getXid();
CompensableTransactionImpl transaction = new CompensableTransactionImpl(transactionContext);
transaction = new CompensableTransactionImpl(transactionContext);
transaction.setBeanFactory(this.beanFactory);
<BUG>compensableLogger.createTransaction(transaction.getTransactionArchive());
compensableManager.associateThread(transaction);</BUG>
compensableRepository.putTransaction(globalXid, transaction);
return transaction;
}
| logger.info("{}| compensable transaction begin!",
ByteUtils.byteArrayToString(globalXid.getGlobalTransactionId()));
compensableManager.associateThread(transaction);
|
18,064 | import org.bytesoft.transaction.supports.serialize.XAResourceDeserializer;
import org.bytesoft.transaction.xa.TransactionXid;
import org.bytesoft.transaction.xa.XidFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
<BUG>public class TransactionRecoveryImpl implements TransactionRecovery, TransactionRecoveryListener, CompensableBeanFactoryAware {
static final Logger logger = LoggerFactory.getLogger(TransactionRecoveryImpl.class.getSimpleName());
private CompensableBeanFactory beanFactory;</BUG>
private final Map<TransactionXid, Transaction> recovered = new HashMap<TransactionXid, Transaction>();
public void onRecovery(Transaction transaction) {
| public class TransactionRecoveryImpl implements TransactionRecovery, TransactionRecoveryListener,
static final Logger logger = LoggerFactory.getLogger(TransactionRecoveryImpl.class);
private CompensableBeanFactory beanFactory;
|
18,065 | case XAException.XAER_NOTA:
transaction.setTransactionStatus(Status.STATUS_MARKED_ROLLBACK);
compensableLogger.updateTransaction(compensable.getTransactionArchive());
break;
case XAException.XAER_RMERR:
<BUG>logger.warn(
"The database table 'bytejta' cannot found, the status of the trying branch transaction is unknown!");
</BUG>
break;
case XAException.XAER_RMFAIL:
| logger.warn("The database table 'bytejta' cannot found, the status of the trying branch transaction is unknown!");
|
18,066 | import org.bytesoft.transaction.xa.TransactionXid;
import org.bytesoft.transaction.xa.XidFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class CompensableManagerImpl implements CompensableManager, CompensableBeanFactoryAware {
<BUG>static final Logger logger = LoggerFactory.getLogger(CompensableManagerImpl.class.getSimpleName());
private CompensableBeanFactory beanFactory;</BUG>
private final Map<Thread, Transaction> compensableMap = new ConcurrentHashMap<Thread, Transaction>();
public void associateThread(Transaction transaction) {
this.compensableMap.put(Thread.currentThread(), (CompensableTransaction) transaction);
| static final Logger logger = LoggerFactory.getLogger(CompensableManagerImpl.class);
private CompensableBeanFactory beanFactory;
|
18,067 | DESCRIPTORS_MAP.put("allMatch", new TypeConversionDescriptorFactory("$it$.allMatch($c$)", "$it$." + StreamApiConstants.ALL_MATCH + "($c$)", true));
DESCRIPTORS_MAP.put("anyMatch", new TypeConversionDescriptorFactory("$it$.anyMatch($c$)", "$it$." + StreamApiConstants.ANY_MATCH + "($c$)", true));
DESCRIPTORS_MAP.put("first", new TypeConversionDescriptorFactory("$it$.first()", "$it$." + StreamApiConstants.FIND_FIRST + "()", false));
DESCRIPTORS_MAP.put("firstMatch", new TypeConversionDescriptorFactory("$it$.firstMatch($p$)", "$it$.filter($p$).findFirst()", true, true, false));
DESCRIPTORS_MAP.put("get", new TypeConversionDescriptorFactory("$it$.get($p$)", "$it$.collect(java.util.stream.Collectors.toList()).get($p$)", false));
<BUG>DESCRIPTORS_MAP.put("size", new TypeConversionDescriptorFactory("$it$.size()", "$it$.collect(java.util.stream.Collectors.toList()).size()", false));
</BUG>
DESCRIPTORS_MAP.put("toMap", new TypeConversionDescriptorFactory("$it$.toMap($f$)",
"$it$.collect(java.util.stream.Collectors.toMap(java.util.function.Function.identity(), $f$))", false));
DESCRIPTORS_MAP.put("toList", new TypeConversionDescriptorFactory("$it$.toList()", "$it$.collect(java.util.stream.Collectors.toList())", false));
| DESCRIPTORS_MAP.put("size", new TypeConversionDescriptorFactory("$it$.size()", "(int) $it$.count()", false));
|
18,068 | myMethodDescriptors = descriptors;
myToType = to;
}
@Override
public PsiExpression replace(PsiExpression expression) throws IncorrectOperationException {
<BUG>PsiMethodCallExpression toReturn = null;
PsiMethodCallExpression methodCallExpression = (PsiMethodCallExpression) expression;</BUG>
final SmartPointerManager smartPointerManager = SmartPointerManager.getInstance(expression.getProject());
for (TypeConversionDescriptorBase descriptor : myMethodDescriptors) {
final PsiExpression oldQualifier = methodCallExpression.getMethodExpression().getQualifierExpression();
| PsiExpression toReturn = null;
PsiMethodCallExpression methodCallExpression = (PsiMethodCallExpression) expression;
|
18,069 | for (TypeConversionDescriptorBase descriptor : myMethodDescriptors) {
final PsiExpression oldQualifier = methodCallExpression.getMethodExpression().getQualifierExpression();
final SmartPsiElementPointer<PsiExpression> qualifierRef = oldQualifier == null
? null
: smartPointerManager.createSmartPsiElementPointer(oldQualifier);
<BUG>final PsiMethodCallExpression replaced = (PsiMethodCallExpression)descriptor.replace(methodCallExpression);
if (toReturn == null) {</BUG>
toReturn = replaced;
}
final PsiExpression newQualifier = qualifierRef == null ? null : qualifierRef.getElement();
| final PsiExpression replaced = descriptor.replace(methodCallExpression);
if (toReturn == null) {
|
18,070 | ArrayList<String> strings1 = new ArrayList<>();
strings1.add(o);
return strings1.stream();
}
return null;
<BUG>}).collect(Collectors.toList()).size();
}</BUG>
Iterable<String> getIterable() {
return null;
}
| }).count();
|
18,071 | import android.util.Log;
import android.view.SurfaceView;
import android.view.WindowManager;
import android.widget.MediaController;
import android.widget.Toast;
<BUG>import android.widget.VideoView;
import com.felkertech.cumulustv.model.ChannelDatabase;</BUG>
import com.felkertech.cumulustv.model.JsonChannel;
import com.felkertech.cumulustv.player.CumulusTvPlayer;
import com.felkertech.cumulustv.player.CumulusWebPlayer;
| import com.bumptech.glide.Glide;
import com.bumptech.glide.request.target.Target;
import com.felkertech.cumulustv.model.ChannelDatabase;
|
18,072 | import com.felkertech.cumulustv.model.JsonChannel;
import com.felkertech.cumulustv.player.CumulusTvPlayer;
import com.felkertech.cumulustv.player.CumulusWebPlayer;
import com.felkertech.cumulustv.player.MediaSourceFactory;
import com.felkertech.n.cumulustv.R;
<BUG>import com.google.android.exoplayer2.DefaultLoadControl;
import com.google.android.exoplayer2.LoadControl;
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
import com.google.android.exoplayer2.trackselection.TrackSelector;
import com.google.android.media.tv.companionlibrary.TvPlayer;
import com.squareup.picasso.Picasso;
import java.io.IOException;
import java.util.Arrays;
public class CumulusVideoPlayback extends AppCompatActivity {</BUG>
private static final String TAG = CumulusVideoPlayback.class.getSimpleName();
| import java.util.concurrent.ExecutionException;
public class CumulusVideoPlayback extends AppCompatActivity {
|
18,073 | return;
}
Log.d(TAG, "Adding dynamic shortcut to " + jsonChannel.getName());
String logo = ChannelDatabase.getNonNullChannelLogo(jsonChannel);
try {
<BUG>Bitmap logoBitmap = Picasso.with(getApplicationContext())
.load(logo)
.get();</BUG>
ShortcutManager shortcutManager = getSystemService(ShortcutManager.class);
| Bitmap logoBitmap = Glide.with(getApplicationContext())
.asBitmap()
.into(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL)
.get();
|
18,074 | .setLongLabel(jsonChannel.getNumber() + " - " + jsonChannel.getName())
.setIcon(Icon.createWithBitmap(logoBitmap))
.setIntent(playVideo)
.build();
shortcutManager.setDynamicShortcuts(Arrays.asList(shortcut));
<BUG>} catch (IOException e) {
e.printStackTrace();</BUG>
}
}
}
| } catch (InterruptedException | ExecutionException e) {
e.printStackTrace();
|
18,075 | setContentView(v);
}
@Override
protected void onResume() {
super.onResume();
<BUG>new MaterialDialog.Builder(this)
.title("Choose a file")
.items(getTitles())
.itemsCallback(new MaterialDialog.ListCallback() {
@Override
public void onSelection(MaterialDialog dialog, View itemView, int position,
CharSequence text) {</BUG>
if (position > 1) {
| new AlertDialog.Builder(this)
.setTitle("Choose a file")
.setItems(getTitles(), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialogInterface, int position) {
|
18,076 | Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse("https://raw.githubusercontent.com/Fleker/Cumulus" +
"TV/master/app/src/test/resources/m3u_test1.m3u"));
startActivity(i);
} else if (position == 1) {
<BUG>new MaterialDialog.Builder(FileIoTestActivity.this)
.title("Here's how your Channel Data Looks:")
.content(ChannelDatabase.getInstance(FileIoTestActivity.this).toM3u())
.show();</BUG>
}
| new AlertDialog.Builder(FileIoTestActivity.this)
.setTitle("Here's how your Channel Data Looks:")
.setMessage(ChannelDatabase.getInstance(FileIoTestActivity.this)
.show();
|
18,077 | private static final Buffer NEW_ORDER_SINGLE = makeMessage("1=ACCOUNT|11=4|38=5000|40=2|44=400.5|54=1|55=ESH6|58=TEXT|59=0|60=20140603-11:53:03.922|167=FUT|");
private final MessageParser parser = new FastMessageParser();
private final NewOrder newOrder = new NewOrder();
@Benchmark
public void decodeNewOrderSingle() {
<BUG>parser.wrap(NEW_ORDER_SINGLE);
while (parser.hasRemaining()) {</BUG>
int tag = parser.parseTag();
switch (tag) {
case Tag.Account:
| MessageParser parser = this.parser.wrap(NEW_ORDER_SINGLE);
NewOrder newOrder = this.newOrder;
while (parser.hasRemaining()) {
|
18,078 | import org.f1x.message.field.Tag;
import org.f1x.message.field.TimeInForce;
import org.f1x.util.buffer.Buffer;
import org.f1x.util.buffer.MutableBuffer;
import org.f1x.util.buffer.UnsafeBuffer;
<BUG>import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.State;</BUG>
import static org.f1x.util.BenchmarkUtil.makeMessage;
| import org.openjdk.jmh.annotations.*;
|
18,079 | 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;
|
18,080 | 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;
|
18,081 | 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"),
|
18,082 | 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] |
18,083 | 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) {
|
18,084 | package org.jboss.as.patching;
import org.jboss.as.controller.OperationFailedException;
import org.jboss.as.patching.runner.PatchingException;
import org.jboss.logging.Messages;
import org.jboss.logging.annotations.Message;
<BUG>import org.jboss.logging.annotations.MessageBundle;
import java.io.IOException;</BUG>
import java.util.List;
@MessageBundle(projectCode = "JBAS")
public interface PatchMessages {
| import org.jboss.logging.annotations.Cause;
import java.io.IOException;
|
18,085 | import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.descriptors.*;
import org.jetbrains.jet.lang.psi.*;
import org.jetbrains.jet.lang.resolve.BindingContext;
import org.jetbrains.jet.lang.resolve.DescriptorUtils;
<BUG>import org.jetbrains.jet.lang.resolve.calls.inference.ConstraintResolutionListener;
import org.jetbrains.jet.lang.resolve.calls.inference.ConstraintSystem;
import org.jetbrains.jet.lang.resolve.calls.inference.ConstraintSystemImpl;
import org.jetbrains.jet.lang.resolve.calls.inference.ConstraintSystemSolution;</BUG>
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
| import org.jetbrains.jet.lang.resolve.calls.inference.*;
|
18,086 | import org.jetbrains.jet.lang.types.Variance;
import org.jetbrains.jet.plugin.compiler.WholeProjectAnalyzerFacade;
import org.jetbrains.jet.plugin.completion.handlers.JetFunctionInsertHandler;
import org.jetbrains.jet.resolve.DescriptorRenderer;
import java.util.List;
<BUG>import java.util.Set;
class JetSimpleNameReference extends JetPsiReference {</BUG>
private final static JetFunctionInsertHandler EMPTY_FUNCTION_HANDLER = new JetFunctionInsertHandler(
JetFunctionInsertHandler.CaretPosition.AFTER_BRACKETS);
private final static JetFunctionInsertHandler PARAMS_FUNCTION_HANDLER = new JetFunctionInsertHandler(
| import static org.jetbrains.jet.lang.resolve.calls.inference.ConstraintType.RECEIVER;
class JetSimpleNameReference extends JetPsiReference {
|
18,087 | for (TypeParameterDescriptor typeParameterDescriptor : receiverArgument.getTypeParameters()) {
constraintSystem.registerTypeVariable(typeParameterDescriptor, Variance.INVARIANT);
}
ReceiverDescriptor receiverParameter = receiverArgument.getReceiverParameter();
if (expectedReceiver.exists() && receiverParameter.exists()) {
<BUG>constraintSystem.addSubtypingConstraint(expectedReceiver.getType(), receiverParameter.getType());
</BUG>
}
else if (expectedReceiver.exists() || receiverParameter.exists()) {
return false;
| constraintSystem.addSubtypingConstraint(RECEIVER.assertSubtyping(expectedReceiver.getType(), receiverParameter.getType()));
|
18,088 | import com.fasterxml.jackson.databind.SerializationConfig;
import com.fasterxml.jackson.databind.ser.Serializers;
import javaslang.*;
import javaslang.collection.*;
public class JavaslangSerializers extends Serializers.Base {
<BUG>private final boolean compact;
public JavaslangSerializers(boolean compact) {
this.compact = compact;
}</BUG>
@Override
| [DELETED] |
18,089 | import com.fasterxml.jackson.databind.JavaType;
import javaslang.collection.Set;
import java.io.IOException;
class SetSerializer<T extends Set<?>> extends ValueSerializer<T> {
private static final long serialVersionUID = 1L;
<BUG>SetSerializer(JavaType type, Class<?> clz, boolean compact) {
super(type, clz, compact);
}</BUG>
@Override
Object toJavaObj(T value) throws IOException {
| SetSerializer(JavaType type, Class<?> clz) {
super(type, clz);
}
|
18,090 | import javaslang.collection.Map;
import java.io.IOException;
import java.util.HashMap;
class MapSerializer<T extends Map<?, ?>> extends ValueSerializer<T> {
private static final long serialVersionUID = 1L;
<BUG>MapSerializer(JavaType type, Class<?> clz, boolean compact) {
super(type, clz, compact);
}</BUG>
@Override
Object toJavaObj(T value) throws IOException {
| MapSerializer(JavaType type, Class<?> clz) {
super(type, clz);
}
|
18,091 | import com.fasterxml.jackson.databind.module.SimpleModule;
import javaslang.jackson.datatype.deserialize.JavaslangDeserializers;
import javaslang.jackson.datatype.serialize.JavaslangSerializers;
public class JavaslangModule extends SimpleModule {
private static final long serialVersionUID = 1L;
<BUG>private final Config cfg;
public JavaslangModule() {
this(new Config());
}
public JavaslangModule(Config cfg) {
this.cfg = cfg;
}</BUG>
@Override
| [DELETED] |
18,092 | import com.fasterxml.jackson.databind.JavaType;
import javaslang.collection.CharSeq;
import java.io.IOException;
class CharSeqSerializer extends ValueSerializer<CharSeq> {
private static final long serialVersionUID = 1L;
<BUG>CharSeqSerializer(JavaType type, boolean compact) {
super(type, CharSeq.class, compact);
}</BUG>
@Override
Object toJavaObj(CharSeq value) throws IOException {
| CharSeqSerializer(JavaType type) {
super(type, CharSeq.class);
}
|
18,093 | import com.fasterxml.jackson.databind.JavaType;
import javaslang.collection.Seq;
import java.io.IOException;
class SeqSerializer<T extends Seq<?>> extends ValueSerializer<T> {
private static final long serialVersionUID = 1L;
<BUG>SeqSerializer(JavaType type, Class<?> clz, boolean compact) {
super(type, clz, compact);
}</BUG>
@Override
Object toJavaObj(T value) throws IOException {
| SeqSerializer(JavaType type, Class<?> clz) {
super(type, clz);
}
|
18,094 | import java.util.Collections;
import java.util.HashMap;
import java.util.List;
class TupleSerializer<T extends Tuple> extends ValueSerializer<T> {
private static final long serialVersionUID = 1L;
<BUG>TupleSerializer(JavaType type, Class<?> clz, boolean compact) {
super(type, clz, compact);
}</BUG>
@Override
Object toJavaObj(Tuple tuple) throws IOException {
| TupleSerializer(JavaType type, Class<?> clz) {
super(type, clz);
}
|
18,095 | String command = null;
String result = null;
Socket socket;
while (continueListenning() && (socket = getSocket()) != null) {
try {
<BUG>time = System.currentTimeMillis();
try {</BUG>
InputStream inputStream = socket.getInputStream();
InputStreamReader inputStreamReader = new InputStreamReader(inputStream, "ISO-8859-1");
BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
| InetAddress ipAddress = socket.getInetAddress();
|
18,096 | InputStreamReader inputStreamReader = new InputStreamReader(inputStream, "ISO-8859-1");
BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
command = bufferedReader.readLine();
if (command == null) {
command = "DISCONNECTED";
<BUG>} else {
result = AdministrationTCP.this.processCommand(command);
</BUG>
OutputStream outputStream = socket.getOutputStream();
outputStream.write(result.getBytes("ISO-8859-1"));
| Client client = Client.get(ipAddress);
User user = client == null ? null : client.getUser();
result = AdministrationTCP.this.processCommand(user, command);
|
18,097 | } catch (SocketException ex) {
Server.logDebug("interrupted " + getName() + " connection.");
result = "INTERRUPTED\n";
} finally {
socket.close();
<BUG>InetAddress address = socket.getInetAddress();
</BUG>
clearSocket();
Server.logAdministration(
time,
| InetAddress address = ipAddress;
|
18,098 | import org.apache.karaf.jaas.boot.principal.RolePrincipal;
import org.apache.karaf.jaas.boot.principal.UserPrincipal;
import org.apache.karaf.shell.api.console.Session;
import org.apache.karaf.shell.api.console.SessionFactory;
import org.junit.After;
<BUG>import org.junit.Before;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.TestProbeBuilder;
import org.ops4j.pax.exam.ProbeBuilder;
import org.ops4j.pax.exam.karaf.options.KarafDistributionOption;
import org.ops4j.pax.exam.karaf.options.LogLevelOption;
import org.ops4j.pax.exam.options.UrlReference;</BUG>
import org.osgi.framework.Bundle;
| import org.ops4j.pax.exam.MavenUtils;
import org.ops4j.pax.exam.options.MavenUrlReference;
import org.ops4j.pax.exam.options.UrlReference;
|
18,099 | return probe;
}
@Inject
SessionFactory sessionFactory;
ExecutorService executor = Executors.newCachedThreadPool();
<BUG>protected String executeCommand(final String command, final Long timeout, final Boolean silent) {
</BUG>
String response;
final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
final PrintStream printStream = new PrintStream(byteArrayOutputStream);
| private String executeCommand(final String command, final Long timeout, final Boolean silent) {
|
18,100 | return response;
}
protected String executeCommand(final String command) {
return executeCommand(command, COMMAND_TIMEOUT, false);
}
<BUG>public void installAndAssertFeature(final String feature) throws Throwable {
executeCommand("feature:list -i");
executeCommand("feature:install " + feature);
assertFeatureInstalled(feature);</BUG>
}
| featuresService.installFeature(feature);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.