id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
39,501
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) {
39,502
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;
39,503
package com.projecttango.examples.java.augmentedreality; import com.google.atap.tangoservice.Tango; import com.google.atap.tangoservice.Tango.OnTangoUpdateListener; import com.google.atap.tangoservice.TangoCameraIntrinsics; import com.google.atap.tangoservice.TangoConfig; <BUG>import com.google.atap.tangoservice.TangoCoordinateFramePair; import com.google.atap.tangoservice.TangoEvent;</BUG> import com.google.atap.tangoservice.TangoOutOfDateException; import com.google.atap.tangoservice.TangoPoseData; import com.google.atap.tangoservice.TangoXyzIjData;
import com.google.atap.tangoservice.TangoErrorException; import com.google.atap.tangoservice.TangoEvent;
39,504
super.onResume(); if (!mIsConnected) { mTango = new Tango(AugmentedRealityActivity.this, new Runnable() { @Override public void run() { <BUG>try { connectTango();</BUG> setupRenderer(); mIsConnected = true; } catch (TangoOutOfDateException e) {
TangoSupport.initialize(); connectTango();
39,505
if (lastFramePose.statusCode == TangoPoseData.POSE_VALID) { mRenderer.updateRenderCameraPose(lastFramePose, mExtrinsics); mCameraPoseTimestamp = lastFramePose.timestamp;</BUG> } else { <BUG>Log.w(TAG, "Can't get device pose at time: " + mRgbTimestampGlThread); }</BUG> } } } @Override
mRenderer.updateRenderCameraPose(lastFramePose); mCameraPoseTimestamp = lastFramePose.timestamp; Log.w(TAG, "Can't get device pose at time: " +
39,506
package com.projecttango.examples.java.helloareadescription; import com.google.atap.tangoservice.Tango; <BUG>import com.google.atap.tangoservice.Tango.OnTangoUpdateListener; import com.google.atap.tangoservice.TangoConfig;</BUG> import com.google.atap.tangoservice.TangoCoordinateFramePair; import com.google.atap.tangoservice.TangoErrorException; import com.google.atap.tangoservice.TangoEvent;
import com.google.atap.tangoservice.TangoAreaDescriptionMetaData; import com.google.atap.tangoservice.TangoConfig;
39,507
"Every message on a single channel must specify the same requirement for response ordering"); } } private void processRequest( final ChannelHandlerContext ctx, <BUG>final ThriftMessage message) { final int requestSequenceId = dispatcherSequenceId.incrementAndGet();</BUG> synchronized (responseMap) {
final ThriftMessage message, final TNiftyTransport messageTransport, final TProtocol inProtocol, final TProtocol outProtocol) { final int requestSequenceId = dispatcherSequenceId.incrementAndGet();
39,508
@Override public void run() { ListenableFuture<Boolean> processFuture; final AtomicBoolean responseSent = new AtomicBoolean(false); <BUG>final TTransportPair transportPair = DispatcherContext.getTransportPair(ctx); TProtocolPair protocolPair = DispatcherContext.getProtocolPair(ctx);</BUG> try { try { long timeRemaining = 0;
[DELETED]
39,509
TApplicationException taskTimeoutException = new TApplicationException( TApplicationException.INTERNAL_ERROR, "Task stayed on the queue for " + timeElapsed + " milliseconds, exceeding configured task timeout of " + taskTimeoutMillis + " milliseconds."); <BUG>sendTApplicationException(taskTimeoutException, ctx, message); return;</BUG> } else { timeRemaining = taskTimeoutMillis - timeElapsed;
sendTApplicationException(taskTimeoutException, ctx, message, messageTransport, inProtocol, outProtocol); return;
39,510
package com.facebook.nifty.core; <BUG>import com.facebook.nifty.duplex.TProtocolPair; import com.facebook.nifty.duplex.TTransportPair;</BUG> import org.apache.thrift.protocol.TProtocol; public class NiftyRequestContext implements RequestContext {
[DELETED]
39,511
import com.facebook.nifty.duplex.TTransportPair;</BUG> import org.apache.thrift.protocol.TProtocol; public class NiftyRequestContext implements RequestContext { private final ConnectionContext connectionContext; <BUG>private final TTransportPair transportPair; private final TProtocolPair protocolPair; @Override</BUG> public TProtocol getInputProtocol()
package com.facebook.nifty.core; private final TProtocol inputProtocol; private final TProtocol outputProtocol; private final TNiftyTransport niftyTransport; @Override
39,512
assertIn(ctx.op, t2, t1); return new Packings(t1, t2); case CstrSpecParser.NOT_PART: assertIn(ctx.op, t2, t1); return new NoPackings(t1, t2); <BUG>} throw SpecException.unsupportedOperation(filename, t1.type(), ctx.op, t2.type()); }</BUG> @Override public Term visitTermOp(@NotNull CstrSpecParser.TermOpContext ctx) {
default:
39,513
import org.btrplace.safeplace.spec.Constraint; import org.btrplace.safeplace.testing.fuzzer.DefaultReconfigurationPlanFuzzer; import org.btrplace.safeplace.testing.fuzzer.DefaultTestCaseFuzzer; import org.btrplace.safeplace.testing.fuzzer.TestCaseFuzzer; import org.btrplace.safeplace.testing.limit.RunnerLimit; <BUG>import org.btrplace.safeplace.testing.reporting.DefaultReporting; import org.btrplace.safeplace.testing.reporting.Reporting; import org.btrplace.safeplace.testing.verification.Verifier;</BUG> import org.btrplace.safeplace.testing.verification.VerifierResult;
import org.btrplace.safeplace.testing.reporting.Counting; import org.btrplace.safeplace.testing.reporting.Report; import org.btrplace.safeplace.testing.verification.Verifier;
39,514
this.cstrs = cstrs; cores = cstrs.stream().filter(c -> c.args().isEmpty()).collect(Collectors.toList()); params = new DefaultParameters(); params.getMapper().mapConstraint(Schedule.class, CSchedule.class); oracle = new SpecVerifier(); <BUG>reporting = new DefaultReporting(); }</BUG> public TestCampaign schedulerParams(Parameters ps) { params = ps; return this;
report = new Counting(); }
39,515
public Verifier verifyWith() { return oracle; } public RunnerLimit limits() { return limits; <BUG>} public int go() { TestCaseResult res; try {</BUG> store("[\n");
@SuppressWarnings("squid:S106") public Report go() { int nb = 1; try {
39,516
TestCase tc = tcFuzzer.get(); if (tc == null) { break; } if (first) { <BUG>reporting.start(tc.constraint()); first = false;</BUG> } try { if (writer != null) {
System.out.println(tc.constraint().signatureToString()); first = false;
39,517
writer.flush(); } catch (IOException e) { throw new IllegalArgumentException(e); } } <BUG>public Reporting reporting() { return reporting; } public TestCampaign reporting(Reporting r) { reporting = r; return this;</BUG> }
public Report reporting() { return report; public TestCampaign reporting(Report r) { report = r; return this;
39,518
checkConsistency(plan, tc); } catch (RuntimeException e) { return new TestCaseResult(tc, e, res); } return new TestCaseResult(tc, sched.getStatistics(), res); <BUG>} private void checkConsistency(ReconfigurationPlan got, TestCase tc) {</BUG> if (got != null && !tc.plan().equals(got)) { String output = "--- Instance" + tc.instance().getSatConstraints().stream().map(SatConstraint::toString).collect(Collectors.joining("\n\t", "\t", ""))
public TestCampaign printProgress(boolean b) { printProgress = b; return this; private void checkConsistency(ReconfigurationPlan got, TestCase tc) {
39,519
import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; import org.apache.solr.common.SolrInputDocument; import org.apache.solr.common.params.MapSolrParams; <BUG>import org.apache.solr.common.util.DateUtil; import org.apache.solr.handler.extraction.SolrContentHandler;</BUG> import org.apache.solr.schema.IndexSchema; import org.apache.tika.metadata.Metadata; import org.junit.Before;
import org.apache.solr.handler.extraction.ExtractionDateUtil; import org.apache.solr.handler.extraction.SolrContentHandler;
39,520
String fieldName = "user_name"; assertFalse("foobar".equals(getFoobarWithNonChars())); Metadata metadata = new Metadata(); metadata.set(fieldName, getFoobarWithNonChars()); StripNonCharSolrContentHandlerFactory contentHandlerFactory = <BUG>new StripNonCharSolrContentHandlerFactory(DateUtil.DEFAULT_DATE_FORMATS); </BUG> IndexSchema schema = h.getCore().getLatestSchema(); SolrContentHandler contentHandler = contentHandlerFactory.createSolrContentHandler(metadata, new MapSolrParams(new HashMap()), schema);
new StripNonCharSolrContentHandlerFactory(ExtractionDateUtil.DEFAULT_DATE_FORMATS);
39,521
import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; import java.util.regex.Pattern; import org.apache.commons.lang.exception.ExceptionUtils; import org.apache.solr.client.solrj.SolrRequest; <BUG>import org.apache.solr.client.solrj.SolrServer; </BUG> import org.apache.solr.client.solrj.SolrServerException; import org.apache.solr.client.solrj.beans.DocumentObjectBinder; import org.apache.solr.client.solrj.request.QueryRequest;
import org.apache.solr.client.solrj.SolrClient;
39,522
import org.apache.solr.client.solrj.request.QueryRequest; import org.apache.solr.common.util.NamedList; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.google.common.annotations.VisibleForTesting; <BUG>public class RetryingSolrServer extends SolrServer { private final SolrServer solrServer; </BUG> private final RetryPolicyFactory retryPolicyFactory;
public class RetryingSolrServer extends SolrClient { private final SolrClient solrServer;
39,523
private static final Pattern COLLECTION_AND_SLICE_PATTERN = Pattern.compile( "(collection: \\S+ slice: shard)\\d+"); private static final Pattern NOW_TIMESTAMP_PATTERN = Pattern.compile( "(NOW=)\\d+"); // part of Solr query params private static final Logger LOG = LoggerFactory.getLogger(RetryingSolrServer.class); <BUG>public RetryingSolrServer(SolrServer solrServer, </BUG> RetryPolicyFactory retryPolicyFactory, MetricsFacade metrics) { if (solrServer == null) {
public RetryingSolrServer(SolrClient solrServer,
39,524
if (metrics == null) { metrics = new NullMetricsFacade(); } this.metrics = metrics; } <BUG>public final SolrServer getUnderlyingSolrServer() { </BUG> return solrServer; } protected final MetricsFacade getMetrics() {
public final SolrClient getUnderlyingSolrServer() {
39,525
; // ignore } final long lastStartTime = System.nanoTime(); NamedList response; try { <BUG>response = solrServer.request(request); </BUG> } catch (Exception exception) { long requestDuration = System.nanoTime() - lastStartTime; String exceptionTopLevelMsg = limitStringLength(getExceptionKey(exception));
response = solrServer.request(request, collection);
39,526
package org.apache.solr.client.solrj.retry; import java.util.concurrent.TimeUnit; import org.apache.solr.client.solrj.SolrRequest; <BUG>import org.apache.solr.client.solrj.SolrServer; </BUG> import org.apache.solr.common.SolrException; import org.apache.solr.common.SolrException.ErrorCode; public final class DefaultRetryPolicyFactory implements RetryPolicyFactory {
import org.apache.solr.client.solrj.SolrClient;
39,527
} public DefaultRetryPolicyFactory(RetryPolicy initialRetryPolicy) { this.initialRetryPolicy = initialRetryPolicy; } @Override <BUG>public RetryPolicy getRetryPolicy(Throwable exception, SolrRequest request, SolrServer server, </BUG> RetryPolicy currentPolicy) { if (exception instanceof SolrException) { SolrException sex = (SolrException) exception;
public RetryPolicy getRetryPolicy(Throwable exception, SolrRequest request, SolrClient server,
39,528
import java.util.TreeMap; import org.apache.solr.common.SolrInputDocument; import org.apache.solr.common.SolrInputField; import org.apache.solr.common.params.MultiMapSolrParams; import org.apache.solr.common.params.SolrParams; <BUG>import org.apache.solr.common.util.DateUtil; import org.apache.solr.handler.extraction.ExtractingParams; import org.apache.solr.handler.extraction.SolrContentHandler;</BUG> import org.apache.solr.handler.extraction.SolrContentHandlerFactory; import org.apache.solr.schema.IndexSchema;
import org.apache.solr.handler.extraction.ExtractionDateUtil; import org.apache.solr.handler.extraction.SolrContentHandler;
39,529
package org.apache.solr.client.solrj.retry; import org.apache.solr.client.solrj.SolrRequest; <BUG>import org.apache.solr.client.solrj.SolrServer; </BUG> public interface RetryPolicyFactory { public static final RetryPolicy DONT_RETRY = null; public RetryPolicy getRetryPolicy(
import org.apache.solr.client.solrj.SolrClient;
39,530
import javax.xml.parsers.ParserConfigurationException; import org.apache.solr.client.solrj.SolrServer; </BUG> import org.apache.solr.client.solrj.embedded.EmbeddedSolrServer; <BUG>import org.apache.solr.client.solrj.impl.CloudSolrServer; import org.apache.solr.client.solrj.retry.MetricsFacade;</BUG> import org.apache.solr.client.solrj.retry.RetryPolicyFactory; import org.apache.solr.client.solrj.retry.RetryingSolrServer; import org.apache.solr.common.cloud.SolrZkClient;
import org.apache.solr.client.solrj.SolrClient; import org.apache.solr.client.solrj.impl.CloudSolrClient; import org.apache.solr.client.solrj.impl.CloudSolrClient.Builder; import org.apache.solr.client.solrj.retry.MetricsFacade;
39,531
zkClientSessionTimeout = configs.getInt(config, "zkClientSessionTimeout", zkClientSessionTimeout); zkClientConnectTimeout = configs.getInt(config, "zkClientConnectTimeout", zkClientConnectTimeout); LOG.trace("Constructed solrLocator: {}", this); configs.validateArguments(config); } <BUG>public SolrServer getSolrServer() { </BUG> if (zkHost != null && zkHost.length() > 0) { if (collectionName == null || collectionName.length() == 0) { throw new MorphlineCompilationException("Parameter 'zkHost' requires that you also pass parameter 'collection'", config);
public SolrClient getSolrServer() {
39,532
if (solrUrl == null || solrUrl.length() == 0) { throw new MorphlineCompilationException("Missing parameter 'solrUrl'", config); } int solrServerNumThreads = 2; int solrServerQueueLength = solrServerNumThreads; <BUG>SolrServer server = new SafeConcurrentUpdateSolrServer(solrUrl, solrServerQueueLength, solrServerNumThreads); </BUG> return server; } }
SolrClient server = new SafeConcurrentUpdateSolrServer(solrUrl, solrServerQueueLength, solrServerNumThreads);
39,533
zkClient.close(); } } LOG.debug("SolrLocator loading IndexSchema from dir {}", mySolrHomeDir); try { <BUG>SolrResourceLoader loader = new SolrResourceLoader(mySolrHomeDir); </BUG> SolrConfig solrConfig = new SolrConfig(loader, "solrconfig.xml", null); IndexSchema schema = IndexSchemaFactory.buildIndexSchema("schema.xml", solrConfig); validateSchema(schema);
SolrResourceLoader loader = new SolrResourceLoader(Paths.get(mySolrHomeDir));
39,534
package org.brutusin.rpc; import java.awt.Desktop; import java.io.File; <BUG>import java.io.IOException; import java.net.URI; import java.nio.file.Files;</BUG> import java.nio.file.Path; import java.util.logging.Level;
import java.io.InputStream; import java.nio.file.FileSystems; import java.nio.file.Files;
39,535
import org.apache.catalina.core.StandardContext; import org.apache.catalina.startup.Tomcat; import org.apache.catalina.webresources.DirResourceSet; import org.apache.catalina.webresources.EmptyResourceSet; import org.apache.catalina.webresources.StandardRoot; <BUG>import org.apache.tomcat.util.scan.Constants; import org.apache.tomcat.util.scan.StandardJarScanner;</BUG> import org.brutusin.rpc.actions.websocket.PublishAction; import org.brutusin.rpc.http.HttpAction; import org.brutusin.rpc.spi.ServerRuntime;
import org.apache.tomcat.util.scan.StandardJarScanFilter; import org.apache.tomcat.util.scan.StandardJarScanner;
39,536
e.printStackTrace(); } filePlayback=null; } @Override <BUG>public void stop() { if ( filePlayback!=null ) filePlayback.stop(); } void initFiles() throws FileNotFoundException {</BUG> if ((dataDir.length() != 0) && !dataDir.endsWith("/")) { dataDir = dataDir + "/"; } // guard path if needed String samples_str = dataDir + "samples"; String events_str = dataDir + "events";
@Override public boolean isrunning(){ if ( filePlayback!=null ) return filePlayback.isrunning(); return false; } void initFiles() throws FileNotFoundException {
39,537
public class BufferMonitor extends Thread implements FieldtripBufferMonitor { public static final String TAG = BufferMonitor.class.toString(); private final Context context; private final SparseArray<BufferConnectionInfo> clients = new SparseArray<BufferConnectionInfo>(); private final BufferInfo info; <BUG>private final BroadcastReceiver mMessageReceiver = new BroadcastReceiver() { @Override public void onReceive(final Context context, final Intent intent) { if (intent.getIntExtra(C.MESSAGE_TYPE, -1) == C.UPDATE_REQUEST) { Log.i(TAG, "Received update request."); sendAllInfo(); } } };</BUG> private boolean run = true;
[DELETED]
39,538
public static final String CLIENT_INFO_TIME = "c_time"; public static final String CLIENT_INFO_WAITTIMEOUT = "c_waitTimeout"; public static final String CLIENT_INFO_CONNECTED = "c_connected"; public static final String CLIENT_INFO_CHANGED = "c_changed"; public static final String CLIENT_INFO_DIFF = "c_diff"; <BUG>public static final int UPDATE_REQUEST = 0; </BUG> public static final int UPDATE = 1; public static final int REQUEST_PUT_HEADER = 2; public static final int REQUEST_FLUSH_HEADER = 3;
public static final int THREAD_INFO_TYPE = 0;
39,539
package nl.dcc.buffer_bci.bufferclientsservice; import android.os.Parcel; import android.os.Parcelable; <BUG>import nl.dcc.buffer_bci.bufferservicecontroller.C; public class ThreadInfo implements Parcelable {</BUG> public static final Creator<ThreadInfo> CREATOR = new Creator<ThreadInfo>() { @Override public ThreadInfo createFromParcel(final Parcel in) {
import nl.dcc.buffer_bci.C; public class ThreadInfo implements Parcelable {
39,540
import org.apache.bcel.classfile.*; import org.apache.bcel.generic.*; import java.util.*; public class FindInconsistentSync2 implements Detector { private static final boolean DEBUG = Boolean.getBoolean("fis.debug"); <BUG>private static final boolean SYNC_ACCESS = Boolean.getBoolean("fis.syncAccess"); private static final boolean ADJUST_SUBCLASS_ACCESSES = !Boolean.getBoolean("fis.noAdjustSubclass");</BUG> private static final boolean EVAL = Boolean.getBoolean("fis.eval"); private static final int MIN_SYNC_PERCENT = Integer.getInteger("findbugs.fis.minSyncPercent", 50).intValue();
private static final boolean SYNC_ACCESS = true; private static final boolean ADJUST_SUBCLASS_ACCESSES = !Boolean.getBoolean("fis.noAdjustSubclass");
39,541
Iterator<Method> i = publicReachableMethods.iterator(); while (i.hasNext()) { Method method = i.next(); if (classContext.getMethodGen(method) == null) continue; <BUG>if (isConstructor(method.getName())) continue;</BUG> if (method.getName().startsWith("access$")) continue; analyzeMethod(classContext, method, lockedMethodSet);
[DELETED]
39,542
private static boolean isConstructor(String methodName) { return methodName.equals("<init>") || methodName.equals("<clinit>") || methodName.equals("readObject") || methodName.equals("clone") <BUG>|| methodName.equals("close") || methodName.equals("finalize")</BUG> || methodName.equals("this"); } private void analyzeMethod(ClassContext classContext, Method method, Set<Method> lockedMethodSet)
|| methodName.equals("writeObject") || methodName.equals("init") || methodName.equals("initialize") || methodName.equals("dispose") || methodName.equals("finalize")
39,543
stats.addAccess(kind); if (isExplicitlyLocked && isLocal) stats.addLocalLock(); if (isGetterMethod && !isLocked) stats.addGetterMethodAccess(); <BUG>stats.addAccess(classContext, method, handle, isLocked); } catch (ClassNotFoundException e) {</BUG> bugReporter.reportMissingClass(e); } }
[DELETED]
39,544
boolean ret = programFile(getProgrammer(), sketchName); ctx.executeKey("upload.postcmd"); return ret; } public boolean performSerialReset(boolean dtr, boolean rts, int speed, int predelay, int delay, int postdelay) { <BUG>ctx.bullet("Resetting board."); </BUG> try { CommunicationPort port = ctx.getDevice(); if (port instanceof SerialCommunicationPort) {
if (!Base.isQuiet()) ctx.bullet("Resetting board.");
39,545
ArrayList<File>sketchObjects = compileSketch(); if(sketchObjects == null) { error("Failed compiling sketch"); return false; } <BUG>bullet("Compiling core..."); setCompilingProgress(20);</BUG> if(!compileCore()) { error("Failed compiling core"); return false;
if (!Base.isQuiet()) bullet("Compiling core..."); setCompilingProgress(20);
39,546
if(!compileCore()) { error("Failed compiling core"); return false; } setCompilingProgress(30); <BUG>bullet("Compiling libraries..."); </BUG> if(!compileLibraries()) { error("Failed compiling libraries"); return false;
if (!Base.isQuiet()) bullet("Compiling libraries...");
39,547
if(!compileLibraries()) { error("Failed compiling libraries"); return false; } setCompilingProgress(40); <BUG>bullet("Linking sketch..."); if(!compileLink(sketchObjects)) {</BUG> error("Failed linking sketch"); return false; }
if (!Base.isQuiet()) bullet("Linking sketch..."); if(!compileLink(sketchObjects)) {
39,548
editor.updateOutputTree(); } compileSize(); long endTime = System.currentTimeMillis(); double compileTime = (double)(endTime - startTime) / 1000d; <BUG>bullet("Compilation took " + compileTime + " seconds"); </BUG> ctx.executeKey("compile.postcmd"); return true; }
if (!Base.isQuiet()) bullet("Compilation took " + compileTime + " seconds");
39,549
return true; } public boolean compileSize() { PropertyFile props = ctx.getMerged(); if (props.get("compile.size") != null) { <BUG>heading("Memory usage"); ctx.startBuffer();</BUG> ctx.executeKey("compile.size"); String output = ctx.endBuffer(); String reg = props.get("compiler.size.regex", "^\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)");
if (!Base.isQuiet()) heading("Memory usage"); ctx.startBuffer();
39,550
ctx.set("size.data", dataSize + ""); ctx.set("size.rodata", rodataSize + ""); ctx.set("size.bss", bssSize + ""); ctx.set("size.flash", (textSize + dataSize + rodataSize) + ""); ctx.set("size.ram", (bssSize + dataSize) + ""); <BUG>bullet("Program size: " + (textSize + dataSize + rodataSize) + " bytes"); bullet("Memory size: " + (bssSize + dataSize) + " bytes"); </BUG> }
if (!Base.isQuiet()) bullet("Program size: " + (textSize + dataSize + rodataSize) + " bytes"); if (!Base.isQuiet()) bullet("Memory size: " + (bssSize + dataSize) + " bytes");
39,551
for(File file : sources) { File objectFile = new File(dest, file.getName() + "." + objExt); objectPaths.add(objectFile); if(objectFile.exists() && objectFile.lastModified() > file.lastModified()) { if(Preferences.getBoolean("compiler.verbose_compile")) { <BUG>bullet2("Skipping " + file.getAbsolutePath() + " as not modified."); </BUG> } continue; }
if (!Base.isQuiet()) bullet2("Skipping " + file.getAbsolutePath() + " as not modified.");
39,552
ctx.parsedMessage("{\\bullet}{\\error Error at line " + errorLineNumber + " in file " + errorFile.getName() + ":}\n"); } } catch (Exception execpt) { } } else { <BUG>ctx.error("Error at line " + errorLineNumber + " in file " + errorFile.getName() + ":"); </BUG> } ctx.parsedMessage("{\\bullet2}{\\error " + m.group(3) + "}\n"); setLineComment(errorFile, errorLineNumber, m.group(3));
[DELETED]
39,553
ctx.parsedMessage("{\\bullet}{\\warning Error at line " + errorLineNumber + " in file " + errorFile.getName() + ":}\n"); } } catch (Exception execpt) { } } else { <BUG>ctx.warning("Warning at line " + errorLineNumber + " in file " + errorFile.getName() + ":"); </BUG> } ctx.parsedMessage("{\\bullet2}{\\warning " + m.group(3) + "}\n"); setLineComment(errorFile, errorLineNumber, m.group(3));
ctx.parsedMessage("{\\bullet}{\\warning Warning at line " + errorLineNumber + " in file " + errorFile.getName() + ":}\n");
39,554
package org.uecide; import java.io.*; import java.lang.*; import java.util.*; import java.lang.reflect.*; <BUG>import javax.script.*; import org.uecide.builtin.BuiltinCommand;</BUG> import org.uecide.varcmd.VariableCommand; public class Context { Board board = null;
import java.util.regex.*; import org.uecide.builtin.BuiltinCommand;
39,555
cli.addParameter("force-join-files", "", Boolean.class, "Force joining INO and PDE files into single CPP file"); cli.addParameter("online", "", Boolean.class, "Force online mode"); cli.addParameter("offline", "", Boolean.class, "Force offline mode"); cli.addParameter("version", "", Boolean.class, "Display the UECIDE version number"); cli.addParameter("cli", "", Boolean.class, "Enter CLI mode"); <BUG>cli.addParameter("preferences", "", Boolean.class, "Display preferences dialog"); String[] argv = cli.process(args);</BUG> headless = cli.isSet("headless"); boolean loadLastSketch = cli.isSet("last-sketch"); boolean doExit = false;
cli.addParameter("quiet", "", Boolean.class, "Reduce the noise of output"); String[] argv = cli.process(args);
39,556
package com.jgaap.distances; <BUG>import java.util.HashSet; import java.util.Set; import com.jgaap.generics.DistanceFunction;</BUG> import com.jgaap.util.Event; import com.jgaap.util.EventMap;
import com.google.common.collect.Sets; import com.jgaap.generics.DistanceFunction;
39,557
public boolean showInGUI() { return true; } @Override public double distance(EventMap unknownEventMap, EventMap knownEventMap) { <BUG>double distance = 0.0; Set<Event> events = new HashSet<Event>(); events.addAll(unknownEventMap.uniqueEvents()); events.addAll(knownEventMap.uniqueEvents());</BUG> for(Event event : events){
Set<Event> events = Sets.union(unknownEventMap.uniqueEvents(), knownEventMap.uniqueEvents());
39,558
package com.jgaap.distances; <BUG>import java.util.HashSet; import java.util.Set; import com.jgaap.generics.DistanceFunction;</BUG> import com.jgaap.util.Event; import com.jgaap.util.EventMap;
import com.google.common.collect.Sets; import com.jgaap.generics.DistanceFunction;
39,559
package com.jgaap.distances; <BUG>import java.util.HashSet; import java.util.Set; import com.jgaap.generics.DistanceFunction;</BUG> import com.jgaap.util.Event; import com.jgaap.util.EventMap;
import com.google.common.collect.Sets; import com.jgaap.generics.DistanceFunction;
39,560
package com.jgaap.distances; <BUG>import java.util.HashSet; import java.util.Set; import com.jgaap.generics.DistanceCalculationException;</BUG> import com.jgaap.generics.DistanceFunction; import com.jgaap.util.Event;
import com.google.common.collect.Sets; import com.jgaap.generics.DistanceCalculationException;
39,561
public boolean showInGUI() { return true; } @Override public double distance(EventMap unknownEventMap, EventMap knownEventMap) <BUG>throws DistanceCalculationException { Set<Event> events = new HashSet<Event>(unknownEventMap.uniqueEvents()); events.addAll(knownEventMap.uniqueEvents());</BUG> double distance = 0.0, sumNumer = 0.0, sumUnknown = 0.0, sumKnown = 0.0; for(Event event : events){
Set<Event> events = Sets.union(unknownEventMap.uniqueEvents(), knownEventMap.uniqueEvents());
39,562
package com.jgaap.distances; <BUG>import java.util.HashSet; import java.util.Set; import com.jgaap.generics.DistanceFunction;</BUG> import com.jgaap.util.Event; import com.jgaap.util.EventMap;
import com.google.common.collect.Sets; import com.jgaap.generics.DistanceFunction;
39,563
public boolean showInGUI(){ return true; } @Override public double distance(EventMap unknownEventMap, EventMap knownEventMap) { <BUG>double distance = 0.0; Set<Event> events = new HashSet<Event>(unknownEventMap.uniqueEvents()); events.addAll(knownEventMap.uniqueEvents());</BUG> for(Event event : events){ distance += Math.abs(unknownEventMap.relativeFrequency(event)-knownEventMap.relativeFrequency(event));
Set<Event> events = Sets.union(unknownEventMap.uniqueEvents(), knownEventMap.uniqueEvents());
39,564
package com.jgaap.distances; <BUG>import java.util.HashSet; import java.util.Set; import com.jgaap.generics.DistanceFunction;</BUG> import com.jgaap.util.Event; import com.jgaap.util.EventMap;
import com.google.common.collect.Sets; import com.jgaap.generics.DistanceFunction;
39,565
package com.jgaap.distances; <BUG>import java.util.HashSet; import java.util.Set; import com.jgaap.generics.DistanceFunction;</BUG> import com.jgaap.util.Event; import com.jgaap.util.EventMap;
import com.google.common.collect.Sets; import com.jgaap.generics.DistanceFunction;
39,566
public boolean showInGUI() { return true; } @Override public double distance(EventMap unknownEventMap, EventMap knownEventMap) { <BUG>double distance = 0.0; Set<Event> events = new HashSet<Event>(unknownEventMap.uniqueEvents()); events.addAll(knownEventMap.uniqueEvents());</BUG> for (Event event : events) { distance += Math.abs((unknownEventMap.relativeFrequency(event) - knownEventMap.relativeFrequency(event))
Set<Event> events = Sets.union(unknownEventMap.uniqueEvents(), knownEventMap.uniqueEvents());
39,567
package com.jgaap.distances; <BUG>import java.util.HashSet; import java.util.Set; import com.jgaap.generics.DistanceCalculationException;</BUG> import com.jgaap.generics.DistanceFunction; import com.jgaap.util.Event;
import com.google.common.collect.Sets; import com.jgaap.generics.DistanceCalculationException;
39,568
public boolean showInGUI() { return true; } @Override public double distance(EventMap unknownEventMap, EventMap knownEventMap) <BUG>throws DistanceCalculationException { Set<Event> events = new HashSet<Event>(unknownEventMap.uniqueEvents()); events.addAll(knownEventMap.uniqueEvents());</BUG> double distance = 0.0, sumNumer = 0.0, sumUnknown = 0.0, sumKnown = 0.0; for(Event event : events){
Set<Event> events = Sets.union(unknownEventMap.uniqueEvents(), knownEventMap.uniqueEvents());
39,569
package com.jgaap.distances; <BUG>import java.util.HashSet; import java.util.Set; import com.jgaap.generics.DistanceCalculationException;</BUG> import com.jgaap.generics.DistanceFunction; import com.jgaap.util.Event;
import com.google.common.collect.Sets; import com.jgaap.generics.DistanceCalculationException;
39,570
public boolean showInGUI() { return true; } @Override public double distance(EventMap unknownEventMap, EventMap knownEventMap) <BUG>throws DistanceCalculationException{ Set<Event> events = new HashSet<Event>(unknownEventMap.uniqueEvents()); events.addAll(knownEventMap.uniqueEvents());</BUG> double distance = 0.0, sumNumer = 0.0, sumUnknown = 0.0, sumKnown = 0.0; for(Event event: events){
Set<Event> events = Sets.union(unknownEventMap.uniqueEvents(), knownEventMap.uniqueEvents());
39,571
package com.jgaap.distances; <BUG>import java.util.HashSet; import java.util.Set; import com.jgaap.generics.DistanceCalculationException;</BUG> import com.jgaap.generics.DistanceFunction; import com.jgaap.util.Event;
import com.google.common.collect.Sets; import com.jgaap.generics.DistanceCalculationException;
39,572
public boolean showInGUI() { return true; } @Override public double distance(EventMap unknownEventMap, EventMap knownEventMap) <BUG>throws DistanceCalculationException { Set<Event> events = new HashSet<Event>(unknownEventMap.uniqueEvents()); events.addAll(knownEventMap.uniqueEvents());</BUG> double distance = 0.0; for(Event event : events){
Set<Event> events = Sets.union(unknownEventMap.uniqueEvents(), knownEventMap.uniqueEvents());
39,573
package com.jgaap.distances; <BUG>import java.util.HashSet; import java.util.Set; import com.jgaap.generics.DistanceFunction;</BUG> import com.jgaap.util.Event; import com.jgaap.util.EventMap;
import com.google.common.collect.Sets; import com.jgaap.generics.DistanceFunction;
39,574
package com.jgaap.distances; <BUG>import java.util.HashSet; import java.util.Set; import com.jgaap.generics.DistanceCalculationException;</BUG> import com.jgaap.generics.DistanceFunction; import com.jgaap.util.Event;
import com.google.common.collect.Sets; import com.jgaap.generics.DistanceCalculationException;
39,575
public boolean showInGUI() { return true; } @Override public double distance(EventMap unknownEventMap, EventMap knownEventMap) <BUG>throws DistanceCalculationException { Set<Event> events = new HashSet<Event>(unknownEventMap.uniqueEvents()); events.addAll(knownEventMap.uniqueEvents());</BUG> double distance = 0.0, sumNumer = 0.0, sumDenom = 0.0; for(Event event: events){
Set<Event> events = Sets.union(unknownEventMap.uniqueEvents(), knownEventMap.uniqueEvents());
39,576
package com.jgaap.distances; <BUG>import java.util.HashSet; import java.util.Set; import com.jgaap.generics.DistanceCalculationException;</BUG> import com.jgaap.generics.DistanceFunction; import com.jgaap.util.Event;
import com.google.common.collect.Sets; import com.jgaap.generics.DistanceCalculationException;
39,577
public boolean showInGUI() { return true; } @Override public double distance(EventMap unknownEventMap, EventMap knownEventMap) <BUG>throws DistanceCalculationException { Set<Event> events = new HashSet<Event>(unknownEventMap.uniqueEvents()); events.addAll(knownEventMap.uniqueEvents());</BUG> double distance = 0.0, sum = 0.0; for(Event event : events){
Set<Event> events = Sets.union(unknownEventMap.uniqueEvents(), knownEventMap.uniqueEvents());
39,578
package com.jgaap.distances; <BUG>import java.util.HashSet; import java.util.Set; import com.jgaap.generics.DistanceCalculationException;</BUG> import com.jgaap.generics.DistanceFunction; import com.jgaap.util.Event;
import com.google.common.collect.Sets; import com.jgaap.generics.DistanceCalculationException;
39,579
public boolean showInGUI() { return true; } @Override public double distance(EventMap unknownEventMap, EventMap knownEventMap) <BUG>throws DistanceCalculationException { Set<Event> events = new HashSet<Event>(unknownEventMap.uniqueEvents()); events.addAll(knownEventMap.uniqueEvents());</BUG> double sum = 0.0; for(Event event : events){
Set<Event> events = Sets.union(unknownEventMap.uniqueEvents(), knownEventMap.uniqueEvents());
39,580
import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; <BUG>import java.util.Set; import com.jgaap.generics.DistanceFunction;</BUG> import com.jgaap.util.Event; import com.jgaap.util.EventMap; import com.jgaap.util.Pair;
import com.google.common.collect.Sets; import com.jgaap.generics.DistanceFunction;
39,581
package com.jgaap.distances; <BUG>import java.util.HashSet; import java.util.Set; import com.jgaap.generics.DistanceFunction;</BUG> import com.jgaap.util.Event; import com.jgaap.util.EventMap;
import com.google.common.collect.Sets; import com.jgaap.generics.DistanceFunction;
39,582
public boolean showInGUI(){ return true; } @Override public double distance(EventMap unknownEventMap, EventMap knownEventMap) { <BUG>double distance = 0.0; Set<Event> events = new HashSet<Event>(unknownEventMap.uniqueEvents()); events.addAll(knownEventMap.uniqueEvents());</BUG> for (Event event : events) { distance += Math.abs(unknownEventMap.relativeFrequency(event)
Set<Event> events = Sets.union(unknownEventMap.uniqueEvents(), knownEventMap.uniqueEvents());
39,583
package com.jgaap.distances; <BUG>import java.util.HashSet; import java.util.Set; import com.jgaap.generics.DistanceFunction;</BUG> import com.jgaap.util.Event; import com.jgaap.util.EventMap;
import com.google.common.collect.Sets; import com.jgaap.generics.DistanceFunction;
39,584
public boolean showInGUI() { return true; } @Override public double distance(EventMap unknownEventMap, EventMap knownEventMap) { <BUG>double distance = 0.0; Set<Event> events = new HashSet<Event>(unknownEventMap.uniqueEvents()); events.addAll(knownEventMap.uniqueEvents());</BUG> for (Event event : events) { double x = unknownEventMap.relativeFrequency(event);
Set<Event> events = Sets.union(unknownEventMap.uniqueEvents(), knownEventMap.uniqueEvents());
39,585
package com.jgaap.distances; <BUG>import java.util.HashSet; import java.util.Set; import com.jgaap.generics.DistanceFunction;</BUG> import com.jgaap.util.Event; import com.jgaap.util.EventMap;
import com.google.common.collect.Sets; import com.jgaap.generics.DistanceFunction;
39,586
package com.jgaap.distances; <BUG>import java.util.HashSet; import java.util.Set; import com.jgaap.generics.DistanceCalculationException;</BUG> import com.jgaap.generics.DistanceFunction; import com.jgaap.util.Event;
import com.google.common.collect.Sets; import com.jgaap.generics.DistanceCalculationException;
39,587
public boolean showInGUI() { return true; } @Override public double distance(EventMap unknownEventMap, EventMap knownEventMap) <BUG>throws DistanceCalculationException { Set<Event> events = new HashSet<Event>(unknownEventMap.uniqueEvents()); events.addAll(knownEventMap.uniqueEvents());</BUG> double distance = 0.0, sumNumer = 0.0, sumDenom = 0.0; for(Event event : events){
Set<Event> events = Sets.union(unknownEventMap.uniqueEvents(), knownEventMap.uniqueEvents());
39,588
public final Promise<V> delay(long duration) { return delay(duration, TimeUnit.MILLISECONDS); } @SuppressWarnings("unchecked") public final Promise<V> tap(final Action<V> onfulfilledSideEffect) { <BUG>return (Promise<V>) then(new Func<V, V>() { public V call(V value) throws Throwable {</BUG> onfulfilledSideEffect.call(value); return value; }
return then(new Func<V, V>() { public V call(V value) throws Throwable {
39,589
if(ignore_synchronous_response && ignore_thread.get()) { // JGRP-465 if(log.isTraceEnabled()) log.trace("bypassing blocking to avoid deadlocking " + Thread.currentThread()); return down_prot.down(evt); } <BUG>if(max_block_times != null) { long tmp=getMaxBlockTime(length); if(tmp > 0) end_time.set(System.currentTimeMillis() + tmp); }</BUG> UfcCredit cred=(UfcCredit)sent.get(dest);
[DELETED]
39,590
Address dest=msg.getDest(); if(dest != null && !dest.isMulticastAddress()) { log.error(getClass().getSimpleName() + " doesn't handle unicast messages; passing message down"); return down_prot.down(evt); } <BUG>if(max_block_times != null) { long tmp=getMaxBlockTime(length); if(tmp > 0) end_time.set(System.currentTimeMillis() + tmp); }</BUG> lock.lock();
[DELETED]
39,591
package com.yahoo.pulsar.broker.namespace; import static com.yahoo.pulsar.broker.cache.LocalZooKeeperCacheService.LOCAL_POLICIES_ROOT; import static com.yahoo.pulsar.broker.web.PulsarWebResource.joinPath; <BUG>import static org.mockito.Matchers.any; import static org.mockito.Mockito.doNothing;</BUG> import static org.mockito.Mockito.mock; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.when;
import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.doNothing;
39,592
import java.util.Set; import java.util.concurrent.CompletableFuture; import org.apache.bookkeeper.mledger.ManagedLedger; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.tuple.Pair; <BUG>import org.apache.zookeeper.data.Stat; import org.testng.Assert;</BUG> import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test;
import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; import org.testng.Assert;
39,593
import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import com.github.benmanes.caffeine.cache.AsyncLoadingCache; import com.google.common.collect.Lists; import com.google.common.hash.Hashing; <BUG>import com.yahoo.pulsar.broker.service.BrokerTestBase; import com.yahoo.pulsar.broker.service.persistent.PersistentTopic; import com.yahoo.pulsar.common.naming.DestinationName;</BUG> import com.yahoo.pulsar.common.naming.NamespaceBundle; import com.yahoo.pulsar.common.naming.NamespaceBundleFactory;
import com.yahoo.pulsar.broker.service.Topic; import com.yahoo.pulsar.client.api.Consumer; import com.yahoo.pulsar.client.api.ConsumerConfiguration; import com.yahoo.pulsar.common.naming.DestinationName;
39,594
import com.yahoo.pulsar.common.naming.NamespaceBundle; import com.yahoo.pulsar.common.naming.NamespaceBundleFactory; import com.yahoo.pulsar.common.naming.NamespaceBundles; import com.yahoo.pulsar.common.naming.NamespaceName; import com.yahoo.pulsar.common.policies.data.Policies; <BUG>import com.yahoo.pulsar.common.util.ObjectMapperFactory; public class NamespaceServiceTest extends BrokerTestBase {</BUG> @BeforeMethod @Override protected void setup() throws Exception {
import com.yahoo.pulsar.common.util.collections.ConcurrentOpenHashMap; public class NamespaceServiceTest extends BrokerTestBase {
39,595
public void testRemoveOwnership() throws Exception { OwnershipCache cache = new OwnershipCache(this.pulsar, bundleFactory); NamespaceName testNs = new NamespaceName("pulsar/test/ns-7"); NamespaceBundle bundle = bundleFactory.getFullBundle(testNs); assertFalse(cache.getOwnerAsync(bundle).get().isPresent()); <BUG>cache.removeOwnership(bundle); </BUG> assertTrue(cache.getOwnedBundles().isEmpty()); NamespaceEphemeralData data1 = cache.tryAcquiringOwnership(bundle).get(); assertEquals(data1.getNativeUrl(), selfBrokerUrl);
cache.removeOwnership(bundle).get();
39,596
NamespaceEphemeralData data1 = cache.tryAcquiringOwnership(bundle).get(); assertEquals(data1.getNativeUrl(), selfBrokerUrl); assertTrue(!data1.isDisabled()); assertTrue(cache.getOwnedBundles().size() == 1); cache.removeOwnership(bundle); <BUG>assertTrue(cache.getOwnedBundles().isEmpty()); Thread.sleep(500); try {</BUG> zkCache.getZooKeeper().getData(ServiceUnitZkUtils.path(bundle), null, null); fail("Should have failed");
try {
39,597
package com.yahoo.pulsar.broker.namespace; <BUG>import static com.google.common.base.Preconditions.checkState; import java.util.Map;</BUG> import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionException;
import java.util.List; import java.util.Map;
39,598
import com.fasterxml.jackson.databind.ObjectMapper; import com.github.benmanes.caffeine.cache.AsyncCacheLoader; import com.github.benmanes.caffeine.cache.AsyncLoadingCache; import com.github.benmanes.caffeine.cache.Caffeine; import com.github.benmanes.caffeine.cache.RemovalCause; <BUG>import com.github.benmanes.caffeine.cache.RemovalListener; import com.google.common.util.concurrent.MoreExecutors;</BUG> import com.yahoo.pulsar.broker.PulsarService; import com.yahoo.pulsar.client.util.FutureUtil; import com.yahoo.pulsar.common.naming.NamespaceBundle;
import com.google.common.collect.Lists; import com.google.common.util.concurrent.MoreExecutors;
39,599
@Argument(fullName="suppressLocusPrinting",doc="Suppress printing",required=false) public boolean suppress_printing = false; @Argument(fullName="poolSize", shortName="ps", doc="Number of individuals in pool", required=true) public int num_individuals = 0; @Argument(fullName="bootStrap", shortName="bs", doc="Use a bootstrap method", required=false) <BUG>public boolean use_bootstrap = false; </BUG> @Argument(fullName="lodThreshold", shortName="lt", doc="Threshold for LOD score for calls") public double threshold = 3.0; private static final int BOOTSTRAP_ITERATIONS = 300;
public boolean useBootstrap = false;
39,600
return orderStatisticSearch(orderStat - lessThanX.size() - equalToX.size(), greaterThanX); } public static Object getMedian(List<Comparable> list) { return orderStatisticSearch((int) Math.ceil(list.size()/2), list); } <BUG>public static byte getQScoreOrderStatistic(List<SAMRecord> reads, List<Integer> offsets, int k) { ArrayList lessThanQReads = new ArrayList();</BUG> ArrayList equalToQReads = new ArrayList(); ArrayList greaterThanQReads = new ArrayList(); ArrayList lessThanQOffsets = new ArrayList();
if( reads.size() == 0) { return 0; ArrayList lessThanQReads = new ArrayList();