id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
23,601 | import java.util.regex.Pattern;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.puredark.hviewer.R;
import ml.puredark.hviewer.beans.Category;
<BUG>import ml.puredark.hviewer.beans.CommentRule;
import ml.puredark.hviewer.beans.Rule;</BUG>
import ml.puredark.hviewer.beans.Selector;
import ml.pured... | import ml.puredark.hviewer.beans.PictureRule;
import ml.puredark.hviewer.beans.Rule;
|
23,602 | inputGalleryRulePictureUrlReplacement.setText(site.galleryRule.pictureUrl.replacement);
}
if (site.galleryRule.pictureHighRes != null) {
inputGalleryRulePictureHighResSelector.setText(joinSelector(site.galleryRule.pictureHighRes));
inputGalleryRulePictureHighResRegex.setText(site.galleryRule.pictureHighRes.regex);
<BUG... | [DELETED] |
23,603 | inputExtraRuleCommentDatetimeReplacement.setText(site.extraRule.commentDatetime.replacement);
}
if (site.extraRule.commentContent != null) {
inputExtraRuleCommentContentSelector.setText(joinSelector(site.extraRule.commentContent));
inputExtraRuleCommentContentRegex.setText(site.extraRule.commentContent.regex);
<BUG>inp... | [DELETED] |
23,604 | lastSite.galleryRule.cover = loadSelector(inputGalleryRuleCoverSelector, inputGalleryRuleCoverRegex, inputGalleryRuleCoverReplacement);
lastSite.galleryRule.category = loadSelector(inputGalleryRuleCategorySelector, inputGalleryRuleCategoryRegex, inputGalleryRuleCategoryReplacement);
lastSite.galleryRule.datetime = load... | lastSite.galleryRule.pictureRule = (lastSite.galleryRule.pictureRule == null) ? new PictureRule() : lastSite.galleryRule.pictureRule;
lastSite.galleryRule.pictureRule.thumbnail = loadSelector(inputGalleryRulePictureThumbnailSelector, inputGalleryRulePictureThumbnailRegex, inputGalleryRulePictureThumbnailReplacement);
l... |
23,605 | lastSite.extraRule.cover = loadSelector(inputExtraRuleCoverSelector, inputExtraRuleCoverRegex, inputExtraRuleCoverReplacement);
lastSite.extraRule.category = loadSelector(inputExtraRuleCategorySelector, inputExtraRuleCategoryRegex, inputExtraRuleCategoryReplacement);
lastSite.extraRule.datetime = loadSelector(inputExtr... | lastSite.extraRule.pictureRule = (lastSite.extraRule.pictureRule == null) ? new PictureRule() : lastSite.extraRule.pictureRule;
lastSite.extraRule.pictureRule.thumbnail = loadSelector(inputExtraRulePictureThumbnailSelector, inputExtraRulePictureThumbnailRegex, inputExtraRulePictureThumbnailReplacement);
lastSite.extraR... |
23,606 | notifyItemChanged(position);
if (mItemClickListener != null)
mItemClickListener.onItemClick(v, position);
}
});
<BUG>if (tag.selected)
label.getChildAt(0).setBackgroundResource(R.color.colorPrimary);
else
label.getChildAt(0).setBackgroundResource(R.color.dimgray);</BUG>
}
| [DELETED] |
23,607 | loadPicture(picture, task, null, true);
} else if (!TextUtils.isEmpty(picture.pic) && !highRes) {
picture.retries = 0;
loadPicture(picture, task, null, false);
} else if (task.collection.site.hasFlag(Site.FLAG_SINGLE_PAGE_BIG_PICTURE)
<BUG>&& task.collection.site.extraRule != null
&& task.collection.site.extraRule.pic... | && task.collection.site.extraRule != null) {
if(task.collection.site.extraRule.pictureRule != null && task.collection.site.extraRule.pictureRule.url != null)
getPictureUrl(picture, task, task.collection.site.extraRule.pictureRule.url, task.collection.site.extraRule.pictureRule.highRes);
else if(task.collection.site.ext... |
23,608 | if (Picture.hasPicPosfix(picture.url)) {
picture.pic = picture.url;
loadPicture(picture, task, null, false);
} else
if (task.collection.site.hasFlag(Site.FLAG_JS_NEEDED_ALL)) {
<BUG>new Handler(Looper.getMainLooper()).post(()->{
</BUG>
WebView webView = new WebView(HViewerApplication.mContext);
WebSettings mWebSettings... | new Handler(Looper.getMainLooper()).post(() -> {
|
23,609 | package model;
import model.battlefield.Battlefield;
import model.battlefield.BattlefieldFactory;
<BUG>import model.battlefield.map.parcel.ParcelManager;
import model.builders.entity.definitions.DefParser;</BUG>
import event.BattleFieldUpdateEvent;
import event.EventManager;
import geometry.tools.LogUtil;
| import model.builders.MapArtisan;
import model.builders.entity.definitions.DefParser;
|
23,610 | private static void setBattlefield(Battlefield battlefield) {
if (battlefield != null) {
ModelManager.battlefield = battlefield;
battlefieldReady = true;
ParcelManager.createParcelMeshes(ModelManager.getBattlefield().getMap());
<BUG>getBattlefield().getMap().resetTrinkets();
getBattlefield().getEngagement().reset();</B... | MapArtisan.act(getBattlefield().getMap());
getBattlefield().getEngagement().reset();
|
23,611 | package controller.editor;
<BUG>import model.ModelManager;
import model.battlefield.lighting.SunLight;</BUG>
import model.editor.ToolManager;
import com.jme3.input.InputManager;
import com.jme3.input.KeyInput;
| import model.Reporter;
import model.battlefield.lighting.SunLight;
|
23,612 | protected final static String DEC_GREEN = "decgreen";
protected final static String DEC_BLUE = "decblue";
protected final static String RESET_COLOR = "resetcolor";
protected final static String SAVE = "save";
protected final static String LOAD = "load";
<BUG>protected final static String NEW = "new";
boolean analogUnpr... | protected final static String REPORT = "report";
boolean analogUnpressed = false;
|
23,613 | mappings = new String[] { SWITCH_CTRL_1, SWITCH_CTRL_2, SWITCH_CTRL_3,
PRIMARY_ACTION, SECONDARY_ACTION, TOGGLE_PENCIL_SHAPE, TOGGLE_PENCIL_MODE, INC_SELECTOR_RADIUS, DEC_SELECTOR_RADIUS, SET_CLIFF_TOOL, SET_HEIGHT_TOOL,
SET_ATLAS_TOOL, SET_RAMP_TOOL, SET_UNIT_TOOL,
TOGGLE_GRID, TOGGLE_SOWER, TOGGLE_SET, TOGGLE_OPERATI... | DEC_BLUE, RESET_COLOR, SAVE, LOAD, NEW, REPORT};
|
23,614 | inputManager.addMapping(DEC_GREEN, new KeyTrigger(KeyInput.KEY_NUMPAD2));
inputManager.addMapping(DEC_BLUE, new KeyTrigger(KeyInput.KEY_NUMPAD3));
inputManager.addMapping(RESET_COLOR, new KeyTrigger(KeyInput.KEY_NUMPAD0));
inputManager.addMapping(SAVE, new KeyTrigger(KeyInput.KEY_F5));
inputManager.addMapping(LOAD, new... | inputManager.addMapping(REPORT, new KeyTrigger(KeyInput.KEY_SPACE));
inputManager.addListener(this, mappings);
|
23,615 | case LOAD:
ModelManager.loadBattlefield();
break;
case NEW:
ModelManager.setNewBattlefield();
<BUG>break;
}</BUG>
ctrl.guiController.askRedraw();
}
}
| case REPORT:
Reporter.reportAll();
|
23,616 | List<MapStyleBuilder> builders = BuilderManager.getAllMapStyleBuilders();
List<String> ids = new ArrayList<>();
for (MapStyleBuilder b : builders) {
ids.add(b.getId());
}
<BUG>int selIndex = ids.indexOf(ModelManager.getBattlefield().getMap().mapStyleID);
</BUG>
fillDropDown(DROPDOWN_STYLE_ID, ids, selIndex);
}
private ... | int selIndex = ids.indexOf(ModelManager.getBattlefield().getMap().getMapStyleID());
|
23,617 | <BUG>package geometry.structure.grid;
public class Node {
protected final int index;
protected final Grid<? extends Node> grid;
public Node(Grid<? extends Node> grid, int index) {</BUG>
this.grid = grid;
| import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
@JsonProperty
@JsonIgnore
protected Grid<? extends Node> grid;
public Node(Grid<? extends Node> grid, int index) {
|
23,618 | package geometry.structure.grid;
import geometry.collections.Map2D;
import geometry.geom2d.Point2D;
import java.util.ArrayList;
import java.util.List;
<BUG>public class Grid<T extends Node> extends Map2D<T> {
public Grid(int width, int height) {</BUG>
super(width, height);
}
public T getNorthNode(T n){
| public Grid(){
super();
public Grid(int width, int height) {
|
23,619 | import geometry.geom2d.Point2D;
import geometry.geom3d.Point3D;
import geometry.geom3d.Triangle3D;
import geometry.math.Angle;
import geometry.structure.grid.Grid;
<BUG>public class Grid3D<T extends Node3D> extends Grid<T> {
public Grid3D(int width, int height) {</BUG>
super(width, height);
}
private Triangle3D getTria... | public Grid3D(){
super();
public Grid3D(int width, int height) {
|
23,620 | import java.util.ArrayList;
import java.util.List;
public class Map2D<E> {
private List<E> values;
protected int xSize;
<BUG>protected int ySize;
public Map2D(int xSize, int ySize) {</BUG>
this(xSize, ySize, null);
}
public Map2D(int xSize, int ySize, E defaultVal) {
| public Map2D(){
public Map2D(int xSize, int ySize) {
|
23,621 | }
public Map2D(int xSize, int ySize, E defaultVal) {
this.xSize = xSize;
this.ySize = ySize;
values = new ArrayList<>(xSize*ySize);
<BUG>setAll(defaultVal);
</BUG>
}
public void set(int index, E val) {
values.set(index, val);
| public Map2D(int xSize, int ySize) {
this(xSize, ySize, null);
setAllAs(defaultVal);
|
23,622 | return x >= 0 && x < xSize && y >= 0 && y < ySize;
}
public boolean isInBounds(Point2D p){
return isInBounds((int)p.x, (int)p.y);
}
<BUG>public void setAll(E value){
</BUG>
values.clear();
for (int i = 0; i < xSize*ySize; i++)
values.add(value);
| private void setAllAs(E value){
|
23,623 | values.clear();
for (int i = 0; i < xSize*ySize; i++)
values.add(value);
}
public List<E> getAll(){
<BUG>return values;
}</BUG>
public int getIndex(int x, int y){
return y*xSize+x;
}
| protected void setAll(List<E> values){
this.values = values;
|
23,624 | import model.ModelManager;
import model.battlefield.map.Map;
import model.battlefield.map.Tile;
import model.battlefield.map.cliff.Cliff;
import model.battlefield.map.cliff.Ramp;
<BUG>import model.battlefield.map.parcel.ParcelManager;
import model.builders.entity.MapStyleBuilder;</BUG>
import model.builders.entity.defi... | import model.builders.MapArtisan;
import model.builders.entity.MapStyleBuilder;
|
23,625 | }
}
LogUtil.logger.info(" map builders");</BUG>
Battlefield res = new Battlefield();
<BUG>res.setMap(m);
LogUtil.logger.info("Loading done.");</BUG>
return res;
}
public Battlefield loadWithFileChooser() {
final JFileChooser fc = new JFileChooser(ModelManager.DEFAULT_MAP_PATH);
| public Battlefield getNew(int width, int height) {
LogUtil.logger.info("Creating new battlefield...");
MapArtisan.buildMap(res);
LogUtil.logger.info("Loading done.");
|
23,626 | try {
LogUtil.logger.info("Loading battlefield " + file.getCanonicalPath() + "...");
ObjectMapper mapper = new ObjectMapper(); // can reuse, share globally
bField = mapper.readValue(file, Battlefield.class);
bField.setFileName(file.getCanonicalPath());
<BUG>bField.getMap().atlas.finalize();
bField.getMap().cover.finali... | [DELETED] |
23,627 | category = (null == category) ? entry.getValue().getDescriptor().getDefaultCategory() : category;
Set<String> macroNames = result.get(category);
if (null == macroNames) {
macroNames = new HashSet<String>();
}
<BUG>macroNames.add(entry.getKey());
result.put(category, macroNames);</BUG>
}
}
return result;
| macroNames.add(macroName);
result.put(category, macroNames);
|
23,628 | super(project, false);
setTitle("Close Task");
myTaskLabel.setText(TaskUtil.getTrimmedSummary(task));
myTaskLabel.setIcon(task.getIcon());
TaskRepository repository = task.getRepository();
<BUG>boolean visible = task.isIssue() && repository != null && repository.getRepositoryType().getPossibleTaskStates().contains(Task... | boolean visible = task.isIssue() && TaskUtil.isStateSupported(repository, TaskState.RESOLVED);
myCloseIssue.setVisible(visible);
|
23,629 | ControlBinder binder = new ControlBinder(manager.getState());
binder.bindAnnotations(this);
binder.reset();
TaskRepository repository = task.getRepository();
myMarkAsInProgressBox.setSelected(manager.getState().markAsInProgress);
<BUG>if (repository == null || !repository.getRepositoryType().getPossibleTaskStates().con... | if (!TaskUtil.isStateSupported(repository, TaskState.IN_PROGRESS)) {
myMarkAsInProgressBox.setVisible(false);
|
23,630 | import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.JDOMUtil;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.CharsetToolkit;
import com.intellij.tasks.Task;
<BUG>import com.intellij.tasks.TaskRepository;
import org.jdom.Element;
import org.jetbrains.annotation... | import com.intellij.tasks.TaskState;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
|
23,631 | "(\\d{4}[/-]\\d{2}[/-]\\d{2})" + // date
"(?:[ T]" +
"(\\d{2}:\\d{2}:\\d{2})(.\\d{3,})?" + // optional time and milliseconds
"(?:\\s?" +
"([+-]\\d{2}:\\d{2}|[+-]\\d{4}|[+-]\\d{2}|Z)" + // optional timezone info, if time is also present
<BUG>")?)?");
private TaskUtil() {</BUG>
}
public static String formatTask(@NotNull ... | ")?)?"
private TaskUtil() {
|
23,632 | @Tag("JIRA")
public class JiraRepository extends BaseRepositoryImpl {
public static final Gson GSON = GsonUtil.createDefaultBuilder().create();
private final static Logger LOG = Logger.getInstance(JiraRepository.class);
public static final String REST_API_PATH = "/rest/api/latest";
<BUG>private static final boolean DEB... | private static final boolean LEGACY_API_ONLY = Boolean.getBoolean("tasks.jira.legacy.api.only");
private static final boolean REDISCOVER_API = Boolean.getBoolean("tasks.jira.rediscover.api");
|
23,633 | throw new Exception(TaskBundle.message("jira.failure.no.REST"));
}
return restApi;
}
private void ensureApiVersionDiscovered() throws Exception {
<BUG>if (myApiVersion == null || DEBUG_SOAP || REDISCOVER_API) {
</BUG>
myApiVersion = discoverApiVersion();
}
}
| if (myApiVersion == null || LEGACY_API_ONLY || REDISCOVER_API) {
|
23,634 | super.configureHttpClient(client);
client.getParams().setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY);
}
@Override
protected int getFeatures() {
<BUG>int features = super.getFeatures() | TIME_MANAGEMENT;
if (myApiVersion == null || myApiVersion.getType() == JiraRemoteApi.ApiType.SOAP) {
return features & ~NATIVE_SE... | int features = super.getFeatures();
} else {
return features | TIME_MANAGEMENT | STATE_UPDATING;
|
23,635 | 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;
|
23,636 | 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;
|
23,637 | 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"),
|
23,638 | 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] |
23,639 | 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) {
|
23,640 | 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;
|
23,641 | import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.concurrent.locks.Lock;
<BUG>import java.util.concurrent.locks.ReentrantLock;
public abstract class AbstractSecondOrderCollector extends Collector implements
SecondOrderCollector {</BUG>
protec... | import org.apache.lucene.index.LeafReaderContext;
public abstract class AbstractSecondOrderCollector implements Collector, LeafCollector, SecondOrderCollector {
|
23,642 | lock = new ReentrantLock();
hits = new ArrayList<CollectorDoc>();
<BUG>}
public boolean searcherInitialization(IndexSearcher searcher, Weight firstOrderWeight) throws IOException {
((ArrayList<CollectorDoc>) hits).ensureCapacity((int) (searcher.getIndexReader().maxDoc() * ensureCapacityRatio));
if (firstOrderWeight != ... | protected void doSetNextReader(LeafReaderContext context) throws IOException {
this.context = context;
this.docBase = context.docBase;
|
23,643 | private String boostField;
private float highestLuceneScore;
private float lucenePart;
private float adsPart;
private CacheWrapper cache;
<BUG>private LuceneCacheWrapper<Floats> boostCache;
public SecondOrderCollectorAdsClassicScoringFormula(SolrCacheWrapper cache, LuceneCacheWrapper<Floats> boostCache, float ratio) {... | private LuceneCacheWrapper<NumericDocValues> boostCache;
public SecondOrderCollectorAdsClassicScoringFormula(SolrCacheWrapper cache, LuceneCacheWrapper<NumericDocValues> boostCache, float ratio) {
|
23,644 | this.cache = cache;
this.lucenePart = ratio;
this.adsPart = 1.0f - ratio;
this.boostCache = boostCache;
}
<BUG>public SecondOrderCollectorAdsClassicScoringFormula(CacheWrapper cache, LuceneCacheWrapper<Floats> boostCache) {
</BUG>
this.cache = cache;
this.lucenePart = 0.5f;
this.adsPart = 0.5f;
| public SecondOrderCollectorAdsClassicScoringFormula(CacheWrapper cache, LuceneCacheWrapper<NumericDocValues> boostCache) {
|
23,645 | package org.apache.lucene.search;
import java.io.IOException;
<BUG>import org.apache.lucene.index.AtomicReaderContext;
public class SecondOrderCollectorCitedBy extends AbstractSecondOrderCollector {</BUG>
private SolrCacheWrapper cache;
public SecondOrderCollectorCitedBy(SolrCacheWrapper cache) {
super();
| import org.apache.lucene.index.LeafReaderContext;
public class SecondOrderCollectorCitedBy extends AbstractSecondOrderCollector {
|
23,646 | for (int citingDoc: v) {
hits.add(new CollectorDoc(citingDoc, s, -1, freq));
}
}
@Override
<BUG>public boolean acceptsDocsOutOfOrder() {
return true;
}
@Override</BUG>
public String toString() {
| [DELETED] |
23,647 | package org.apache.lucene.search;
import java.io.IOException;
import java.lang.ref.Reference;
<BUG>import java.lang.ref.SoftReference;
import org.apache.commons.lang.NotImplementedException;
import org.apache.lucene.index.AtomicReader;
import org.apache.lucene.search.FieldCache.Floats;
import org.apache.solr.common.So... | import java.util.HashMap;
import java.util.Map;
import org.apache.lucene.index.LeafReader;
import org.apache.lucene.index.NumericDocValues;
import org.apache.solr.uninverting.UninvertingReader;
|
23,648 | package org.apache.lucene.search;
import java.io.IOException;
import java.util.Set;
<BUG>import org.apache.lucene.index.AtomicReaderContext;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.search.FieldCache.Floats;</BUG>
import org.apache.solr.search.CitationLRUCache;
| import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.index.NumericDocValues;
|
23,649 | Set<String> fieldsToLoad;
protected String referenceField;
protected String[] uniqueIdField;
protected String boostField;
private SolrCacheWrapper<CitationLRUCache<Object, Integer>> cache;
<BUG>private LuceneCacheWrapper<Floats> boostCache;
public SecondOrderCollectorOperatorExpertsCiting(SolrCacheWrapper<CitationLRUC... | private LuceneCacheWrapper<NumericDocValues> boostCache;
public SecondOrderCollectorOperatorExpertsCiting(
SolrCacheWrapper<CitationLRUCache<Object, Integer>> cache,
LuceneCacheWrapper<NumericDocValues> boostWrapper) {
super();
|
23,650 | import java.util.Date;
import java.util.HashMap;
import java.util.Properties;
import edu.isi.wings.catalog.component.ComponentFactory;
import edu.isi.wings.catalog.data.DataFactory;
<BUG>import edu.isi.wings.catalog.data.classes.VariableBindingsList;
import edu.isi.wings.catalog.resource.ResourceFactory;
import edu.isi... | import edu.isi.wings.catalog.data.classes.VariableBindingsListSet;
import edu.isi.wings.common.CollectionsHelper;
import edu.isi.wings.common.URIEntity;
|
23,651 | varid = var.getID();
roleid = varMaps.get(var.getID()).getID();
if (!checkTypeCompatibility(tkb, varid, arg.getID())) {
logger.debug(arg.getID() + " is not type compatible with variable: "
+ varid);
<BUG>explanations.add("INFO "+tcomp + " is not selectable because " + arg.getID()
</BUG>
+ " is not type compatible with ... | explanations.add("INFO "+ccomp + " is not selectable because " + arg.getID()
|
23,652 | sRoleMap.put(r, var);
varids.add(var.getID());
}
ArrayList<KBTriple> empty = new ArrayList<KBTriple>();
if (!typesOk) {
<BUG>logger.debug(tcomp + " is not selectable ");
explanations.add("INFO " + tcomp + " is not selectable ");
</BUG>
cmr = new ComponentPacket(concreteComponent, sRoleMap, empty);
| logger.debug(ccomp + " is not selectable ");
explanations.add("INFO " + ccomp + " is not selectable ");
|
23,653 | if (useRules && ccomp.hasRules()) {
ByteArrayOutputStream bost = new ByteArrayOutputStream();
PrintStream oldout = System.out;
System.setOut(new PrintStream(bost, true));
tkb.setRulePrefixes(this.rulePrefixes);
<BUG>tkb.applyRules(this.getComponentRules(ccomp.getID()));
</BUG>
if (!bost.toString().equals("")) {
for (St... | tkb.applyRules(this.getCachedComponentRules(ccomp));
|
23,654 | System.setOut(oldout);
}
KBObject invalidProp = tkb.getProperty(this.pcns + "isInvalid");
KBObject isInvalid = tkb.getPropertyValue(tcomp, invalidProp);
if (isInvalid != null && (Boolean) isInvalid.getValue()) {
<BUG>logger.debug(tcomp + " is not selectable ");
explanations.add("INFO " + tcomp + " is not selectable ")... | logger.debug(ccomp + " is not selectable ");
explanations.add("INFO " + ccomp + " is not selectable ");
|
23,655 | details.setInvalidFlag(true);
list.add(details);
return list;
}
c.setRequirements(comp.getComponentRequirement());
<BUG>if(!comp.hasRules()) {
ArrayList<String> inputRoles = new ArrayList<String>();</BUG>
for(ComponentRole role : comp.getInputs()) {
inputRoles.add(role.getRoleName());
Variable v = sRoleMap.get(role.get... | boolean typesOk = true;
ArrayList<String> inputRoles = new ArrayList<String>();
|
23,656 | if(role.isParam()) {
if(v.getBinding() == null)
v.setBinding(new ValueBinding(role.getParamDefaultalue()));
else if(v.getBinding().getValue() == null)
v.getBinding().setValue(role.getParamDefaultalue());
<BUG>}
}
details.setInputRoles(inputRoles);
list.add(details);</BUG>
return list;
| [DELETED] |
23,657 | KBObject dcPropD = this.kb.getProperty(this.dcns + "hasDataMetrics");
ArrayList<KBTriple> metricTriples = this.kb.genericTripleQuery(null, rdfsProp, dcProp);
metricTriples.addAll(this.kb.genericTripleQuery(null, rdfsProp, dcPropD));</BUG>
tkb.addTriples(metricTriples);
<BUG>ArrayList<KBObject> metricProps = this.kb
.ge... | tkb.addTriple(tcomp, omap.get("hasInput"), varobj);
} else {
tkb.addTriple(tcomp, omap.get("hasOutput"), varobj);
}
}
|
23,658 | new Metric(Metric.URI, val.getID()));
}
var.getBinding().setMetrics(metrics);
}
}
<BUG>KBRuleList rules = this.getComponentRules(comp.getID());
</BUG>
if(rules.getRules().size() > 0) {
ByteArrayOutputStream bost = new ByteArrayOutputStream();
PrintStream oldout = System.out;
| KBRuleList rules = this.getCachedComponentRules(comp);
|
23,659 | if(rules.getRules().size() > 0) {
ByteArrayOutputStream bost = new ByteArrayOutputStream();
PrintStream oldout = System.out;
System.setOut(new PrintStream(bost, true));
tkb.setRulePrefixes(this.rulePrefixes);
<BUG>tkb.applyRules(this.getComponentRules(comp.getID()));
if (!bost.toString().equals("")) {</BUG>
for (String... | tkb.applyRules(rules);
if (!bost.toString().equals("")) {
|
23,660 | details.addExplanations(exp);
}
}
System.setOut(oldout);
}
<BUG>KBObject invalidProp = tkb.getProperty(this.pcns + "isInvalid");
KBObject isInvalid = tkb.getPropertyValue(tcomp, invalidProp);</BUG>
if (isInvalid != null && (Boolean) isInvalid.getValue()) {
details.addExplanations("INFO "+tcomp + " is not valid for its ... | KBObject invalidProp = this.dataPropMap.get("isInvalid");
KBObject isInvalid = tkb.getPropertyValue(tcomp, invalidProp);
|
23,661 | ComponentRequirement req = this.getComponentRequirements(tcomp, tkb);
if(req != null) {
if(req.getMemoryGB() != 0)
c.getRequirements().setMemoryGB(req.getMemoryGB());
if(req.getStorageGB() != 0)
<BUG>c.getRequirements().setMemoryGB(req.getStorageGB());
</BUG>
}
for (Variable var : sRoleMap.values()) {
if (var.isParamet... | c.getRequirements().setStorageGB(req.getStorageGB());
|
23,662 | for (KBObject metricProp : metricProps) {
ArrayList<KBObject> vals = tkb.getPropertyValues(varobj, metricProp);
if(vals == null)
continue;
for(KBObject val : vals) {
<BUG>if(vals.size() > 1) {
for(Metric mval : curmetrics.getMetrics().get(metricProp.getID())) {</BUG>
if(!val.isLiteral() && val.getID().equals(mval.getVa... | if(!curmetrics.getMetrics().containsKey(metricProp.getID()))
for(Metric mval : curmetrics.getMetrics().get(metricProp.getID())) {
|
23,663 | else
metrics.addMetric(metricProp.getID(),
new Metric(Metric.URI, val.getID()));
}
}
<BUG>ArrayList<KBObject> clses = tkb.getAllClassesOfInstance(varobj, true);
</BUG>
for (KBObject cls : clses)
metrics.addMetric(KBUtils.RDF + "type", new Metric(Metric.URI, cls.getID()));
if (var.getBinding() != null)
| ArrayList<KBObject> clses = this.getAllClassesOfInstance(tkb, varobj.getID());
|
23,664 | package edu.isi.wings.planner.api;
import java.util.ArrayList;
import edu.isi.wings.catalog.component.api.ComponentReasoningAPI;
import edu.isi.wings.catalog.data.api.DataReasoningAPI;
<BUG>import edu.isi.wings.catalog.data.classes.VariableBindingsList;
import edu.isi.wings.workflow.plan.api.ExecutionPlan;</BUG>
import... | import edu.isi.wings.catalog.data.classes.VariableBindingsListSet;
import edu.isi.wings.workflow.plan.api.ExecutionPlan;
|
23,665 | public void useComponentService(ComponentReasoningAPI pc);
public Seed loadSeed(String seedName);
public Template loadTemplate(String templateName);
public Template getInferredTemplate(Template template);
public ArrayList<Template> specializeTemplates(Template template);
<BUG>public ArrayList<VariableBindingsList> sele... | public VariableBindingsListSet selectInputDataObjects(Template specializedTemplate);
|
23,666 | if (weight == 0) {
resurrect[0] = true;
return n;
}
}
<BUG>writer.delete(key, value, actualCause);
removed[0] = true;</BUG>
return null;
});
| writer.delete(key, value[0], actualCause[0]);
makeDead(n);
removed[0] = true;
|
23,667 | Map<K, V> castResult = (Map<K, V>) result;
return Collections.unmodifiableMap(castResult);
}
@Override
public V put(K key, V value) {
<BUG>int weight = weigher.weigh(key, value);
return (weight > 0)
? putFast(key, value, weight, /* notifyWriter */ true, /* onlyIfAbsent */ false)
: putSlow(key, value, weight, /* notifyW... | [DELETED] |
23,668 | : putSlow(key, value, weight, /* notifyWriter */ true, /* onlyIfAbsent */ false);
</BUG>
}
@Override
public V put(K key, V value, boolean notifyWriter) {
<BUG>int weight = weigher.weigh(key, value);
return (weight > 0)
? putFast(key, value, weight, notifyWriter, /* onlyIfAbsent */ false)
: putSlow(key, value, weight, n... | Map<K, V> castResult = (Map<K, V>) result;
return Collections.unmodifiableMap(castResult);
public V put(K key, V value) {
return put(key, value, /* notifyWriter */ true, /* onlyIfAbsent */ false);
return put(key, value, notifyWriter, /* onlyIfAbsent */ false);
|
23,669 | : putSlow(key, value, weight, notifyWriter, /* onlyIfAbsent */ false);
</BUG>
}
@Override
public V putIfAbsent(K key, V value) {
<BUG>int weight = weigher.weigh(key, value);
return (weight > 0)
? putFast(key, value, weight, /* notifyWriter */ true, /* onlyIfAbsent */ true)
: putSlow(key, value, weight, /* notifyWriter ... | Map<K, V> castResult = (Map<K, V>) result;
return Collections.unmodifiableMap(castResult);
public V put(K key, V value) {
return put(key, value, /* notifyWriter */ true, /* onlyIfAbsent */ false);
public V put(K key, V value, boolean notifyWriter) {
return put(key, value, notifyWriter, /* onlyIfAbsent */ false);
return... |
23,670 | import org.openjdk.jmh.annotations.Param;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.Setup;
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.annotations.Threads;
<BUG>import com.google.common.cache.CacheBuilder;
import com.yahoo.ycsb.generator.NumberGenerator;</BUG>
imp... | import com.google.common.cache.CacheLoader;
import com.yahoo.ycsb.generator.NumberGenerator;
|
23,671 | public class ComputeBenchmark {
static final int SIZE = (2 << 14);
static final int MASK = SIZE - 1;
static final int ITEMS = SIZE / 3;
static final Integer COMPUTE_KEY = SIZE / 2;
<BUG>static final Callable<Boolean> valueLoader = () -> Boolean.TRUE;
static final Function<Integer, Boolean> mappingFunction = any -> Bool... | static final CacheLoader<Integer, Boolean> cacheLoader = CacheLoader.from(key -> Boolean.TRUE);
@Param({"ConcurrentHashMap", "Caffeine", "Guava"})
|
23,672 | }
}
});
}
} else {
<BUG>if (n <= m) {
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {</BUG>
a[i][j] = operator.applyAsBoolean(a[i][j]);
}
| public boolean[] row(final int rowIndex) {
N.checkArgument(rowIndex >= 0 && rowIndex < n, "Invalid row Index: %s", rowIndex);
return a[rowIndex];
|
23,673 | }
}
});
}
} else {
<BUG>if (n <= m) {
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {</BUG>
result[i][j] = zipFunction.apply(a[i][j], b[i][j]);
}
| public boolean get(final int i, final int j) {
return a[i][j];
|
23,674 | }
}
});
}
} else {
<BUG>if (n <= m) {
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {</BUG>
result[i][j] = zipFunction.apply(a[i][j], b[i][j], c[i][j]);
}
| return new BooleanMatrix(c);
|
23,675 | }
public AsyncExecutor(int maxConcurrentThreadNumber, long keepAliveTime, TimeUnit unit) {
this.maxConcurrentThreadNumber = maxConcurrentThreadNumber;
this.keepAliveTime = keepAliveTime;
this.unit = unit;
<BUG>}
public AsyncExecutor(final ExecutorService executorService) {
this(8, 300, TimeUnit.SECONDS);
this.executorS... | [DELETED] |
23,676 | results.add(execute(cmd));
}
return results;
}
public <T> CompletableFuture<T> execute(final Callable<T> command) {
<BUG>final CompletableFuture<T> future = new CompletableFuture<T>(this, command);
getExecutorService().execute(future);</BUG>
return future;
}
public <T> List<CompletableFuture<T>> execute(final Callable<... | final CompletableFuture<T> future = new CompletableFuture<>(this, command);
getExecutorService().execute(future);
|
23,677 | AdapterConnectCloseSocket socket = new AdapterConnectCloseSocket();
WebSocketEventDriver driver = newDriver(socket);
LocalWebSocketConnection conn = new LocalWebSocketConnection(testname);
driver.setConnection(conn);
driver.onConnect();
<BUG>driver.onFrame(new CloseFrame(StatusCode.NORMAL));
socket.capture.assertEventC... | driver.onFrame(FrameBuilder.close(StatusCode.NORMAL).asFrame());
socket.capture.assertEventCount(2);
|
23,678 | import de.vanita5.twittnuker.receiver.NotificationReceiver;
import de.vanita5.twittnuker.service.LengthyOperationsService;
import de.vanita5.twittnuker.util.ActivityTracker;
import de.vanita5.twittnuker.util.AsyncTwitterWrapper;
import de.vanita5.twittnuker.util.DataStoreFunctionsKt;
<BUG>import de.vanita5.twittnuker.u... | import de.vanita5.twittnuker.util.DebugLog;
import de.vanita5.twittnuker.util.ImagePreloader;
|
23,679 | 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);
|
23,680 | @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);
|
23,681 | 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);
|
23,682 | 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);
|
23,683 | 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);
|
23,684 | 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);
|
23,685 | import de.vanita5.twittnuker.annotation.CustomTabType;
import de.vanita5.twittnuker.library.MicroBlog;
import de.vanita5.twittnuker.library.MicroBlogException;
import de.vanita5.twittnuker.library.twitter.model.RateLimitStatus;
import de.vanita5.twittnuker.library.twitter.model.Status;
<BUG>import de.vanita5.twittnuker... | import org.mariotaku.pickncrop.library.PNCUtils;
import org.mariotaku.sqliteqb.library.AllColumns;
|
23,686 | 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());
|
23,687 | import java.util.List;
import java.util.Map.Entry;
import javax.inject.Singleton;
import okhttp3.Dns;
@Singleton
<BUG>public class TwidereDns implements Constants, Dns {
</BUG>
private static final String RESOLVER_LOGTAG = "TwittnukerDns";
private final SharedPreferences mHostMapping;
private final SharedPreferencesWra... | public class TwidereDns implements Dns, Constants {
|
23,688 | 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);
|
23,689 | ConfigurationOptions configurationOptions;
@Inject
private Logger logger;
@Override
public Logger getLogger() {
<BUG>return logger;
}</BUG>
@Listener
public void onPreInitialization(GamePreInitializationEvent event) {
setInstance(this);
| }
public PluginContainer getContainer() {
return this.container;
}
|
23,690 | File configDir = new File(getWorkingDirectory(), "mechanics");
configDir.mkdir();
moduleController.setConfigurationDirectory(configDir);
moduleController.setConfigurationOptions(configurationOptions);
moduleController.registerModule("com.sk89q.craftbook.sponge.mechanics.variable.Variables");
<BUG>moduleController.regis... | moduleController.registerModule("com.sk89q.craftbook.sponge.mechanics.Chairs");
moduleController.registerModule("com.sk89q.craftbook.sponge.mechanics.Elevator");
|
23,691 | import com.me4502.modularframework.module.Module;
import com.me4502.modularframework.module.guice.ModuleConfiguration;
import com.sk89q.craftbook.core.util.ConfigValue;
import com.sk89q.craftbook.core.util.CraftBookException;
import com.sk89q.craftbook.core.util.PermissionNode;
<BUG>import com.sk89q.craftbook.core.util... | import com.sk89q.craftbook.sponge.CraftBookPlugin;
import com.sk89q.craftbook.sponge.util.BlockFilter;
|
23,692 | import ninja.leaping.configurate.ConfigurationNode;
import org.spongepowered.api.block.BlockState;
import org.spongepowered.api.block.BlockTypes;
import org.spongepowered.api.block.tileentity.Sign;
import org.spongepowered.api.command.CommandSource;
<BUG>import org.spongepowered.api.entity.living.Humanoid;
import org.s... | import org.spongepowered.api.event.cause.Cause;
import org.spongepowered.api.event.cause.NamedCause;
import org.spongepowered.api.text.Text;
|
23,693 | import org.spongepowered.api.data.manipulator.mutable.block.LayeredData;
import org.spongepowered.api.data.property.block.ReplaceableProperty;
import org.spongepowered.api.data.property.block.TemperatureProperty;
import org.spongepowered.api.data.value.mutable.MutableBoundedValue;
import org.spongepowered.api.event.Lis... | import org.spongepowered.api.event.cause.Cause;
import org.spongepowered.api.event.cause.NamedCause;
import org.spongepowered.api.util.Direction;
|
23,694 | if(location.getBlockType() == BlockTypes.SNOW_LAYER && optionalHeightValue.isPresent()) {
MutableBoundedValue<Integer> heightValue = optionalHeightValue.get();
int newHeight = heightValue.get() + 1;
if(newHeight > heightValue.getMaxValue()) {
if(highPiling.getValue())
<BUG>location.setBlockType(BlockTypes.SNOW);
} else... | location.setBlockType(BlockTypes.SNOW, Cause.of(NamedCause.source(CraftBookPlugin.<CraftBookPlugin>inst().getContainer())));
} else {
|
23,695 | import com.me4502.modularframework.module.Module;
import com.me4502.modularframework.module.guice.ModuleConfiguration;
import com.sk89q.craftbook.core.util.ConfigValue;
import com.sk89q.craftbook.core.util.CraftBookException;
import com.sk89q.craftbook.core.util.PermissionNode;
<BUG>import com.sk89q.craftbook.core.util... | import com.sk89q.craftbook.sponge.CraftBookPlugin;
import com.sk89q.craftbook.sponge.util.BlockFilter;
|
23,696 | import org.spongepowered.api.block.BlockTypes;
import org.spongepowered.api.block.tileentity.Sign;
import org.spongepowered.api.command.CommandSource;
import org.spongepowered.api.entity.living.Humanoid;
import org.spongepowered.api.event.Listener;
<BUG>import org.spongepowered.api.event.block.InteractBlockEvent;
impor... | import org.spongepowered.api.event.cause.Cause;
import org.spongepowered.api.event.cause.NamedCause;
|
23,697 | import ninja.leaping.configurate.ConfigurationNode;
import org.spongepowered.api.block.BlockState;
import org.spongepowered.api.block.BlockTypes;
import org.spongepowered.api.block.tileentity.Sign;
import org.spongepowered.api.command.CommandSource;
<BUG>import org.spongepowered.api.entity.living.Humanoid;
import org.s... | import org.spongepowered.api.event.cause.Cause;
import org.spongepowered.api.event.cause.NamedCause;
import org.spongepowered.api.text.Text;
|
23,698 | if(traversed.contains(block)) return;
traversed.add(block);
Optional<TreeType> data = block.getBlock().get(Keys.TREE_TYPE);
if(data.isPresent() && data.get().equals(type)) { //Same tree type.
block.getExtent().digBlockWith(block.getBlockPosition(), player.getItemInHand(HandTypes.MAIN_HAND).orElse(null), Cause.of(NamedC... | block.removeBlock(Cause.of(NamedCause.source(player)));
for(Direction dir : BlockUtil.getDirectFaces()) {
|
23,699 | return clazz.isAssignableFrom(typeToken.getRawType());
}
@Override
public boolean isRawTypeAssignableFrom(Class<?> clazz) {
return typeToken.getRawType().isAssignableFrom(clazz);
<BUG>}
@Override</BUG>
public Collection createCollection() {
Collection collection;
if(this.isRawTypeAssignableFrom(HashSet.class)) {
| @SuppressWarnings("rawtypes")
|
23,700 | if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
<BUG>return false;
ConcreteInstanceType other = (ConcreteInstanceType) obj;</BUG>
if (typeToken == null) {
if (other.typeToken != null)
return false;
| @SuppressWarnings("rawtypes")
ConcreteInstanceType other = (ConcreteInstanceType) obj;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.