id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
25,701 | private HttpVersion version = HttpVersion.HTTP_1_1;
private long idleTimeout;
private long timeout;
private ContentProvider content;
private boolean followRedirects;
<BUG>private List<HttpCookie> cookies;
protected HttpRequest(HttpClient client, HttpConversation conversation, URI uri)</BUG>
{
this.client = client;
this... | private Map<String, Object> attributes;
private List<RequestListener> requestListeners;
protected HttpRequest(HttpClient client, HttpConversation conversation, URI uri)
|
25,702 | cookies.add(cookie);
return this;
}
@Override
public Request attribute(String name, Object value)
<BUG>{
attributes.put(name, value);</BUG>
return this;
}
@Override
| if (attributes == null)
attributes = new HashMap<>(4);
attributes.put(name, value);
|
25,703 | return result;
}
@Override
public Request listener(Request.Listener listener)
{
<BUG>this.requestListeners.add(listener);
return this;</BUG>
}
@Override
| return requestListener(listener);
|
25,704 | return this;</BUG>
}
@Override
public Request onRequestQueued(final QueuedListener listener)
{
<BUG>this.requestListeners.add(new QueuedListener()
</BUG>
{
@Override
public void onQueued(Request request)
| return result;
public Request listener(Request.Listener listener)
return requestListener(listener);
return requestListener(new QueuedListener()
|
25,705 | iterator = _iterator;
forward = _forward;
myMatcher = getBraceMatcher(_fileType);
brace1Token = iterator.getTokenType();
group = getTokenGroup(brace1Token, fileType);
<BUG>brace1TagName = myMatcher == null ? null : myMatcher.getTagName(fileText, iterator);
isStrict = myMatcher != null && myMatcher.isStrictTagMatching(... | brace1TagName = myMatcher == null ? null : getTagName(myMatcher,fileText, iterator);
isStrict = myMatcher != null && isStrictTagMatching(myMatcher,fileType, group);
isCaseSensitive = myMatcher != null && areTagsCaseSensitive(myMatcher,fileType, group);
|
25,706 | if (iterator.atEnd()) {
break;
}
IElementType tokenType = iterator.getTokenType();
if (getTokenGroup(tokenType, fileType) == group) {
<BUG>String tagName = myMatcher == null ? null : myMatcher.getTagName(fileText, iterator);
</BUG>
if (!isStrict && !Comparing.equal(brace1TagName, tagName, isCaseSensitive)) continue;
if... | String tagName = myMatcher == null ? null : getTagName(myMatcher,fileText, iterator);
|
25,707 | <BUG>package com.intellij.codeInsight.highlighting;
import com.intellij.psi.tree.IElementType;
import com.intellij.psi.PsiFile;
import com.intellij.openapi.editor.highlighter.HighlighterIterator;
import com.intellij.openapi.fileTypes.FileType;</BUG>
import org.jetbrains.annotations.NotNull;
| import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.fileTypes.FileTypeExtensionPoint;
|
25,708 | import com.intellij.psi.PsiFile;
import com.intellij.openapi.editor.highlighter.HighlighterIterator;
import com.intellij.openapi.fileTypes.FileType;</BUG>
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
<BUG>public interface BraceMatcher {
int getTokenGroup(IElementType tokenType);
... | import com.intellij.psi.tree.IElementType;
ExtensionPointName<FileTypeExtensionPoint<BraceMatcher>> EP_NAME = new ExtensionPointName<FileTypeExtensionPoint<BraceMatcher>>("com.intellij.braceMatcher");
int getBraceTokenGroupId(IElementType tokenType);
|
25,709 | </BUG>
boolean isLBraceToken(HighlighterIterator iterator,CharSequence fileText, FileType fileType);
boolean isRBraceToken(HighlighterIterator iterator,CharSequence fileText, FileType fileType);
boolean isPairBraces(IElementType tokenType,IElementType tokenType2);
boolean isStructuralBrace(HighlighterIterator iterator,... | import com.intellij.psi.PsiFile;
import com.intellij.psi.tree.IElementType;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public interface BraceMatcher {
ExtensionPointName<FileTypeExtensionPoint<BraceMatcher>> EP_NAME = new ExtensionPointName<FileTypeExtensionPoint<BraceMatcher>>... |
25,710 | private static void handleAfterLParen(Editor editor, FileType fileType, char lparenChar){
int offset = editor.getCaretModel().getOffset();
HighlighterIterator iterator = ((EditorEx) editor).getHighlighter().createIterator(offset);
boolean atEndOfDocument = offset == editor.getDocument().getTextLength();
if (!atEndOfDoc... | if (iterator.atEnd()) return;
IElementType braceTokenType = iterator.getTokenType();
if (!braceMatcher.isLBraceToken(iterator, editor.getDocument().getCharsSequence(), fileType)) return;
if (!iterator.atEnd()) {
|
25,711 | if (!braceMatcher.isLBraceToken(iterator, chars, fileType) &&
!braceMatcher.isRBraceToken(iterator, chars, fileType)
) {
return true;
}
<BUG>final char closingBrace = c == '(' ? ')' : ']';
int rparenOffset = BraceMatchingUtil.findRightmostRParen(iterator, braceMatcher.getTokenType(closingBrace, iterator),chars,fileType... | int rparenOffset = BraceMatchingUtil.findRightmostRParen(iterator, iterator.getTokenType() ,chars,fileType);
|
25,712 | package org.apache.ignite.internal.processors.query.h2.twostep;
import org.apache.ignite.*;
import org.apache.ignite.cache.query.*;
<BUG>import org.apache.ignite.cluster.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.managers.communication.*;
import org.apache.ignite.internal.processors.cache... | import org.apache.ignite.events.*;
import org.apache.ignite.internal.managers.eventstorage.*;
import org.apache.ignite.internal.processors.cache.*;
|
25,713 | if (r == null) // Already finished with error or canceled.
return;
final int pageSize = r.pageSize;
GridMergeIndex idx = r.tbls.get(msg.query()).getScanIndex(null);
idx.addPage(new GridResultPage(node.id(), msg, false) {
<BUG>@Override public void fetchNextPage() {
try {</BUG>
GridQueryNextPageRequest msg0 = new GridQu... | if (r.rmtErr != null)
throw new CacheException("Next page fetch failed.", r.rmtErr);
try {
|
25,714 | h2.mapQueryExecutor().onMessage(ctx.localNodeId(), msg0);
else
ctx.io().send(node, GridTopic.TOPIC_QUERY, msg0, GridIoPolicy.PUBLIC_POOL);
}
catch (IgniteCheckedException e) {
<BUG>throw new IgniteException(e);
</BUG>
}
}
});
| throw new CacheException(e);
|
25,715 | private static class QueryRun {
private List<GridMergeTable> tbls;
private CountDownLatch latch;
private Connection conn;
private int pageSize;
<BUG>private volatile Throwable rmtErr;
}</BUG>
private static class Iter extends GridH2ResultSetIterator<List<?>> {
private static final long serialVersionUID = 0L;
protected ... | private volatile CacheException rmtErr;
}
|
25,716 | public class GridResultPage {
private final UUID src;
protected final GridQueryNextPageResponse res;
private final Collection<Value[]> rows;
private final boolean last;
<BUG>protected GridResultPage(UUID src, GridQueryNextPageResponse res, boolean last) {
</BUG>
assert src != null;
this.src = src;
this.res = res;
| public GridResultPage(UUID src, GridQueryNextPageResponse res, boolean last) {
|
25,717 | this.src = src;
this.res = res;
this.last = last;
if (last)
assert res == null : "The last page must be dummy.";
<BUG>rows = res == null ? null : GridMapQueryExecutor.unmarshallRows(res.rows());
</BUG>
}
public boolean isLast() {
return last;
| rows = res == null ? Collections.<Value[]>emptySet() : GridMapQueryExecutor.unmarshallRows(res.rows());
|
25,718 | package org.apache.ignite.internal.processors.query.h2.twostep;
import org.apache.ignite.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.events.*;
import org.apache.ignite.internal.*;
<BUG>import org.apache.ignite.internal.managers.communication.*;
import org.apache.ignite.internal.processors.cache.quer... | import org.apache.ignite.internal.managers.eventstorage.*;
import org.apache.ignite.internal.processors.cache.query.*;
|
25,719 | private final ConcurrentMap<UUID, Counter> remainingRows = new ConcurrentHashMap8<>();
private final AtomicBoolean lastSubmitted = new AtomicBoolean();
private ArrayList<Row> fetched = new ArrayList<>();
public GridMergeIndex(GridMergeTable tbl, String name, IndexType type, IndexColumn[] cols) {
initBaseIndex(tbl, 0, n... | public boolean hasSource(UUID nodeId) {
return remainingRows.containsKey(nodeId);
@Override public long getRowCount(Session session) {
|
25,720 | @Override public long getRowCountApproximation() {
return getRowCount(null);
}
public void addSource(UUID nodeId) {
if (remainingRows.put(nodeId, new Counter()) != null)
<BUG>throw new IllegalStateException();
}</BUG>
public final void addPage(GridResultPage page) {
int pageRowsCnt = page.rows().size();
if (pageRowsCnt... | public void fail(UUID nodeId) {
addPage0(new GridResultPage(nodeId, null, false));
|
25,721 | private final BlockingQueue<GridResultPage> queue = new LinkedBlockingQueue<>();
public GridMergeIndexUnsorted(GridMergeTable tbl, String name) {
super(tbl, name, IndexType.createScan(false), IndexColumn.wrap(tbl.getColumns()));
}
@Override protected void addPage0(GridResultPage page) {
<BUG>if (page.rows() != null || ... | if (!page.rows().isEmpty() || page.isLast() || queue.isEmpty())
queue.add(page);
|
25,722 | import org.spongepowered.api.world.Locatable;
import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.World;
import javax.annotation.Nullable;
import java.util.List;
<BUG>import java.util.Optional;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG>
public class CommandDel... | import java.util.stream.Stream;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
|
25,723 | .append(Text.of(TextColors.GREEN, "Usage: "))
.append(getUsage(source))
.build());
return CommandResult.empty();
} else if (isIn(REGIONS_ALIASES, parse.args[0])) {
<BUG>if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!"));
IRegion region = FGManager.getInstance().getRegion(parse.args[1... | String regionName = parse.args[1];
IRegion region = FGManager.getInstance().getRegion(regionName).orElse(null);
|
25,724 | </BUG>
isWorldRegion = true;
}
if (region == null)
<BUG>throw new CommandException(Text.of("No region exists with the name \"" + parse.args[1] + "\"!"));
if (region instanceof GlobalWorldRegion) {
</BUG>
throw new CommandException(Text.of("You may not delete the global region!"));
}
| if (world == null)
throw new CommandException(Text.of("No world exists with name \"" + worldName + "\"!"));
if (world == null) throw new CommandException(Text.of("Must specify a world!"));
region = FGManager.getInstance().getWorldRegion(world, regionName).orElse(null);
throw new CommandException(Text.of("No region exis... |
25,725 | source.getName() + " deleted " + (isWorldRegion ? "world" : "") + "region"
);
return CommandResult.success();
} else if (isIn(HANDLERS_ALIASES, parse.args[0])) {
if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!"));
<BUG>IHandler handler = FGManager.getInstance().gethandler(parse.args[... | Optional<IHandler> handlerOpt = FGManager.getInstance().gethandler(parse.args[1]);
if (!handlerOpt.isPresent())
IHandler handler = handlerOpt.get();
if (handler instanceof GlobalHandler)
|
25,726 | .excludeCurrent(true)
.autoCloseQuotes(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "handler").stream()
.filter(new StartsWithPredicate(parse.current.token))</BUG>
.map(args -> parse.current.prefix... | return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
25,727 | .excludeCurrent(true)
.autoCloseQuotes(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "handler").stream()
.filter(new StartsWithPredicate(parse.current.token))</BUG>
.map(args -> parse.current.prefix... | return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
25,728 | @Dependency(id = "foxcore")
},
description = "A world protection plugin built for SpongeAPI. Requires FoxCore.",
authors = {"gravityfox"},
url = "https://github.com/FoxDenStudio/FoxGuard")
<BUG>public final class FoxGuardMain {
public final Cause pluginCause = Cause.builder().named("plugin", this).build();
private stat... | private static FoxGuardMain instanceField;
|
25,729 | 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;
}
|
25,730 | return configDirectory;
}
public boolean isLoaded() {
return loaded;
}
<BUG>public static Cause getCause() {
return instance().pluginCause;
}</BUG>
public EconomyService getEconomyService() {
return economyService;
| [DELETED] |
25,731 | import org.spongepowered.api.world.Locatable;
import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.World;
import javax.annotation.Nullable;
import java.util.*;
<BUG>import java.util.stream.Collectors;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG>
public class Comm... | import java.util.stream.Stream;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
|
25,732 | .excludeCurrent(true)
.autoCloseQuotes(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "handler").stream()
.filter(new StartsWithPredicate(parse.current.token))</BUG>
.map(args -> parse.current.prefix... | return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
25,733 | private static FGStorageManager instance;
private final Logger logger = FoxGuardMain.instance().getLogger();</BUG>
private final Set<LoadEntry> loaded = new HashSet<>();
private final Path directory = getDirectory();
private final Map<String, Path> worldDirectories;
<BUG>private FGStorageManager() {
defaultModifiedMap ... | public final HashMap<IFGObject, Boolean> defaultModifiedMap;
private final UserStorageService userStorageService;
private final Logger logger = FoxGuardMain.instance().getLogger();
userStorageService = FoxGuardMain.instance().getUserStorage();
defaultModifiedMap = new CacheMap<>((k, m) -> {
|
25,734 | String name = fgObject.getName();
Path singleDir = dir.resolve(name.toLowerCase());
</BUG>
boolean shouldSave = fgObject.shouldSave();
if (force || shouldSave) {
<BUG>logger.info((shouldSave ? "S" : "Force s") + "aving handler \"" + name + "\" in directory: " + singleDir);
</BUG>
constructDirectory(singleDir);
try {
fg... | UUID owner = fgObject.getOwner();
boolean isOwned = !owner.equals(SERVER_UUID);
Optional<User> userOwner = userStorageService.get(owner);
String logName = (userOwner.isPresent() ? userOwner.get().getName() + ":" : "") + (isOwned ? owner + ":" : "") + name;
if (fgObject.autoSave()) {
Path singleDir = serverDir.resolve(n... |
25,735 | if (fgObject.autoSave()) {
Path singleDir = dir.resolve(name.toLowerCase());
</BUG>
boolean shouldSave = fgObject.shouldSave();
if (force || shouldSave) {
<BUG>logger.info((shouldSave ? "S" : "Force s") + "aving world region \"" + name + "\" in directory: " + singleDir);
</BUG>
constructDirectory(singleDir);
try {
fgOb... | Path singleDir = serverDir.resolve(name.toLowerCase());
logger.info((shouldSave ? "S" : "Force s") + "aving world region " + logName + " in directory: " + singleDir);
|
25,736 | public synchronized void loadRegionLinks() {
logger.info("Loading region links");
try (DB mainDB = DBMaker.fileDB(directory.resolve("regions.foxdb").normalize().toString()).make()) {
Map<String, String> linksMap = mainDB.hashMap("links", Serializer.STRING, Serializer.STRING).createOrOpen();
linksMap.entrySet().forEach(... | Optional<IRegion> regionOpt = FGManager.getInstance().getRegion(entry.getKey());
if (regionOpt.isPresent()) {
IRegion region = regionOpt.get();
logger.info("Loading links for region \"" + region.getName() + "\"");
|
25,737 | public synchronized void loadWorldRegionLinks(World world) {
logger.info("Loading world region links for world \"" + world.getName() + "\"");
try (DB mainDB = DBMaker.fileDB(worldDirectories.get(world.getName()).resolve("wregions.foxdb").normalize().toString()).make()) {
Map<String, String> linksMap = mainDB.hashMap("l... | Optional<IWorldRegion> regionOpt = FGManager.getInstance().getWorldRegion(world, entry.getKey());
if (regionOpt.isPresent()) {
IWorldRegion region = regionOpt.get();
logger.info("Loading links for world region \"" + region.getName() + "\"");
|
25,738 | 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
|
25,739 | .autoCloseQuotes(true)
.leaveFinalAsIs(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "worldregion", "handler", "controller").stream()
</BUG>
.filter(new StartsWithPredicate(parse.current.token))
.co... | return Stream.of("region", "worldregion", "handler", "controller")
|
25,740 | import org.springframework.context.annotation.Configuration;
import org.springframework.mail.javamail.JavaMailSenderImpl;
import java.util.Properties;
@Configuration
public class MailConfig {
<BUG>@Bean(name = "mailSender")
</BUG>
public JavaMailSenderImpl javaMailSender() {
return new JavaMailSenderImpl();
}
| @Bean(name = "javaMailSender")
|
25,741 | @Override
public void actionPerformed(ActionEvent e) {
TestTopComponent.getDefault().open();
TestTopComponent.getDefault().requestActive();
TestTopComponent.getDefault().clear();
<BUG>IOProvider.getDefault().getIO("Neuroph", false).getOut().println("Evaluating classifier neural network "/*+trainingController.getNetwork... | IOProvider.getDefault().getIO("Neuroph", false).getOut().println("Evaluating classifier neural network "/*+neuralNetAndDataSet.getNetwork().getLabel() +" for data set "/*+neuralNetAndDataSet.getDataSet().getLabel()*/);
NeuralNetwork<?> neuralNet = neuralNetAndDataSet.getNetwork();
DataSet dataSet = neuralNetAndDataSet.... |
25,742 | package org.neuroph.netbeans.classifier.eval;
import java.awt.BorderLayout;
import java.awt.Color;
<BUG>import java.awt.GradientPaint;
import java.awt.Paint;</BUG>
import java.util.HashMap;
import java.util.Set;
import org.goai.classification.eval.ClassificationResultByClass;
| [DELETED] |
25,743 | Client c = connection.getESLClient();
log.info("HeartbeatMonitor did not get a heartbeat event in time... reconnecting");
if(c.canSend()) { //Otherwise disconnect will throw ISE
log.info("Logging off fom [" + connection.toString() + "]");
connection.disconnect();
<BUG>}
log.info("Logging in as [" + connection.getPasswo... | log.info("Logging in as [" + connection.getPassword() + "] to [" + connection.getHostname() + ":" + connection.getPort() + "]");
|
25,744 | result.put("stop-recording", ESL_ACTION_STOP_RECORDING);
return Collections.unmodifiableMap(result);
}
@Override
public void startup() {
<BUG>Client c = manager.getESLClient();
c.addEventListener( this );</BUG>
c.cancelEventSubscriptions();
c.setEventSubscriptions( "plain", "all" );
c.addEventFilter( "Event-Name", "hea... | if (c.canSend()) {
c.addEventListener( this );
|
25,745 | c.addEventFilter( "Event-Name", "background_job" );
try {
Thread.sleep(5000);
} catch (InterruptedException ex) {
java.util.logging.Logger.getLogger(FreeswitchApplication.class.getName()).log(Level.SEVERE, null, ex);
<BUG>}
if(heartbeatMonitor == null) { //Only startup once. as startup will be called for reconnect.</BU... | startHeartbeatMonitor();
private void startHeartbeatMonitor() {
if(heartbeatMonitor == null) { //Only startup once. as startup will be called for reconnect.
|
25,746 | import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import java.math.BigInteger;
import java.util.ArrayList;
<BUG>import java.util.Collection;
import static com.n1analytics.paillier.TestConfiguration.CONFIGURATIONS;</BUG>
import static com.n1analyt... | import java.util.Random;
import static com.n1analytics.paillier.TestConfiguration.CONFIGURATIONS;
|
25,747 | @RunWith(Parameterized.class)
@Category(SlowTests.class)
public class AdditionTest {
private PaillierContext context;
private PaillierPrivateKey privateKey;
<BUG>static private int maxIteration = 100;
@Parameterized.Parameters</BUG>
public static Collection<Object[]> configurations() {
Collection<Object[]> configuratio... | static private int MAX_ITERATIONS = TestConfiguration.MAX_ITERATIONS;
@Parameterized.Parameters
|
25,748 | }
}};
BinaryAdder4 binaryAdders4[] = new BinaryAdder4[]{new BinaryAdder4() {</BUG>
@Override
public EncodedNumber eval(EncodedNumber arg1, EncodedNumber arg2) {
return arg1.add(arg2);
}
<BUG>}, new BinaryAdder4() {
@Override</BUG>
public EncodedNumber eval(EncodedNumber arg1, EncodedNumber arg2) {
| }, new EncodedToEncodedAdder() {
return arg2.add(arg1);
|
25,749 | return context.add(arg2, arg1);
}
}};
<BUG>void testDoubleAddition(BinaryAdder1 adder) {
double a, b, plainResult, decodedResult, tolerance;
EncryptedNumber ciphertTextA, ciphertTextB, encryptedResult;
EncodedNumber decryptedResult;
for(int i = 0; i < maxIteration; i++) {
a = randomFiniteDouble();</BUG>
b = randomFini... | @Test
public void testDoubleAddition() {
EncryptedNumber cipherTextA, cipherTextA_obf, cipherTextB, cipherTextB_obf, encryptedResult;
EncodedNumber encodedA, encodedB, encodedResult, decryptedResult;
Random rnd = new Random();
int maxExponentDiff = (int)(0.5 * context.getPublicKey().getModulus().bitLength() / (Math.log... |
25,750 | @RunWith(Parameterized.class)
@Category(SlowTests.class)
public class DivisionTest {
private PaillierContext context;
private PaillierPrivateKey privateKey;
<BUG>static private int maxIteration = 100;
@Parameters</BUG>
public static Collection<Object[]> configurations() {
Collection<Object[]> configurationParams = new ... | static private int maxIteration = TestConfiguration.MAX_ITERATIONS;
@Parameters
|
25,751 | import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.security.DigestOutputStream;
import java.security.MessageDigest;
<BUG>import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;</BUG>
public final class ... | import java.text.DateFormat;
import java.util.Date;
import java.util.List;
|
25,752 | 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;
|
25,753 | private static final String PATH_DELIMITER = "/";
public static final byte[] NO_CONTENT = PatchingTask.NO_CONTENT;
enum Element {
ADDED_BUNDLE("added-bundle"),
ADDED_MISC_CONTENT("added-misc-content"),
<BUG>ADDED_MODULE("added-module"),
BUNDLES("bundles"),</BUG>
CUMULATIVE("cumulative"),
DESCRIPTION("description"),
MIS... | APPLIES_TO_VERSION("applies-to-version"),
BUNDLES("bundles"),
|
25,754 | final int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
final String value = reader.getAttributeValue(i);
final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
<BUG>case APPLIES_TO_VERSION:
builder.addAppliesTo(value);
break;</BUG>
case RESULTING_VE... | [DELETED] |
25,755 | final StringBuilder path = new StringBuilder();
for(final String p : item.getPath()) {
path.append(p).append(PATH_DELIMITER);
}
path.append(item.getName());
<BUG>writer.writeAttribute(Attribute.PATH.name, path.toString());
if(type != ModificationType.REMOVE) {</BUG>
writer.writeAttribute(Attribute.HASH.name, bytesToHex... | if (item.isDirectory()) {
writer.writeAttribute(Attribute.DIRECTORY.name, "true");
if(type != ModificationType.REMOVE) {
|
25,756 | package org.jboss.as.patching;
import org.jboss.as.controller.OperationFailedException;
import org.jboss.as.patching.runner.PatchingException;
import org.jboss.logging.Messages;
import org.jboss.logging.annotations.Message;
<BUG>import org.jboss.logging.annotations.MessageBundle;
import java.io.IOException;</BUG>
impor... | import org.jboss.logging.annotations.Cause;
import java.io.IOException;
|
25,757 | super(project, value, viewSettings);
}
@Override
protected AbstractTreeNode createModuleNode(Module module)
throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
<BUG>return createTreeNode(PackageViewModuleNode.class, module.getProject(), module, getSettings());
</BUG... | public PackageViewModuleGroupNode(final Project project, final ModuleGroup value, final ViewSettings viewSettings) {
return new PackageViewModuleNode(module.getProject(), module, getSettings());
|
25,758 | }
@RootTask
static Task<Exec.Result> exec(String parameter, int number) {
Task<String> task1 = MyTask.create(parameter);
Task<Integer> task2 = Adder.create(number, number + 2);
<BUG>return Task.ofType(Exec.Result.class).named("exec", "/bin/sh")
.in(() -> task1)</BUG>
.in(() -> task2)
.process(Exec.exec((str, i) -> args... | return Task.named("exec", "/bin/sh").ofType(Exec.Result.class)
.in(() -> task1)
|
25,759 | return args;
}
static class MyTask {
static final int PLUS = 10;
static Task<String> create(String parameter) {
<BUG>return Task.ofType(String.class).named("MyTask", parameter)
.in(() -> Adder.create(parameter.length(), PLUS))</BUG>
.in(() -> Fib.create(parameter.length()))
.process((sum, fib) -> something(parameter, s... | return Task.named("MyTask", parameter).ofType(String.class)
.in(() -> Adder.create(parameter.length(), PLUS))
|
25,760 | final String instanceField = "from instance";
final TaskContext context = TaskContext.inmem();
final AwaitingConsumer<String> val = new AwaitingConsumer<>();
@Test
public void shouldJavaUtilSerialize() throws Exception {
<BUG>Task<Long> task1 = Task.ofType(Long.class).named("Foo", "Bar", 39)
.process(() -> 9999L);
Task... | Task<Long> task1 = Task.named("Foo", "Bar", 39).ofType(Long.class)
Task<String> task2 = Task.named("Baz", 40).ofType(String.class)
.in(() -> task1)
|
25,761 | assertEquals(des.id().name(), "Baz");
assertEquals(val.awaitAndGet(), "[9999] hello 10004");
}
@Test(expected = NotSerializableException.class)
public void shouldNotSerializeWithInstanceFieldReference() throws Exception {
<BUG>Task<String> task = Task.ofType(String.class).named("WithRef")
.process(() -> instanceField +... | Task<String> task = Task.named("WithRef").ofType(String.class)
.process(() -> instanceField + " causes an outer reference");
|
25,762 | serialize(task);
}
@Test
public void shouldSerializeWithLocalReference() throws Exception {
String local = instanceField;
<BUG>Task<String> task = Task.ofType(String.class).named("WithLocalRef")
.process(() -> local + " won't cause an outer reference");</BUG>
serialize(task);
Task<String> des = deserialize();
context.e... | Task<String> task = Task.named("WithLocalRef").ofType(String.class)
.process(() -> local + " won't cause an outer reference");
|
25,763 | }
@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);
|
25,764 | 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);
|
25,765 | 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);
|
25,766 | TaskContext taskContext = TaskContext.inmem();
TaskContext.Value<Long> value = taskContext.evaluate(fib92);
value.consume(f92 -> System.out.println("fib(92) = " + f92));
}
static Task<Long> create(long n) {
<BUG>TaskBuilder<Long> fib = Task.ofType(Long.class).named("Fib", n);
</BUG>
if (n < 2) {
return fib
.process(() ... | TaskBuilder<Long> fib = Task.named("Fib", n).ofType(Long.class);
|
25,767 | package org.apache.camel.itest.springboot;
import java.io.InputStream;
<BUG>import java.util.Optional;
import java.util.Properties;</BUG>
public class ITestConfigBuilder {
private static final String PROPERTIES_FILE = "/spring-boot-itest.properties";
| import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Properties;
|
25,768 | return config;
}
private void fail(String msg) {
throw new IllegalStateException("Configuration is not complete: " + msg);
}
<BUG>private Optional<String> property(String name) {
if (properties == null) {</BUG>
properties = new Properties();
try {
InputStream in = getClass().getResourceAsStream(PROPERTIES_FILE);
| private String propertyOr(String name, String defaultVal) {
if (properties == null) {
|
25,769 | properties.load(in);
} catch (Exception e) {
throw new IllegalStateException("Unable to load property file: " + PROPERTIES_FILE, e);
}
}
<BUG>return Optional.ofNullable(properties.getProperty(name));
}
private Optional<Boolean> booleanProperty(String name) {
return property(name).map(Boolean::valueOf);
}</BUG>
}
| [DELETED] |
25,770 | public static Archive<?> createSpringBootPackage() throws Exception {
return ArquillianPackager.springBootPackage(createTestConfig());
}
public static ITestConfig createTestConfig() {
return new ITestConfigBuilder()
<BUG>.module(inferModuleName(CamelSalesforceTest.class))
.build();</BUG>
}
@Test
public void componentTe... | .autostart(false) // needs configuration
.build();
|
25,771 | package org.apache.camel.itest.springboot.command;
import java.net.URL;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
<BUG>import java.util.List;
import java.util.regex.Pattern;
import java.util.stream.Collectors;</BUG>
import org.apache.camel.CamelContext;
import org.apache.camel.... | import java.util.Set;
|
25,772 | import org.junit.runner.JUnitCore;
import org.junit.runner.Result;
import org.junit.runner.notification.Failure;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
<BUG>import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.ClassPathScanningCandidateComponentP... | import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider;
|
25,773 | logger.info("Spring-Boot test configuration {}", config);
Pattern pattern = Pattern.compile(config.getUnitTestInclusionPattern());
logger.info("Scaning the classpath for test classes");
ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(false);
scanner.addIncludeFilter... | Set<BeanDefinition> defs = scanner.findCandidateComponents(config.getUnitTestBasePackage());
List<String> testClasses = new LinkedList<>();
for (BeanDefinition bd : defs) {
testClasses.add(bd.getBeanClassName());
}
if (config.getUnitTestExclusionPattern() != null) {
|
25,774 | public static Archive<?> createSpringBootPackage() throws Exception {
return ArquillianPackager.springBootPackage(createTestConfig());
}
public static ITestConfig createTestConfig() {
return new ITestConfigBuilder()
<BUG>.module(inferModuleName(CamelMybatisTest.class))
.build();</BUG>
}
@Test
public void componentTests... | .resource("components/mybatis-SqlMapConfig.xml", "SqlMapConfig.xml")
.build();
|
25,775 | public static Archive<?> createSpringBootPackage() throws Exception {
return ArquillianPackager.springBootPackage(createTestConfig());
}
public static ITestConfig createTestConfig() {
return new ITestConfigBuilder()
<BUG>.module(inferModuleName(CamelBoxTest.class))
.build();</BUG>
}
@Test
public void componentTests() t... | .autostart(false) // needs configuration
.build();
|
25,776 | import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.Archive;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(Arquillian.class)
<BUG>public class CamelKubernetesTest extends AbstractSpringBootTestSupport {
@Deployment</BUG>
public static Archive<?> createSpringBootPackage() thr... | private static final String HIBERNATE_VALIDATOR_VERSION = System.getProperty("hibernateValidatorVersion", "5.2.4.Final");
@Deployment
|
25,777 | public static Archive<?> createSpringBootPackage() throws Exception {
return ArquillianPackager.springBootPackage(createTestConfig());
}
public static ITestConfig createTestConfig() {
return new ITestConfigBuilder()
<BUG>.module(inferModuleName(CamelKubernetesTest.class))
.build();</BUG>
}
@Test
public void componentTe... | .dependency("org.hibernate:hibernate-validator:" + HIBERNATE_VALIDATOR_VERSION)
.build();
|
25,778 | @Autowired
private CamelContext context;
@Override
public Boolean executeTest(ITestConfig config, String component) throws Exception {
logger.info("Getting Camel component: {}", component);
<BUG>org.apache.camel.Component comp = context.getComponent(component, true, false);
</BUG>
assertNotNull("Cannot get module with ... | org.apache.camel.Component comp = context.getComponent(component, true, config.getAutoStartComponent());
|
25,779 | package org.apache.camel.itest.springboot;
<BUG>import java.io.Serializable;
public class ITestConfig implements Serializable {</BUG>
private static final long serialVersionUID = -3641997669166217595L;
private String moduleName;
private String mavenGroup;
| import java.util.Map;
import java.util.Set;
public class ITestConfig implements Serializable {
|
25,780 | public static Archive<?> createSpringBootPackage() throws Exception {
return ArquillianPackager.springBootPackage(createTestConfig());
}
public static ITestConfig createTestConfig() {
return new ITestConfigBuilder()
<BUG>.module(inferModuleName(CamelIbatisTest.class))
.build();</BUG>
}
@Test
public void componentTests(... | .resource("components/ibatis-SqlMapConfig.xml", "SqlMapConfig.xml")
.build();
|
25,781 | package org.semanticweb.owlapitools.builders;
import javax.inject.Inject;
import org.semanticweb.owlapi.model.OWLDataFactory;
import org.semanticweb.owlapi.model.OWLFunctionalObjectPropertyAxiom;
<BUG>public class BuilderFunctionalObjectProperty
extends BaseObjectPropertyBuilder<OWLFunctionalObjectPropertyAxiom, Build... | import static org.semanticweb.owlapi.util.OWLAPIPreconditions.verifyNotNull;
public class BuilderFunctionalObjectProperty extends
public BuilderFunctionalObjectProperty(OWLFunctionalObjectPropertyAxiom expected, OWLDataFactory df) {
|
25,782 | subject = arg;
return this;
}
@Override
public OWLNegativeObjectPropertyAssertionAxiom buildObject() {
<BUG>return df.getOWLNegativeObjectPropertyAssertionAxiom(getProperty(), getSubject(), getValue(), annotations);
}
public OWLIndividual getSubject() {
return verifyNotNull(subject);
}
public OWLIndividual getValue() {... | return df.getOWLNegativeObjectPropertyAssertionAxiom(verifyNotNull(getProperty()), verifyNotNull(subject),
verifyNotNull(value), annotations);
@Nullable
return subject;
@Nullable
|
25,783 | import javax.annotation.Nullable;
import javax.inject.Inject;
import org.semanticweb.owlapi.model.OWLDataFactory;
import org.semanticweb.owlapi.model.OWLInverseObjectPropertiesAxiom;
import org.semanticweb.owlapi.model.OWLObjectPropertyExpression;
<BUG>public class BuilderInverseObjectProperties
extends BaseObjectProp... | public class BuilderInverseObjectProperties extends
@Nullable private OWLObjectPropertyExpression inverseProperty = null;
|
25,784 |
extends BaseObjectPropertyBuilder<OWLInverseObjectPropertiesAxiom, BuilderInverseObjectProperties> {
@Nullable private OWLObjectPropertyExpression inverseProperty = null;</BUG>
public BuilderInverseObjectProperties(OWLInverseObjectPropertiesAxiom expected, OWLDataFactory df) {
this(df);
<BUG>withProperty(expected.getF... | import javax.annotation.Nullable;
import javax.inject.Inject;
import org.semanticweb.owlapi.model.OWLDataFactory;
import org.semanticweb.owlapi.model.OWLInverseObjectPropertiesAxiom;
import org.semanticweb.owlapi.model.OWLObjectPropertyExpression;
public class BuilderInverseObjectProperties extends
@Nullable private OW... |
25,785 | inverseProperty = arg;
return this;
}
@Override
public OWLInverseObjectPropertiesAxiom buildObject() {
<BUG>return df.getOWLInverseObjectPropertiesAxiom(getProperty(), getInverse(), annotations);
</BUG>
}
public OWLObjectPropertyExpression getInverse() {
return verifyNotNull(inverseProperty);
| return df.getOWLInverseObjectPropertiesAxiom(verifyNotNull(getProperty()), getInverse(), annotations);
|
25,786 | import javax.inject.Inject;
import org.semanticweb.owlapi.model.OWLClass;
import org.semanticweb.owlapi.model.OWLClassExpression;
import org.semanticweb.owlapi.model.OWLDataFactory;
import org.semanticweb.owlapi.model.OWLDisjointUnionAxiom;
<BUG>public class BuilderDisjointUnion
extends BaseSetBuilder<OWLDisjointUnion... | public class BuilderDisjointUnion extends
@Nullable private OWLClass ce = null;
|
25,787 |
extends BaseSetBuilder<OWLDisjointUnionAxiom, BuilderDisjointUnion, OWLClassExpression> {
@Nullable private OWLClass ce = null;</BUG>
public BuilderDisjointUnion(OWLDisjointUnionAxiom expected, OWLDataFactory df) {
this(df);
<BUG>withClass(expected.getOWLClass()).withItems(expected.classExpressions())
.withAnnotation... | import javax.inject.Inject;
import org.semanticweb.owlapi.model.OWLClass;
import org.semanticweb.owlapi.model.OWLClassExpression;
import org.semanticweb.owlapi.model.OWLDataFactory;
import org.semanticweb.owlapi.model.OWLDisjointUnionAxiom;
public class BuilderDisjointUnion extends
@Nullable private OWLClass ce = null;... |
25,788 | import org.semanticweb.owlapi.model.OWLAnnotationAssertionAxiom;</BUG>
import org.semanticweb.owlapi.model.OWLAnnotationSubject;
import org.semanticweb.owlapi.model.OWLAnnotationValue;
import org.semanticweb.owlapi.model.OWLDataFactory;
<BUG>public class BuilderAnnotationAssertion
extends BaseAnnotationPropertyBuilder... | package org.semanticweb.owlapitools.builders;
import static org.semanticweb.owlapi.util.OWLAPIPreconditions.verifyNotNull;
import javax.annotation.Nullable;
import javax.inject.Inject;
import org.semanticweb.owlapi.model.HasIRI;
import org.semanticweb.owlapi.model.OWLAnnotationAssertionAxiom;
public class BuilderAnnota... |
25,789 | .withValue(expected.getValue());
}
public BuilderAnnotationAssertion withSubject(OWLAnnotationSubject arg) {
subject = arg;
return this;
<BUG>}
public BuilderAnnotationAssertion withValue(OWLAnnotationValue arg) {</BUG>
value = arg;
return this;
}
| public BuilderAnnotationAssertion withSubject(HasIRI arg) {
subject = arg.getIRI();
public BuilderAnnotationAssertion withValue(OWLAnnotationValue arg) {
|
25,790 | package org.semanticweb.owlapitools.builders;
import javax.inject.Inject;
import org.semanticweb.owlapi.model.OWLDataFactory;
import org.semanticweb.owlapi.model.OWLIrreflexiveObjectPropertyAxiom;
<BUG>public class BuilderIrreflexiveObjectProperty
extends BaseObjectPropertyBuilder<OWLIrreflexiveObjectPropertyAxiom, Bu... | import static org.semanticweb.owlapi.util.OWLAPIPreconditions.verifyNotNull;
public class BuilderIrreflexiveObjectProperty extends
public BuilderIrreflexiveObjectProperty(OWLIrreflexiveObjectPropertyAxiom expected, OWLDataFactory df) {
|
25,791 | package org.semanticweb.owlapitools.builders;
import javax.inject.Inject;
import org.semanticweb.owlapi.model.OWLAsymmetricObjectPropertyAxiom;
import org.semanticweb.owlapi.model.OWLDataFactory;
<BUG>public class BuilderAsymmetricObjectProperty
extends BaseObjectPropertyBuilder<OWLAsymmetricObjectPropertyAxiom, Build... | import static org.semanticweb.owlapi.util.OWLAPIPreconditions.verifyNotNull;
public class BuilderAsymmetricObjectProperty extends
@Inject
|
25,792 | }
public OWLDataRange getRange() {
return verifyNotNull(range);
<BUG>}
public OWLDatatype getType() {
return verifyNotNull(type);
}</BUG>
}
| public BuilderDatatypeDefinition withType(OWLDataRange arg) {
range = arg;
return this;
|
25,793 | import android.widget.Toast;
import com.couchbase.lite.CouchbaseLiteException;
import com.couchbase.lite.Document;
import com.couchbase.lite.util.Log;
import com.couchbase.todolite.document.List;
<BUG>import com.couchbase.todolite.document.Profile;
import com.facebook.Request;</BUG>
import com.facebook.Response;
import... | import com.couchbase.todolite.preferences.ToDoLitePreferences;
import com.facebook.Request;
|
25,794 | onSessionStateChange(session, state, exception);
}
};
private void onSessionStateChange(final Session session, SessionState state, Exception exception) {
if (state.isOpened()) {
<BUG>final Application application = (Application) getApplication();
if (application.getCurrentUserId() == null) {
</BUG>
Request.newMeRequest... | if (preferences.getCurrentUserId() == null) {
|
25,795 | try {
profile = Profile.getUserProfileById(application.getDatabase(), userId);
if (profile == null)
profile = Profile.createProfile(application.getDatabase(), userId, name);
application.migrateGuestDataToUser(profile);
<BUG>application.setGuestBoolean(false);
</BUG>
} catch (CouchbaseLiteException e) { }
try {
List.ass... | preferences.setGuestBoolean(false);
|
25,796 | } catch (CouchbaseLiteException e) { }
try {
List.assignOwnerToListsIfNeeded(application.getDatabase(), profile);
} catch (CouchbaseLiteException e) { }
Toast.makeText(LoginActivity.this, "Login successful! Starting sync.", Toast.LENGTH_LONG).show();
<BUG>application.setCurrentUserId(userId);
application.setLastRecei... | preferences.setCurrentUserId(userId);
preferences.setLastReceivedFbAccessToken(session.getAccessToken());
|
25,797 | try {
String value = input.getText().toString();
StringTokenizer st = new StringTokenizer(value, ":");
String username = st.nextToken();
String password = st.nextToken();
<BUG>Application application = (Application) getApplication();
application.setCurrentUserId(username);
application.setCurrentUserPassword(password);... | List.assignOwnerToListsIfNeeded(application.getDatabase(), profile);
} catch (CouchbaseLiteException e) { }
Toast.makeText(LoginActivity.this, "Login successful! Starting sync.", Toast.LENGTH_LONG).show();
preferences.setCurrentUserId(userId);
preferences.setLastReceivedFbAccessToken(session.getAccessToken());
|
25,798 | input.setText(hardcodedFakeCookie);
alert.setView(input);
alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
String value = input.getText().toString();
<BUG>Application application = (Application) getApplication();
application.setCurrentU... | preferences.setCurrentUserId(value);
|
25,799 | import com.couchbase.lite.QueryRow;
import com.couchbase.lite.SavedRevision;
import com.couchbase.lite.UnsavedRevision;
import com.couchbase.lite.android.AndroidContext;
import com.couchbase.lite.replicator.Replication;
<BUG>import com.couchbase.lite.util.Log;
import com.facebook.Session;</BUG>
import org.apache.http.c... | import com.couchbase.todolite.preferences.ToDoLitePreferences;
import com.facebook.Session;
|
25,800 | private static final String DATABASE_NAME = "todos";
private static final String GUEST_DATABASE_NAME = "guest";
private static final String SYNC_URL_HTTP = BuildConfig.SYNC_URL_HTTP;
private static final String SYNC_URL_HTTPS = BuildConfig.SYNC_URL_HTTPS;
private static final String SYNC_URL = SYNC_URL_HTTP;
<BUG>priva... | [DELETED] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.