id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
10,201 | }
public FluentSelects selects(By by) {
MultipleResult multiple = multiple(by, "select");
return newFluentSelects(multiple.getResult(), multiple.getCtx());
}
<BUG>public FluentWebElement h1() {
</BUG>
SingleResult single = single(tagName("h1"), "h1");
return newFluentWebElement(delegate, single.getResult(), single.getC... | protected BaseFluentWebElements spans() {
return newFluentWebElements(multiple(tagName("span"), "span"));
|
10,202 | import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.TimeZone;
<BUG>import java.util.Locale;
import org.zkoss.util.Dates;</BUG>
import org.zkoss.util.Locales;
import org.zkoss.util.TimeZones;
import org.zkoss.text.DateFormats;
| import org.zkoss.lang.Objects;
import org.zkoss.util.Dates;
|
10,203 | private boolean _btnVisible = true, _lenient = true, _dtzonesReadonly = false;
static {
addClientEvent(Datebox.class, "onTimeZoneChange", CE_IMPORTANT|CE_DUPLICATE_IGNORE);
}
public Datebox() {
<BUG>setFormat(getDefaultFormat());
setCols(11);</BUG>
}
public Datebox(Date date) throws WrongValueException {
this();
| setFormat("");
setCols(11);
|
10,204 | }
protected String getDefaultFormat() {
return DateFormats.getDateFormat(DateFormat.DEFAULT, _locale, DEFAULT_FORMAT);
}
protected String getLocalizedFormat() {
<BUG>String format = getFormat();
if (format == null)
format = getDefaultFormat();
return new SimpleDateFormat(format,
</BUG>
_locale != null ? _locale: Locale... | public Datebox() {
setFormat("");
setCols(11);
public Datebox(Date date) throws WrongValueException {
this();
setValue(date);
return new SimpleDateFormat(getRealFormat(),
|
10,205 | return new Date(((Date) value).getTime() + TimeZones.getCurrent().getRawOffset() - _tzone.getRawOffset());
}
protected Object coerceFromString(String value) throws WrongValueException {
if (value == null || value.length() == 0)
return null;
<BUG>final String fmt = getFormat();
</BUG>
final DateFormat df = getDateFormat... | final String fmt = getRealFormat();
|
10,206 | MZul.DATE_REQUIRED, new Object[] { value, fmt }));
}
return date;
}
protected String coerceToString(Object value) {
<BUG>final DateFormat df = getDateFormat(getFormat());
</BUG>
return value != null ? df.format((Date) value) : "";
}
protected DateFormat getDateFormat(String fmt) {
| final DateFormat df = getDateFormat(getRealFormat());
|
10,207 | public class Timebox extends FormatInputElement implements org.zkoss.zul.api.Timebox {
private Locale _locale;
private boolean _btnVisible = true;
public Timebox() {
setCols(5);
<BUG>setFormat(getDefaultFormat());
}</BUG>
public Timebox(Date date) throws WrongValueException {
this();
setValue(date);
| setFormat("");
}
|
10,208 | new Object[] {value, fmt}));
}
return date;
}
protected String coerceToString(Object value) {
<BUG>final DateFormat df = getDateFormat(getFormat());
</BUG>
return value != null ? df.format((Date) value) : "";
}
protected DateFormat getDateFormat(String fmt) {
| final DateFormat df = getDateFormat(getRealFormat());
|
10,209 | CallFuture(Call call, int priority, Span span) {
this.call = call;
this.priority = priority;
this.span = span;
}
<BUG>}
private enum WaitForWorkResult {
READ_RESPONSE,
CALLER_SHOULD_CLOSE,
CLOSED</BUG>
}
| [DELETED] |
10,210 | expectedCall = (call != null && !call.done);
if (!expectedCall) {
int readSoFar = IPCUtil.getTotalSizeWhenWrittenDelimited(responseHeader);
int whatIsLeftToRead = totalSize - readSoFar;
IOUtils.skipFully(in, whatIsLeftToRead);
<BUG>return false;
}</BUG>
if (responseHeader.hasException()) {
ExceptionResponse exceptionRe... | return;
}
|
10,211 | if (responseHeader.hasException()) {
ExceptionResponse exceptionResponse = responseHeader.getException();
RemoteException re = createRemoteException(exceptionResponse);
call.setException(re);
if (isFatalConnectionException(exceptionResponse)) {
<BUG>return markClosed(re);
}</BUG>
} else {
Message value = null;
if (call... | }
|
10,212 | if (LOG.isTraceEnabled()) {
LOG.trace(getName() + ": marking at should close, reason: " + e.getMessage());
}
if (callSender != null) {
callSender.close();
<BUG>}
}
return ret;</BUG>
}
protected synchronized void cleanupCalls(boolean allCalls) {
| notifyAll();
|
10,213 | this(conf, clusterId, NetUtils.getDefaultSocketFactory(conf), localAddr);
}
@Override
public void close() {
if (LOG.isDebugEnabled()) LOG.debug("Stopping rpc client");
<BUG>if (!running.compareAndSet(true, false)) return;
synchronized (connections) {</BUG>
for (Connection conn : connections.values()) {
conn.interrupt()... | Set<Connection> connsToClose = null;
synchronized (connections) {
|
10,214 | package org.apache.cxf.staxutils.validation;
import java.util.Map;
<BUG>import java.util.TreeMap;
import java.util.logging.Logger;</BUG>
import javax.xml.XMLConstants;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
| import java.util.logging.Level;
import java.util.logging.Logger;
|
10,215 | import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLStreamWriter;
import org.w3c.dom.Element;
import org.apache.cxf.common.i18n.Message;
<BUG>import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.interceptor.Fault;</BUG>
import org.apache.cxf.se... | import org.apache.cxf.endpoint.Endpoint;
import org.apache.cxf.interceptor.Fault;
|
10,216 | }
EmbeddedSchema embeddedSchema = new EmbeddedSchema(schemaSystemId, serialized);
sources.put(sch.getTargetNamespace(), embeddedSchema);
}
W3CMultiSchemaFactory factory = new W3CMultiSchemaFactory();
<BUG>XMLValidationSchema vs;
vs = factory.loadSchemas(null, sources);
return vs;
}
}
</BUG>
| final XMLStreamReader2 reader2 = (XMLStreamReader2)effectiveReader;
XMLValidationSchema vs = getValidator(endpoint, serviceInfo);
if (vs == null) {
return false;
|
10,217 | import java.util.logging.Level;
import java.util.logging.Logger;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLStreamWriter;
<BUG>import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.service.model.ServiceInfo;</BUG>
public class WoodstoxV... | import org.apache.cxf.endpoint.Endpoint;
import org.apache.cxf.service.model.ServiceInfo;
|
10,218 | throw new IllegalArgumentException("Can't save an empty KnowledgeBase.");
}
dbc.saveObject("modelParameters", modelParameters);
dbc.saveObject("trainingParameters", trainingParameters);
}
<BUG>public void load() {
</BUG>
if(!isInitialized()) {
modelParameters = dbc.loadObject("modelParameters", mpClass);
trainingParame... | public void init() {
|
10,219 | modelParameters.setCols(components.getColumnDimension());
modelParameters.setEigenValues(eigenValues);
modelParameters.setComponents(components.getData());
}
@Override
<BUG>protected void filterFeatures(Dataframe dataset) {
</BUG>
ModelParameters modelParameters = knowledgeBase.getModelParameters();
Map<Object, Integer... | protected void _transform(Dataframe dataset) {
|
10,220 | mlregressor.close();
mlregressor = null;
super.close();
}
@Override
<BUG>protected void _predictDataset(Dataframe newData) {
loadRegressor();</BUG>
mlregressor.predict(newData);
}
@Override
| protected void _predict(Dataframe newData) {
loadRegressor();
|
10,221 | testDataset.delete();
return r;
}
public ClassificationMetrics validate(Dataframe testDataset) {
logger.info("validate()");
<BUG>knowledgeBase.load();
</BUG>
preprocessTestDataset(testDataset);
modeler.predict(testDataset);
ClassificationMetrics vm = new ClassificationMetrics(testDataset);
| knowledgeBase.init();
|
10,222 | modeler.predict(testDataset);
ClassificationMetrics vm = new ClassificationMetrics(testDataset);
return vm;
}
public ClassificationMetrics validate(Map<Object, URI> datasets) {
<BUG>knowledgeBase.load();
</BUG>
TextClassifier.TrainingParameters trainingParameters = knowledgeBase.getTrainingParameters();
Dataframe testD... | knowledgeBase.init();
|
10,223 | public Modeler(String dbName, Configuration conf) {
super(dbName, conf, Modeler.ModelParameters.class, Modeler.TrainingParameters.class);
}
public void predict(Dataframe newData) {
logger.info("predict()");
<BUG>knowledgeBase.load();
</BUG>
Modeler.TrainingParameters trainingParameters = knowledgeBase.getTrainingParame... | knowledgeBase.init();
|
10,224 | import com.datumbox.framework.core.utilities.text.tokenizers.WhitespaceTokenizer;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class ReadabilityStatistics {
<BUG>private static final Set<String> DALECHALL_WORDLIST = Collections.unmodifiableSet(new HashSet<>(Arrays.asList("a... | private static final Set<String> DALECHALL_WORDLIST = Collections.unmodifiableSet(new HashSet<>(Arrays.asList("a", "able", "aboard", "about", "above", "absent", "accept", "accident", "account", "ache", "aching", "acorn", "acre", "across", "act", "acts", "add", "address", "admire", "adventure", "afar", "afraid", "after"... |
10,225 | if(maxFeatures!=null && maxFeatures<maxFeatureScores.size()) {
AbstractScoreBasedFeatureSelector.selectHighScoreFeatures(maxFeatureScores, maxFeatures);
}
}
@Override
<BUG>protected void filterFeatures(Dataframe newData) {
</BUG>
DatabaseConnector dbc = knowledgeBase.getDbc();
Map<Object, Double> maxTFIDFfeatureScores ... | protected void _transform(Dataframe newData) {
|
10,226 | import com.datumbox.framework.common.concurrency.ConcurrencyConfiguration;
import com.datumbox.framework.common.concurrency.ForkJoinStream;
import com.datumbox.framework.common.concurrency.StreamMethods;
import com.datumbox.framework.common.dataobjects.AssociativeArray;
import com.datumbox.framework.common.dataobjects.... | import com.datumbox.framework.common.persistentstorage.interfaces.DatabaseConnector;
import java.io.Serializable;
|
10,227 | fit(trainingData, trainingParameters);
transform(trainingData);
}
public void transform(Dataframe newData) {
logger.info("transform()");
<BUG>knowledgeBase.load();
</BUG>
_convert(newData);
_normalize(newData);
}
| knowledgeBase.init();
|
10,228 | _convert(newData);
_normalize(newData);
}
public void denormalize(Dataframe data) {
logger.info("denormalize()");
<BUG>knowledgeBase.load();
</BUG>
_denormalize(data);
}
protected abstract void _convert(Dataframe data);
| knowledgeBase.init();
|
10,229 | estimateFeatureScores(trainingData.size(), tmp_classCounts, tmp_featureClassCounts, tmp_featureCounts);
dbc.dropBigMap("tmp_featureClassCounts", tmp_featureClassCounts);
dbc.dropBigMap("tmp_featureCounts", tmp_featureCounts);
}
@Override
<BUG>protected void filterFeatures(Dataframe newdata) {
</BUG>
filterData(newdata,... | protected void _transform(Dataframe newdata) {
|
10,230 | private AtomicReference<GridTimeoutObject> lastTimeoutObj = new AtomicReference<>();
private volatile GridDhtPartitionsExchangeFuture lastExchangeFut;
@Deprecated//Backward compatibility. To be removed in future.
private final ReadWriteLock demandLock;
@Deprecated//Backward compatibility. To be removed in future.
<BUG>... | private volatile DemandWorker worker;
private final Map<Integer, Object> rebalanceTopics;
|
10,231 | try {
rebalanceFut.cancel();
}
catch (Exception ex) {
rebalanceFut.onDone(false);
<BUG>}
lastExchangeFut = null;</BUG>
lastTimeoutObj.set(null);
}
IgniteInternalFuture<?> syncFuture() {
| DemandWorker dw = worker;
if (dw != null)
dw.cancel();
lastExchangeFut = null;
|
10,232 | U.log(log, "Starting rebalancing (old api) [cache=" + cctx.name() + ", mode=" + cfg.getRebalanceMode() +
", fromNode=" + node.id() + ", partitionsCount=" + parts.size() +
", topology=" + fut.topologyVersion() + ", updateSeq=" + fut.updateSeq + "]");
d.timeout(cctx.config().getRebalanceTimeout());
d.workerId(0);//old ap... | worker = new DemandWorker(dmIdx.incrementAndGet(), fut);
worker.run(node, d);
|
10,233 | @Nullable private <T> T poll(BlockingQueue<T> deque, long time) throws InterruptedException {
return deque.poll(time, MILLISECONDS);
}
public Object topic(long idx) {
return TOPIC_CACHE.topic(cctx.namexx(), cctx.nodeId(), id, idx);
<BUG>}
private void demandFromNode(</BUG>
ClusterNode node,
final AffinityTopologyVersio... | public void cancel() {
msgQ.clear();
msgQ.offer(new SupplyMessage(null, null));
private void demandFromNode(
|
10,234 | ) throws InterruptedException, IgniteCheckedException {
GridDhtPartitionTopology top = cctx.dht().topology();
cntr++;
d.topic(topic(cntr));
d.workerId(id);
<BUG>if (topologyChanged(fut))
</BUG>
return;
cctx.io().addOrderedHandler(d.topic(), new CI2<UUID, GridDhtPartitionSupplyMessage>() {
@Override public void apply(UU... | if (fut.isDone() || topologyChanged(fut))
|
10,235 | retry = true;
break; // While.
}
else
continue; // While.
<BUG>}
if (!s.senderId().equals(node.id())) {</BUG>
U.warn(log, "Received supply message from unexpected node [expectedId=" + node.id() +
", rcvdId=" + s.senderId() + ", msg=" + s + ']');
continue; // While.
| if (s.senderId() == null)
return; // Stopping now.
if (!s.senderId().equals(node.id())) {
|
10,236 | private AffinityTopologyVersion affinityTopologyVersion(DiscoveryEvent evt) {
if (evt.type() == DiscoveryCustomEvent.EVT_DISCOVERY_CUSTOM_EVT)
return ((DiscoveryCustomEvent)evt).affinityTopologyVersion();
return new AffinityTopologyVersion(evt.topologyVersion());
}
<BUG>public boolean topologyChanged() {
return exchWor... | [DELETED] |
10,237 | log.debug("Skip partitions refresh, there are no server nodes [loc=" + cctx.localNodeId() + ']');
return;
}
if (log.isDebugEnabled())
log.debug("Refreshing partitions [oldest=" + oldest.id() + ", loc=" + cctx.localNodeId() + ']');
<BUG>Collection<ClusterNode> rmts = null;
if (oldest.id().equals(cctx.localNodeId())) {</... | Collection<ClusterNode> rmts;
if (oldest.id().equals(cctx.localNodeId())) {
|
10,238 | if (asyncStartFut != null)
asyncStartFut.get(); // Wait for thread stop.
rebalanceQ.addAll(orderedRs);
if (marshR != null || !rebalanceQ.isEmpty()) {
if (futQ.isEmpty()) {
<BUG>U.log(log, "Starting caches rebalancing [top=" + exchFut.topologyVersion() + "]");
if (marshR != null)</BUG>
try {
marshR.call(); //Marshaller ... | U.log(log, "Rebalancing required" +
"[top=" + exchFut.topologyVersion() + ", evt=" + exchFut.discoveryEvent().name() +
", node=" + exchFut.discoveryEvent().node().id() + ']');
if (marshR != null)
|
10,239 | catch (IgniteCheckedException e) {
U.error(log, "Failed to wait for completion of partition map exchange " +
"(preloading will not start): " + exchFut, e);
}
}
<BUG>}
boolean topologyChanged() {
return !futQ.isEmpty() || busy;</BUG>
}
}
| [DELETED] |
10,240 | 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;
|
10,241 | 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;
|
10,242 | 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"),
|
10,243 | 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] |
10,244 | 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) {
|
10,245 | 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;
|
10,246 | import util.access.V;
import util.access.fieldvalue.FileField;
import util.access.fieldvalue.ObjectField;
import util.action.Action;
import util.animation.Anim;
<BUG>import util.animation.interpolator.ElasticInterpolator;
import util.async.future.Fut;</BUG>
import util.collections.map.ClassListMap;
import util.collecti... | import util.async.Async;
import util.async.future.Fut;
|
10,247 | import util.collections.map.ClassListMap;
import util.collections.map.ClassMap;
import util.conf.Configurable;
import util.conf.IsConfig;
import util.conf.IsConfigurable;
<BUG>import util.functional.Functors;
import util.functional.Functors.Ƒ1;
import util.type.ClassName;</BUG>
import util.type.InstanceInfo;
import uti... | import util.functional.Try;
import util.type.ClassName;
|
10,248 | if (action.isComplex) {
ComplexActionData complexAction = action.complexData;
showIcons = false;
insteadIcons = (Node) complexAction.gui.get();
show(complexAction.input.apply(action.prepInput(getData())));
<BUG>} else {
doneHide();
}</BUG>
}
private final Label dataInfo = new Label();
| if (!action.preventClosing)
|
10,249 | Anim.par(icons, (i,icon) -> new Anim(at -> setScaleXY(icon,at*at)).dur(500).intpl(intpl).delay(350+i*delay))
.play();
}
private void runAction(ActionData action, Object data) {
if (!action.isLong) {
<BUG>action.apply(data);
</BUG>
doneHide(action);
} else {
futAfter(fut(data))
| action.accept(data);
|
10,250 | public final String description;
public final GlyphIcons icon;
public final Predicate<? super T> condition;
public final GroupApply groupApply;
public final boolean isLong;
<BUG>private final Ƒ1<T,?> action;
private boolean isComplex = false;
private ComplexActionData<?,?> complexData = null;
private ActionData(String ... | private final Consumer<? super T> action;
private boolean preventClosing = false;
private ActionData(String name, String description, GlyphIcons icon, GroupApply group, Predicate<? super T> constriction, boolean isLong, Consumer<? super T> action) {
|
10,251 | package gui.objects.image;
import java.io.File;
import java.util.function.Consumer;
<BUG>import de.jensd.fx.glyphs.GlyphIcons;
import util.file.Environment;
import util.async.future.Fut;
import util.file.FileType;</BUG>
import util.graphics.drag.DragPane;
| [DELETED] |
10,252 | import util.graphics.drag.DragUtil;
import static de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIcon.DETAILS;
import static javafx.scene.input.DragEvent.DRAG_EXITED;
import static javafx.scene.input.DragEvent.DRAG_OVER;
import static javafx.scene.input.MouseButton.PRIMARY;
<BUG>import static javafx.scene.input.M... | import static javafx.scene.input.MouseEvent.*;
|
10,253 | root.addEventHandler(MOUSE_ENTERED, e -> highlight(true));
root.addEventHandler(DRAG_OVER, e -> { if (DragUtil.hasImage(e)) onHighlight.accept(true); });
root.addEventHandler(DRAG_EXITED, e -> onHighlight.accept(false));
root.addEventHandler(MOUSE_CLICKED, e -> {
if (e.getButton()==PRIMARY) {
<BUG>File f = Environment.... | Environment.chooseFile("Select image to add to tag", FILE, new File(""), root.getScene().getWindow())
.ifOk(file -> {
if (onFileDropped!=null)
onFileDropped.accept(fut(file));
e.consume();
|
10,254 | public void addUris(Collection<URI> uris) {
addUris(uris, size());
}
public void addUris(Collection<URI> uris, int at) {
int _at = at;
<BUG>if (_at < 0) _at = 0;
if (_at > size()) _at = size();</BUG>
List<PlaylistItem> l = new ArrayList<>();
uris.forEach(uri->l.add(new PlaylistItem(uri)));
addPlaylist(l, _a... | if (_at < 0) _at = 0;
if (_at > size()) _at = size();
|
10,255 | public void addItems(Collection<? extends Item> items, int at) {
addPlaylist(map(items, Item::toPlaylist), at);
}
public void addPlaylist(Collection<PlaylistItem> ps, int at) {
int _at = at;
<BUG>if (_at < 0) _at = 0;
if (_at > size()) _at = size();</BUG>
addAll(_at, ps);
updateItems(ps);
}
| if (_at < 0) _at = 0;
if (_at > size()) _at = size();
|
10,256 | setRight(layHorizontally(5, Pos.CENTER_RIGHT, b1,b2));
}
}
@Override
void onDialogAction() {
<BUG>File f = Environment.chooseFile(type==DIRECTORY ? "Choose directory" : "Choose file", type, v, getScene().getWindow());
if (f!=null) setValue(f);
}</BUG>
@Override
String itemToString(File item) {
| Environment.chooseFile(type==DIRECTORY ? "Choose directory" : "Choose file", type, v, getScene().getWindow())
.ifOk(this::setValue);
|
10,257 | import java.security.SecureRandom;
import java.security.cert.X509Certificate;
import java.security.spec.ECGenParameterSpec;
import junit.framework.TestCase;
import org.bouncycastle.asn1.x500.X500Name;
<BUG>import org.bouncycastle.cert.X509CertificateHolder;
import org.bouncycastle.est.ESTServiceBuilder;</BUG>
import or... | import org.bouncycastle.est.ESTService;
import org.bouncycastle.est.ESTServiceBuilder;
|
10,258 | X509CertificateHolder[] theirCAs = null;
ESTServerUtils.ServerInstance serverInstance = null;
try
{
serverInstance = startDefaultServerWithBasicAuth();
<BUG>ESTServiceBuilder est = new ESTServiceBuilder("https://localhost:8443/.well-known/est/");
est.setTlsTrustAnchors(
</BUG>
ESTTestUtils.toTrustAnchor(
ESTTestUtils.r... | ESTService est = new ESTServiceBuilder("https://localhost:8443/.well-known/est/")
.withTlsTrustAnchors(
|
10,259 | import org.bouncycastle.asn1.x500.X500NameBuilder;
import org.bouncycastle.asn1.x500.style.BCStyle;
import org.bouncycastle.asn1.x509.KeyPurposeId;
import org.bouncycastle.asn1.x509.KeyUsage;
import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo;
<BUG>import org.bouncycastle.cert.X509CertificateHolder;
import org.boun... | import org.bouncycastle.est.ESTService;
import org.bouncycastle.est.ESTServiceBuilder;
|
10,260 | X509CertificateHolder[] theirCAs = null;
ESTServerUtils.ServerInstance serverInstance = null;
try
{
serverInstance = startDefaultServerWithBasicAuth();
<BUG>ESTServiceBuilder est = new ESTServiceBuilder("https://localhost:8443/.well-known/est/");
est.setTlsTrustAnchors(
</BUG>
ESTTestUtils.toTrustAnchor(
ESTTestUtils.r... | ESTService est = new ESTServiceBuilder("https://localhost:8443/.well-known/est/")
.withTlsTrustAnchors(
|
10,261 | X509CertificateHolder[] theirCAs = null;
ESTServerUtils.ServerInstance serverInstance = null;
try
{
serverInstance = startDefaultServerWithDigestAuth();
<BUG>ESTServiceBuilder est = new ESTServiceBuilder("https://localhost:8443/.well-known/est/");
est.setTlsTrustAnchors(
</BUG>
ESTTestUtils.toTrustAnchor(
ESTTestUtils.... | ESTService est = new ESTServiceBuilder("https://localhost:8443/.well-known/est/")
.withTlsTrustAnchors(
|
10,262 | TrustAnchor ta = new TrustAnchor(
ESTTestUtils.toJavaX509Certificate(
ESTTestUtils.readPemCertificate(
ESTServerUtils.makeRelativeToServerHome("/estCA/cacert.crt")
)
<BUG>), null);
est.setTlsTrustAnchors(Collections.singleton(ta));
</BUG>
PKCS10CertificationRequestBuilder pkcs10Builder = new JcaPKCS10CertificationReque... | ESTService est = new ESTServiceBuilder("https://localhost:8443/.well-known/est/")
.withClientKeystore(clientKeyStore)
.withClientKeystorePassword(clientKeyStorePass)
.withTlsTrustAnchors(Collections.singleton(ta)).build();
|
10,263 | import java.security.cert.TrustAnchor;
import java.util.Collections;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.net.ssl.SSLSession;
import javax.security.cert.X509Certificate;
<BUG>import org.bouncycastle.cert.X509CertificateHolder;
import org.bouncycastle.est.ESTServiceBuilder;</BUG>
import org.bou... | import org.bouncycastle.est.ESTService;
import org.bouncycastle.est.ESTServiceBuilder;
|
10,264 | X509CertificateHolder[] theirCAs = null;
ESTServerUtils.ServerInstance serverInstance = null;
try
{
serverInstance = startDefaultServer();
<BUG>ESTServiceBuilder est = new ESTServiceBuilder("https://localhost:8443/.well-known/est/");
X509CertificateHolder[] caCerts = ESTServiceBuilder.storeToArray(est.getCACerts(null,... | ESTService est = new ESTServiceBuilder("https://localhost:8443/.well-known/est/").build();
X509CertificateHolder[] caCerts = ESTService.storeToArray(est.getCACerts(null, true));
FileReader fr = new FileReader(ESTServerUtils.makeRelativeToServerHome("/estCA/cacert.crt"));
|
10,265 | throws Exception
{
bootStrapAuthorizerCalled.set(true);
}
};
<BUG>ESTServiceBuilder est = new ESTServiceBuilder("https://localhost:8443/.well-known/est/");
X509CertificateHolder[] caCerts = ESTServiceBuilder.storeToArray(est.getCACerts(bootstrapAuthorizer, true));
FileReader fr = new FileReader(ESTServerUtils.makeRela... | ESTTestUtils.ensureProvider();
X509CertificateHolder[] theirCAs = null;
ESTServerUtils.ServerInstance serverInstance = null;
try
serverInstance = startDefaultServer();
FileReader fr = new FileReader(ESTServerUtils.makeRelativeToServerHome("/estCA/cacert.crt"));
|
10,266 | } else {
updateMemo();
callback.updateMemo();
}
dismiss();
<BUG>}else{
</BUG>
Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show();
}
}
| [DELETED] |
10,267 | }
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_memo);
<BUG>ChinaPhoneHelper.setStatusBar(this,true);
</BUG>
topicId = getIntent().getLongExtra("topicId", -1);
if (topicId == -1) {
finish();
| ChinaPhoneHelper.setStatusBar(this, true);
|
10,268 | MemoEntry.COLUMN_REF_TOPIC__ID + " = ?"
, new String[]{String.valueOf(topicId)});
}
public Cursor selectMemo(long topicId) {
Cursor c = db.query(MemoEntry.TABLE_NAME, null, MemoEntry.COLUMN_REF_TOPIC__ID + " = ?", new String[]{String.valueOf(topicId)}, null, null,
<BUG>MemoEntry._ID + " DESC", null);
</BUG>
if (c != nu... | MemoEntry.COLUMN_ORDER + " ASC", null);
|
10,269 | MemoEntry._ID + " = ?",
new String[]{String.valueOf(memoId)});
}
public long updateMemoContent(long memoId, String memoContent) {
ContentValues values = new ContentValues();
<BUG>values.put(MemoEntry.COLUMN_CONTENT, memoContent);
return db.update(</BUG>
MemoEntry.TABLE_NAME,
values,
MemoEntry._ID + " = ?",
| return db.update(
|
10,270 | import android.widget.RelativeLayout;
import android.widget.TextView;
import com.kiminonawa.mydiary.R;
import com.kiminonawa.mydiary.db.DBManager;
import com.kiminonawa.mydiary.shared.EditMode;
<BUG>import com.kiminonawa.mydiary.shared.ThemeManager;
import java.util.List;
public class MemoAdapter extends RecyclerView.A... | import com.marshalchen.ultimaterecyclerview.dragsortadapter.DragSortAdapter;
public class MemoAdapter extends DragSortAdapter<DragSortAdapter.ViewHolder> implements EditMode {
|
10,271 | private DBManager dbManager;
private boolean isEditMode = false;
private EditMemoDialogFragment.MemoCallback callback;
private static final int TYPE_HEADER = 0;
private static final int TYPE_ITEM = 1;
<BUG>public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMe... | public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback, RecyclerView recyclerView) {
super(recyclerView);
this.mActivity = activity;
|
10,272 | this.memoList = memoList;
this.dbManager = dbManager;
this.callback = callback;
}
@Override
<BUG>public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
</BUG>
View view;
if (isEditMode) {
if (viewType == TYPE_HEADER) {
| public DragSortAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
10,273 | editMemoDialogFragment.show(mActivity.getSupportFragmentManager(), "editMemoDialogFragment");
}
});
}
}
<BUG>protected class MemoViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
private View rootView;
private TextView TV_memo_item_content;</BUG>
private ImageView IV_memo_item_delete;
| protected class MemoViewHolder extends DragSortAdapter.ViewHolder implements View.OnClickListener, View.OnLongClickListener {
private ImageView IV_memo_item_dot;
private TextView TV_memo_item_content;
|
10,274 | DESC {
@Override
public String toString() {
return "desc";
}
<BUG>};
private static final SortOrder PROTOTYPE = ASC;
</BUG>
@Override
public SortOrder readFrom(StreamInput in) throws IOException {
| public static final SortOrder DEFAULT = DESC;
private static final SortOrder PROTOTYPE = DEFAULT;
|
10,275 | GeoDistance geoDistance = GeoDistance.DEFAULT;
boolean reverse = false;
MultiValueMode sortMode = null;
NestedInnerQueryParseSupport nestedHelper = null;
final boolean indexCreatedBeforeV2_0 = context.indexShard().getIndexSettings().getIndexVersionCreated().before(Version.V_2_0_0);
<BUG>boolean coerce = GeoDistanceSort... | boolean coerce = false;
boolean ignoreMalformed = false;
XContentParser.Token token;
|
10,276 | String currentName = parser.currentName();
while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
if (token == XContentParser.Token.FIELD_NAME) {
currentName = parser.currentName();
} else if (token == XContentParser.Token.START_ARRAY) {
<BUG>GeoDistanceSortBuilder.parseGeoPoints(parser, geoPoints);
... | fieldName = currentName;
|
10,277 | if (temp == MultiValueMode.SUM) {
throw new IllegalArgumentException("sort_mode [sum] isn't supported for sorting by geo distance");
}</BUG>
this.sortMode = sortMode;
return this;
<BUG>}
public String sortMode() {
return this.sortMode;</BUG>
}
public GeoDistanceSortBuilder setNestedFilter(QueryBuilder nestedFilter) {
| @Override
public GeoDistanceSortBuilder order(SortOrder order) {
this.order = order;
@Override
public SortBuilder missing(Object missing) {
public GeoDistanceSortBuilder sortMode(String sortMode) {
|
10,278 | builder.field("unit", unit);
builder.field("distance_type", geoDistance.name().toLowerCase(Locale.ROOT));
if (order == SortOrder.DESC) {</BUG>
builder.field("reverse", true);
<BUG>} else {
builder.field("reverse", false);</BUG>
}
if (sortMode != null) {
builder.field("mode", sortMode);
}
| if (geoDistance != null) {
if (order == SortOrder.DESC) {
|
10,279 | chart.addYAxisLabels(AxisLabelsFactory.newAxisLabels(labels));
chart.addXAxisLabels(AxisLabelsFactory.newNumericRangeAxisLabels(0, max));
chart.setBarWidth(BarChart.AUTO_RESIZE);
chart.setSize(600, 500);
chart.setHorizontal(true);
<BUG>chart.setTitle("Total Evaluations by User");
showChartImg(resp, chart.toURLString())... | chart.setDataEncoding(DataEncoding.TEXT);
return chart;
}
|
10,280 | checkEvaluationsEqual(eval4, foundissueProto.getEvaluations(0));
checkEvaluationsEqual(eval5, foundissueProto.getEvaluations(1));
}
public void testGetRecentEvaluationsNoneFound() throws Exception {
DbIssue issue = createDbIssue("fad", persistenceHelper);
<BUG>DbEvaluation eval1 = createEvaluation(issue, "someone", 100... | [DELETED] |
10,281 | public int read() throws IOException {
return inputStream.read();
}
});
}
<BUG>}
protected DbEvaluation createEvaluation(DbIssue issue, String who, long when) {</BUG>
DbUser user;
Query query = getPersistenceManager().newQuery("select from " + persistenceHelper.getDbUserClass().getName()
+ " where openid == :myopenid")... | @SuppressWarnings({"unchecked"})
protected DbEvaluation createEvaluation(DbIssue issue, String who, long when) {
|
10,282 | eval.setComment("my comment");
eval.setDesignation("MUST_FIX");
eval.setIssue(issue);
eval.setWhen(when);
eval.setWho(user.createKeyObject());
<BUG>eval.setEmail(who);
return eval;</BUG>
}
protected PersistenceManager getPersistenceManager() {
return testHelper.getPersistenceManager();
| issue.addEvaluation(eval);
return eval;
|
10,283 | private void _testThemeBuildScripts(Path dirPath) throws IOException {
if (!_contains(
dirPath.resolve("package.json"), "\"liferay-theme-tasks\":")) {
return;
}
<BUG>Path gulpfileJsPath = dirPath.resolve("gulpfile.js");
if (Files.notExists(gulpfileJsPath)) {
Assert.fail("Missing " + gulpfileJsPath);
}</BUG>
}
| Assert.assertTrue(
"Missing " + gulpfileJsPath, Files.exists(gulpfileJsPath));
|
10,284 | import org.apache.commons.lang3.math.NumberUtils;
import org.json.JSONException;
import org.mariotaku.microblog.library.MicroBlog;
import org.mariotaku.microblog.library.MicroBlogException;
import org.mariotaku.microblog.library.twitter.model.RateLimitStatus;
<BUG>import org.mariotaku.microblog.library.twitter.model.St... | import org.mariotaku.pickncrop.library.PNCUtils;
import org.mariotaku.sqliteqb.library.AllColumns;
|
10,285 | context.getApplicationContext().sendBroadcast(intent);
}
}
@Nullable
public static Location getCachedLocation(Context context) {
<BUG>if (BuildConfig.DEBUG) {
Log.v(LOGTAG, "Fetching cached location", new Exception());
}</BUG>
Location location = null;
| DebugLog.v(LOGTAG, "Fetching cached location", new Exception());
|
10,286 | FileBody fileBody = null;
try {
fileBody = getFileBody(context, imageUri);
twitter.updateProfileBannerImage(fileBody);
} finally {
<BUG>Utils.closeSilently(fileBody);
if (deleteImage && "file".equals(imageUri.getScheme())) {
final File file = new File(imageUri.getPath());
if (!file.delete()) {
Log.w(LOGTAG, String.form... | if (deleteImage) {
Utils.deleteMedia(context, imageUri);
|
10,287 | FileBody fileBody = null;
try {
fileBody = getFileBody(context, imageUri);
twitter.updateProfileBackgroundImage(fileBody, tile);
} finally {
<BUG>Utils.closeSilently(fileBody);
if (deleteImage && "file".equals(imageUri.getScheme())) {
final File file = new File(imageUri.getPath());
if (!file.delete()) {
Log.w(LOGTAG, S... | twitter.updateProfileBannerImage(fileBody);
if (deleteImage) {
Utils.deleteMedia(context, imageUri);
|
10,288 | FileBody fileBody = null;
try {
fileBody = getFileBody(context, imageUri);
return twitter.updateProfileImage(fileBody);
} finally {
<BUG>Utils.closeSilently(fileBody);
if (deleteImage && "file".equals(imageUri.getScheme())) {
final File file = new File(imageUri.getPath());
if (!file.delete()) {
Log.w(LOGTAG, String.for... | twitter.updateProfileBannerImage(fileBody);
if (deleteImage) {
Utils.deleteMedia(context, imageUri);
|
10,289 | import org.mariotaku.twidere.receiver.NotificationReceiver;
import org.mariotaku.twidere.service.LengthyOperationsService;
import org.mariotaku.twidere.util.ActivityTracker;
import org.mariotaku.twidere.util.AsyncTwitterWrapper;
import org.mariotaku.twidere.util.DataStoreFunctionsKt;
<BUG>import org.mariotaku.twidere.u... | import org.mariotaku.twidere.util.DebugLog;
import org.mariotaku.twidere.util.ImagePreloader;
|
10,290 | final List<InetAddress> addresses = mDns.lookup(host);
for (InetAddress address : addresses) {
c.addRow(new String[]{host, address.getHostAddress()});
}
} catch (final IOException ignore) {
<BUG>if (BuildConfig.DEBUG) {
Log.w(LOGTAG, ignore);
}</BUG>
}
| DebugLog.w(LOGTAG, null, ignore);
|
10,291 | for (Location location : twitter.getAvailableTrends()) {
map.put(location);
}
return map.pack();
} catch (final MicroBlogException e) {
<BUG>if (BuildConfig.DEBUG) {
Log.w(LOGTAG, e);
}</BUG>
}
| DebugLog.w(LOGTAG, null, e);
|
10,292 | import android.content.Context;
import android.content.SharedPreferences;
import android.location.Location;
import android.os.AsyncTask;
import android.support.annotation.NonNull;
<BUG>import android.util.Log;
import org.mariotaku.twidere.BuildConfig;
import org.mariotaku.twidere.Constants;
import org.mariotaku.twidere... | import org.mariotaku.twidere.util.DebugLog;
import org.mariotaku.twidere.util.JsonSerializer;
|
10,293 | }
public static LatLng getCachedLatLng(@NonNull final Context context) {
final Context appContext = context.getApplicationContext();
final SharedPreferences prefs = DependencyHolder.Companion.get(context).getPreferences();
if (!prefs.getBoolean(KEY_USAGE_STATISTICS, false)) return null;
<BUG>if (BuildConfig.DEBUG) {
Lo... | DebugLog.d(HotMobiLogger.LOGTAG, "getting cached location", null);
|
10,294 | public int destroySavedSearchAsync(final UserKey accountKey, final long searchId) {
final DestroySavedSearchTask task = new DestroySavedSearchTask(accountKey, searchId);
return asyncTaskManager.add(task, true);
}
public int destroyStatusAsync(final UserKey accountKey, final String statusId) {
<BUG>final DestroyStatusTa... | final DestroyStatusTask task = new DestroyStatusTask(context, accountKey, statusId);
|
10,295 | @Override
public void afterExecute(Bus handler, SingleResponse<Relationship> result) {
if (result.hasData()) {
handler.post(new FriendshipUpdatedEvent(accountKey, userKey, result.getData()));
} else if (result.hasException()) {
<BUG>if (BuildConfig.DEBUG) {
Log.w(LOGTAG, "Unable to update friendship", result.getExcepti... | public UserKey[] getAccountKeys() {
return DataStoreUtils.getActivatedAccountKeys(context);
|
10,296 | MicroBlog microBlog = MicroBlogAPIFactory.getInstance(context, accountId);
if (!Utils.isOfficialCredentials(context, accountId)) continue;
try {
microBlog.setActivitiesAboutMeUnread(cursor);
} catch (MicroBlogException e) {
<BUG>if (BuildConfig.DEBUG) {
Log.w(LOGTAG, e);
}</BUG>
}
| DebugLog.w(LOGTAG, null, e);
|
10,297 | this.popularity = Boolean.valueOf(prop.getProperty("popularity"));
this.context = Boolean.valueOf(prop.getProperty("context"));
this.acronym = Boolean.valueOf(prop.getProperty("acronym"));
this.commonEntities = Boolean.valueOf(prop.getProperty("commonEntities"));
}
<BUG>public void insertCandidatesIntoText(DirectedSpar... | public void insertCandidatesIntoText(DirectedSparseGraph<Node, String> graph, Document document,
NamedEntitiesInText namedEntities = document.getNamedEntitiesInText();
|
10,298 | long start = System.currentTimeMillis();
if (heuristicExpansionOn) {
label = heuristicExpansion(heuristicExpansion, label);
}
checkLabelCandidates(graph, threshholdTrigram, nodes, entity, label, false, entities);
<BUG>log.info("\tGraph size: " + graph.getVertexCount() + " took: " + (System.currentTimeMillis() - start) ... | log.info("\tGraph size: " + graph.getVertexCount() + " took: " + (System.currentTimeMillis() - start)
|
10,299 | if (!expansion) {
heuristicExpansion.add(label);
}
return label;
}
<BUG>public void addNodeToGraph(DirectedSparseGraph<Node, String> graph, HashMap<String, Node> nodes, NamedEntityInText entity, Triple c, String candidateURL) throws IOException {
Node currentNode = new Node(candidateURL, 0, 0);</BUG>
log.debug("Candida... | public void addNodeToGraph(DirectedSparseGraph<Node, String> graph, HashMap<String, Node> nodes,
Node currentNode = new Node(candidateURL, 0, 0);
|
10,300 | public class DomainWhiteLister {
private TripleIndex index;
HashSet<String> whiteList = new HashSet<String>();
public DomainWhiteLister(TripleIndex index) throws IOException {
Properties prop = new Properties();
<BUG>InputStream input =DomainWhiteLister.class.getResourceAsStream("/config/agdistis.properties");
</BUG>
p... | InputStream input = DomainWhiteLister.class.getResourceAsStream("/config/agdistis.properties");
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.