id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
11,401 | public SQLQuery(String query) {
this.query = query;
}
public static class Builder {
private Mode mode;
<BUG>private List<String> columns = new ArrayList<String>();
private List<String> groupBy = new ArrayList<String>();
private List<String> unhexCols = new ArrayList<String>();
private String table;
private Map<String, String> joins = new HashMap<String, String>();
private List<Condition> conditions = new ArrayList<Condition>();
private Map<DataQuery, QueryValueMutator> valueMutators = new HashMap<DataQuery, QueryValueMutator>();
public Builder select() {</BUG>
mode = Mode.SELECT;
| private List<String> columns = new ArrayList<>();
private List<String> groupBy = new ArrayList<>();
private List<String> unhexCols = new ArrayList<>();
private Map<String, String> joins = new HashMap<>();
private List<Condition> conditions = new ArrayList<>();
private Map<DataQuery, QueryValueMutator> valueMutators = new HashMap<>();
public Builder select() {
|
11,402 | valueMutators.put(path, mutator);
return this;
}
public SQLQuery build() {
String sql = mode.name() + " ";
<BUG>sql += TypeUtil.join(columns, ", ") + " ";
sql += "FROM " + table + " ";</BUG>
for (Entry<String, String> entry : joins.entrySet()) {
sql += "LEFT JOIN " + entry.getKey() + " ON " + entry.getValue() + " ";
}
| sql += String.join(", ", columns) + " ";
sql += "FROM " + table + " ";
|
11,403 | inner.add(popDataQuery(condition.getFieldName().toString()) + " " + fieldComparator);
}
}
}
if (!inner.isEmpty()) {
<BUG>query += TypeUtil.join(inner, group.getOperator().name() + " ");
</BUG>
}
queryConditions.add(query + ")");
} else {
| query += String.join(group.getOperator().name() + " ", inner);
|
11,404 | import org.spongepowered.api.text.format.TextColors;
import com.helion3.prism.util.Format;
public class HelpCommand {
private HelpCommand(){}
public static CommandSpec getCommand() {
<BUG>return CommandSpec.builder()
.executor(new CommandExecutor() {
@Override
public CommandResult execute(CommandSource source, CommandContext args) throws CommandException {</BUG>
source.sendMessage(Format.message("/pr [l|lookup] (params)", TextColors.GRAY, " - Query the database."));
| .executor((source, args) -> {
|
11,405 | import java.util.ArrayList;
import java.util.List;
import org.spongepowered.api.block.BlockType;
import org.spongepowered.api.entity.living.player.Player;
public class FilterList {
<BUG>private final List<String> blocks = new ArrayList<String>();
private final List<String> players = new ArrayList<String>();
private final List<Class<?>> sources = new ArrayList<Class<?>>();
private final FilterMode mode;</BUG>
public FilterList(FilterMode mode) {
| private final List<String> blocks = new ArrayList<>();
private final List<String> players = new ArrayList<>();
private final List<Class<?>> sources = new ArrayList<>();
private final FilterMode mode;
|
11,406 | package com.helion3.prism.api.query;
import java.util.ArrayList;
import java.util.List;
final public class Query {
private boolean isAggregate = true;
<BUG>private List<Condition> conditions = new ArrayList<Condition>();
private int limit = 1000;</BUG>
public void addConditions(List<Condition> conditions) {
conditions.addAll(conditions);
}
| private List<Condition> conditions = new ArrayList<>();
private int limit = 1000;
|
11,407 | import javafx.scene.transform.Rotate;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
<BUG>import java.util.Map;
public class TileKpiSkin extends SkinBase<Gauge> implements Skin<Gauge> {</BUG>
private static final double PREFERRED_WIDTH = 250;
private static final double PREFERRED_HEIGHT = 250;
private static final double MINIMUM_WIDTH = 50;
| import static eu.hansolo.medusa.tools.Helper.enableNode;
public class TileKpiSkin extends SkinBase<Gauge> implements Skin<Gauge> {
|
11,408 | thresholdBar.setType(ArcType.OPEN);
thresholdBar.setStroke(getSkinnable().getThresholdColor());
thresholdBar.setStrokeWidth(PREFERRED_WIDTH * 0.02819549 * 2);
thresholdBar.setStrokeLineCap(StrokeLineCap.BUTT);
thresholdBar.setFill(null);
<BUG>Helper.enableNode(thresholdBar, !getSkinnable().getSectionsVisible());
sectionPane = new Pane();
Helper.enableNode(sectionPane, getSkinnable().getSectionsVisible());
if (sectionsVisible) { drawSections(); }</BUG>
alertIcon = new Path();
| if (sectionsVisible) { drawSections(); }
|
11,409 | angleStep = angleRange / range;
highlightSections = getSkinnable().isHighlightSections();
redraw();
rotateNeedle(getSkinnable().getCurrentValue());
} else if ("VISIBILITY".equals(EVENT_TYPE)) {
<BUG>Helper.enableNode(titleText, !getSkinnable().getTitle().isEmpty());
Helper.enableNode(valueText, getSkinnable().isValueVisible());
Helper.enableNode(sectionPane, getSkinnable().getSectionsVisible());
Helper.enableNode(thresholdRect, getSkinnable().isThresholdVisible());
Helper.enableNode(thresholdText, getSkinnable().isThresholdVisible());
Helper.enableNode(unitText, !getSkinnable().getUnit().isEmpty());
sectionsVisible = getSkinnable().getSectionsVisible();</BUG>
} else if ("SECTION".equals(EVENT_TYPE)) {
| sectionsVisible = getSkinnable().getSectionsVisible();
|
11,410 | } else if ("SECTION".equals(EVENT_TYPE)) {
sections = getSkinnable().getSections();
sectionMap.clear();
for(Section section : sections) { sectionMap.put(section, new Arc()); }
} else if ("ALERT".equals(EVENT_TYPE)) {
<BUG>Helper.enableNode(valueText, getSkinnable().isValueVisible() && !getSkinnable().isAlert());
Helper.enableNode(unitText, getSkinnable().isValueVisible() && !getSkinnable().isAlert());
Helper.enableNode(alertIcon, getSkinnable().isAlert());
alertTooltip.setText(getSkinnable().getAlertMessage());</BUG>
}
| alertTooltip.setText(getSkinnable().getAlertMessage());
|
11,411 | private void redraw() {
pane.setBorder(new Border(new BorderStroke(getSkinnable().getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(size * 0.025), new BorderWidths(getSkinnable().getBorderWidth() / PREFERRED_WIDTH * size))));
pane.setBackground(new Background(new BackgroundFill(getSkinnable().getBackgroundPaint(), new CornerRadii(size * 0.025), Insets.EMPTY)));
locale = getSkinnable().getLocale();
formatString = new StringBuilder("%.").append(Integer.toString(getSkinnable().getDecimals())).append("f").toString();
<BUG>thresholdColor = getSkinnable().getThresholdColor();
titleText.setText(getSkinnable().getTitle());</BUG>
unitText.setText(getSkinnable().getUnit());
minValueText.setText(String.format(locale, "%." + getSkinnable().getTickLabelDecimals() + "f", getSkinnable().getMinValue()));
maxValueText.setText(String.format(locale, "%." + getSkinnable().getTickLabelDecimals() + "f", getSkinnable().getMaxValue()));
| sectionsVisible = getSkinnable().getSectionsVisible();
enableNode(sectionPane, sectionsVisible);
titleText.setText(getSkinnable().getTitle());
|
11,412 | import javafx.scene.shape.StrokeLineJoin;
import javafx.scene.text.Text;
import javafx.scene.text.TextAlignment;
import javafx.scene.transform.Rotate;
import java.util.List;
<BUG>import java.util.Locale;
public class SimpleSkin extends SkinBase<Gauge> implements Skin<Gauge> {</BUG>
private static final double PREFERRED_WIDTH = 250;
private static final double PREFERRED_HEIGHT = 250;
private static final double MINIMUM_WIDTH = 50;
| import static eu.hansolo.medusa.tools.Helper.enableNode;
public class SimpleSkin extends SkinBase<Gauge> implements Skin<Gauge> {
|
11,413 | sections = getSkinnable().getSections();
highlightSections = getSkinnable().isHighlightSections();
resize();
redraw();
} else if ("VISIBILITY".equals(EVENT_TYPE)) {
<BUG>Helper.enableNode(valueText, getSkinnable().isValueVisible());
Helper.enableNode(titleText, !getSkinnable().getTitle().isEmpty());
Helper.enableNode(subTitleText, !getSkinnable().getSubTitle().isEmpty());
}</BUG>
}
| [DELETED] |
11,414 | valueText.setVisible(getSkinnable().isValueVisible());
titleText.setText(getSkinnable().getTitle());
resizeText();
}
}
<BUG>private void redraw() {
needle.setFill(getSkinnable().getNeedleColor());</BUG>
needle.setStroke(getSkinnable().getNeedleBorderColor());
titleText.setFill(getSkinnable().getTitleColor());
subTitleText.setFill(getSkinnable().getSubTitleColor());
| enableNode(sectionsCanvas, getSkinnable().getSectionsVisible());
needle.setFill(getSkinnable().getNeedleColor());
|
11,415 | false, CycleMethod.NO_CYCLE,
new Stop(0.0, getSkinnable().getNeedleColor().darker()),
new Stop(0.5, getSkinnable().getNeedleColor()),
new Stop(1.0, getSkinnable().getNeedleColor().darker())));
}
<BUG>private void drawSections() {
if (!sectionsVisible | sections.isEmpty()) return;
sectionsCtx.clearRect(0, 0, size, size);</BUG>
double value = getSkinnable().getCurrentValue();
boolean sectionTextVisible = getSkinnable().isSectionTextVisible();
| sectionsCtx.clearRect(0, 0, size, size);
|
11,416 | valueText.setVisible(getSkinnable().isValueVisible());
titleText.setText(getSkinnable().getTitle());
resizeText();
}
}
<BUG>private void redraw() {
needle.setFill(new LinearGradient(needle.getLayoutBounds().getMinX(), 0,</BUG>
needle.getLayoutBounds().getMaxX(), 0,
false, CycleMethod.NO_CYCLE,
new Stop(0.0, getSkinnable().getNeedleColor().darker()),
| sectionsVisible = getSkinnable().getSectionsVisible();
drawSections();
needle.setFill(new LinearGradient(needle.getLayoutBounds().getMinX(), 0,
|
11,417 | bigGlow.setRadius(0.25 * size);
resizeText();
placeTextVerticaly();
}
}
<BUG>private void redraw() {
locale = getSkinnable().getLocale();
formatString = new StringBuilder("%.").append(Integer.toString(getSkinnable().getDecimals())).append("f").toString();
</BUG>
needle.setFill(getSkinnable().getNeedleColor());
| sectionsVisible = getSkinnable().getSectionsVisible();
locale = getSkinnable().getLocale();
formatString = new StringBuilder("%.").append(Integer.toString(getSkinnable().getDecimals())).append("f").toString();
|
11,418 | formatString = new StringBuilder("%.").append(Integer.toString(getSkinnable().getDecimals())).append("f").toString();
barColor = getSkinnable().getBarColor();
valueColor = getSkinnable().getValueColor();
titleColor = getSkinnable().getTitleColor();
subTitleColor = getSkinnable().getSubTitleColor();
<BUG>unitColor = getSkinnable().getUnitColor();
drawBackground();</BUG>
setBar(getSkinnable().getCurrentValue());
valueBkgText.setFill(Helper.getTranslucentColorFrom(valueColor, 0.1));
valueText.setFill(valueColor);
| sectionsVisible = getSkinnable().getSectionsVisible();
drawBackground();
|
11,419 | import static org.cs3.prolog.connector.common.QueryUtils.bT;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.Vector;
<BUG>import org.cs3.pdt.common.PDTCommonPredicates;
import org.cs3.pdt.common.metadata.Goal;</BUG>
import org.cs3.prolog.connector.common.QueryUtils;
import org.eclipse.core.resources.IFile;
import org.eclipse.search.ui.text.Match;
| import org.cs3.pdt.common.PDTCommonUtil;
import org.cs3.pdt.common.metadata.Goal;
|
11,420 | import org.eclipse.search.ui.text.Match;
public class ContextAwareDefinitionsSearchQuery extends PDTSearchQuery {
private String filePath;
private int line;
public ContextAwareDefinitionsSearchQuery(Goal goal) {
<BUG>super(PDTSearchQuery.toPredicateGoal(goal), goal.getTermString(), true);
</BUG>
setSearchType("Definitions and declarations of");
filePath = QueryUtils.quoteAtomIfNeeded(goal.getFilePath());
line = goal.getLine();
| super(PDTSearchQuery.toPredicateGoal(goal), PDTCommonUtil.cropText(goal.getTermString(), 100), true);
|
11,421 | import static org.cs3.prolog.connector.common.QueryUtils.bT;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.Vector;
<BUG>import org.cs3.pdt.common.PDTCommonPredicates;
import org.cs3.pdt.common.metadata.Goal;</BUG>
import org.cs3.pdt.common.structureElements.PrologMatch;
import org.cs3.prolog.connector.common.QueryUtils;
import org.eclipse.core.resources.IFile;
| import org.cs3.pdt.common.PDTCommonUtil;
import org.cs3.pdt.common.metadata.Goal;
|
11,422 | } else {
setSearchType("References to predicates containing");
}
}
public ReferencesSearchQueryDirect(Goal goal) {
<BUG>super(PDTSearchQuery.toPredicateGoal(goal), goal.getTermString(), true);
</BUG>
setSearchType("References to");
filePath = QueryUtils.quoteAtomIfNeeded(goal.getFilePath());
line = goal.getLine();
| super(PDTSearchQuery.toPredicateGoal(goal), PDTCommonUtil.cropText(goal.getTermString(), 100), true);
|
11,423 | 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;
|
11,424 | 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();
|
11,425 | 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: " +
|
11,426 | import org.rajawali3d.materials.Material;
import org.rajawali3d.materials.methods.DiffuseMethod;
import org.rajawali3d.materials.textures.ATexture;
import org.rajawali3d.materials.textures.StreamingTexture;
import org.rajawali3d.materials.textures.Texture;
<BUG>import org.rajawali3d.math.Matrix4;
import org.rajawali3d.math.vector.Vector3;</BUG>
import org.rajawali3d.primitives.ScreenQuad;
import org.rajawali3d.primitives.Sphere;
import org.rajawali3d.renderer.RajawaliRenderer;
| import org.rajawali3d.math.Quaternion;
import org.rajawali3d.math.vector.Vector3;
|
11,427 | translationMoon.setRepeatMode(Animation.RepeatMode.INFINITE);
translationMoon.setTransformable3D(moon);
getCurrentScene().registerAnimation(translationMoon);
translationMoon.play();
}
<BUG>public void updateRenderCameraPose(TangoPoseData devicePose, DeviceExtrinsics extrinsics) {
Pose cameraPose = ScenePoseCalculator.toOpenGlCameraPose(devicePose, extrinsics);
getCurrentCamera().setRotation(cameraPose.getOrientation());
getCurrentCamera().setPosition(cameraPose.getPosition());
}</BUG>
public int getTextureId() {
| public void updateRenderCameraPose(TangoPoseData cameraPose) {
float[] rotation = cameraPose.getRotationAsFloats();
float[] translation = cameraPose.getTranslationAsFloats();
Quaternion quaternion = new Quaternion(rotation[3], rotation[0], rotation[1], rotation[2]);
getCurrentCamera().setRotation(quaternion.conjugate());
getCurrentCamera().setPosition(translation[0], translation[1], translation[2]);
|
11,428 | 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;
|
11,429 | import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.security.DigestOutputStream;
import java.security.MessageDigest;
<BUG>import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;</BUG>
public final class PatchUtils {
| import java.text.DateFormat;
import java.util.Date;
import java.util.List;
|
11,430 | 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;
|
11,431 | private static final String PATH_DELIMITER = "/";
public static final byte[] NO_CONTENT = PatchingTask.NO_CONTENT;
enum Element {
ADDED_BUNDLE("added-bundle"),
ADDED_MISC_CONTENT("added-misc-content"),
<BUG>ADDED_MODULE("added-module"),
BUNDLES("bundles"),</BUG>
CUMULATIVE("cumulative"),
DESCRIPTION("description"),
MISC_FILES("misc-files"),
| APPLIES_TO_VERSION("applies-to-version"),
BUNDLES("bundles"),
|
11,432 | final int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
final String value = reader.getAttributeValue(i);
final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
<BUG>case APPLIES_TO_VERSION:
builder.addAppliesTo(value);
break;</BUG>
case RESULTING_VERSION:
if(type == Patch.PatchType.CUMULATIVE) {
| [DELETED] |
11,433 | 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) {
|
11,434 | 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;
|
11,435 | @CliCommand(value = "change-java-version", help = "Change java version")
public String changeJavaVersion(
@CliOption(key = {""}, mandatory = false, help = "Application name") String applicationName,
@CliOption(key = {"javaVersion"}, mandatory = true, help = "Choose your java version (available : java7, java8 or java9)") String javaVersion) {
<BUG>return serverUtils.changeJavaVersion(applicationName, javaVersion);
}</BUG>
@CliCommand(value = "open-port", help = "Change java version")
public String openPort(
@CliOption(key = {"", "name"}, mandatory = false, help = "Application name") String applicationName,
@CliOption(key = {"port"}, mandatory = true, help = "Choose a port to open") String portToOpen,
| return null;
}
|
11,436 | @CliCommand(value = "open-port", help = "Change java version")
public String openPort(
@CliOption(key = {"", "name"}, mandatory = false, help = "Application name") String applicationName,
@CliOption(key = {"port"}, mandatory = true, help = "Choose a port to open") String portToOpen,
@CliOption(key = {"nature"}, mandatory = true, help = "Choose a port to open") String portNature) {
<BUG>return serverUtils.openPort(applicationName, portToOpen, portNature);
}</BUG>
@CliCommand(value = "remove-port", help = "Change java version")
public String openPort(
@CliOption(key = {"", "name"}, mandatory = false, help = "Application name") String applicationName,
| return null;
}
|
11,437 | import org.springframework.shell.core.annotation.CliOption;
<BUG>import org.springframework.stereotype.Component;
import fr.treeptik.cloudunit.cli.utils.ModuleUtils;
@Component
public class ModuleCommands implements CommandMarker {
private static final String HELP_MODULE_NAME =</BUG>
"Name of the module. Use show-modules command to get all modules of this application";
private static final String HELP_MODULE_TYPE = "Module type \n "
+ " MYSQL 5.5 : -name mysql-5-5\n"
+ " MYSQL 5.6 : -name mysql-5-6\n"
| import fr.treeptik.cloudunit.cli.Messages;
import fr.treeptik.cloudunit.model.Module;
private static final String MODULE_REMOVED = Messages.getString("module.MODULE_REMOVED");
private static final String MODULE_ADDED = Messages.getString("module.MODULE_ADDED");
private static final String HELP_MODULE_NAME =
|
11,438 | import org.codehaus.groovy.control.CompilationUnit;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public final class GroovyTreeParser implements TreeParser {
private static final Logger logger = LoggerFactory.getLogger(GroovyTreeParser.class);
<BUG>private static final String GROOVY_DEFAULT_INTERFACE = "groovy.lang.GroovyObject";
private static final String JAVA_DEFAULT_OBJECT = "java.lang.Object";
private Map<URI, Set<SymbolInformation>> fileSymbols = Maps.newHashMap();
private Map<String, Set<SymbolInformation>> typeReferences = Maps.newHashMap();</BUG>
private final Supplier<CompilationUnit> unitSupplier;
| private Indexer indexer = new Indexer();
|
11,439 | if (scriptClass != null) {
sourceUnit.getAST().getStatementBlock().getVariableScope().getDeclaredVariables().values().forEach(
variable -> {
SymbolInformation symbol =
getVariableSymbolInformation(scriptClass.getName(), sourceUri, variable);
<BUG>addToValueSet(newTypeReferences, variable.getType().getName(), symbol);
symbols.add(symbol);
});
}
newFileSymbols.put(workspaceUriSupplier.get(sourceUri), symbols);</BUG>
});
| newIndexer.addSymbol(sourceUnit.getSource().getURI(), symbol);
if (classes.containsKey(variable.getType().getName())) {
newIndexer.addReference(classes.get(variable.getType().getName()),
GroovyLocations.createLocation(sourceUri, variable.getType()));
|
11,440 | }
if (typeReferences.containsKey(foundSymbol.getName())) {
foundReferences.addAll(typeReferences.get(foundSymbol.getName()));</BUG>
}
<BUG>return foundReferences;
}</BUG>
@Override
public Set<SymbolInformation> getFilteredSymbols(String query) {
checkNotNull(query, "query must not be null");
Pattern pattern = getQueryPattern(query);
| });
sourceUnit.getAST().getStatementBlock()
.visit(new MethodVisitor(newIndexer, sourceUri, sourceUnit.getAST().getScriptClassDummy(),
classes, Maps.newHashMap(), Optional.absent(), workspaceUriSupplier));
|
11,441 | <BUG>package com.palantir.ls.server.api;
import io.typefox.lsapi.ReferenceParams;</BUG>
import io.typefox.lsapi.SymbolInformation;
import java.net.URI;
import java.util.Map;
| import com.google.common.base.Optional;
import io.typefox.lsapi.Location;
import io.typefox.lsapi.Position;
import io.typefox.lsapi.ReferenceParams;
|
11,442 | import java.util.Map;
import java.util.Set;
public interface TreeParser {
void parseAllSymbols();
Map<URI, Set<SymbolInformation>> getFileSymbols();
<BUG>Map<String, Set<SymbolInformation>> getTypeReferences();
Set<SymbolInformation> findReferences(ReferenceParams params);
Set<SymbolInformation> getFilteredSymbols(String query);</BUG>
}
| Map<Location, Set<Location>> getReferences();
Set<Location> findReferences(ReferenceParams params);
Optional<Location> gotoDefinition(URI uri, Position position);
Set<SymbolInformation> getFilteredSymbols(String query);
|
11,443 | .workspaceSymbolProvider(true)
.referencesProvider(true)
.completionProvider(new CompletionOptionsBuilder()
.resolveProvider(false)
.triggerCharacter(".")
<BUG>.build())
.build();</BUG>
InitializeResult result = new InitializeResultBuilder()
.capabilities(capabilities)
.build();
| .definitionProvider(true)
|
11,444 | package com.palantir.ls.server;
import com.palantir.ls.server.api.CompilerWrapper;
import com.palantir.ls.server.api.TreeParser;
import com.palantir.ls.server.api.WorkspaceCompiler;
<BUG>import io.typefox.lsapi.FileEvent;
import io.typefox.lsapi.PublishDiagnosticsParams;</BUG>
import io.typefox.lsapi.ReferenceParams;
import io.typefox.lsapi.SymbolInformation;
import io.typefox.lsapi.TextDocumentContentChangeEvent;
| import com.google.common.base.Optional;
import io.typefox.lsapi.Location;
import io.typefox.lsapi.Position;
import io.typefox.lsapi.PublishDiagnosticsParams;
|
11,445 | SQLiteDatabase writableDb = dbHelper.getWritableDatabase();
JSONArray dataArray = null;
if (!dismissed) {
try {
JSONObject jsonData = new JSONObject(intent.getStringExtra("onesignal_data"));
<BUG>jsonData.put("notificationId", inIntent.getIntExtra("notificationId", 0));
dataArray = newJsonArray(new JSONObject(intent.getStringExtra("onesignal_data")));
</BUG>
} catch (Throwable t) {
t.printStackTrace();
| intent.putExtra("onesignal_data", jsonData.toString());
dataArray = NotificationBundleProcessor.newJsonArray(new JSONObject(intent.getStringExtra("onesignal_data")));
|
11,446 | markNotificationsConsumed(writableDb);
if (summaryGroup == null && intent.getStringExtra("grp") != null)
updateSummaryNotification(writableDb);
writableDb.close();
if (!dismissed)
<BUG>OneSignal.handleNotificationOpened(context, dataArray, inIntent.getBooleanExtra("from_alert", false));
</BUG>
}
private static void addChildNotifications(JSONArray dataArray, String summaryGroup, SQLiteDatabase writableDb) {
String[] retColumn = { NotificationTable.COLUMN_NAME_FULL_DATA };
| OneSignal.handleNotificationReceivedWhenInFocus(context, dataArray, inIntent.getBooleanExtra("from_alert", false));
|
11,447 | protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Log.e("tet", Locale.getDefault().getLanguage());
currentActivity = this;
<BUG>OneSignal.setInFocusDisplaying(OneSignal.OSDefaultDisplay.InAppAlert);
</BUG>
OneSignal.sendTag("test3", "test7");
OneSignal.syncHashedEmail("test@onesignal.com");
mHelper = new IabHelper(this, "sdafsfds");
| OneSignal.setInFocusDisplaying(OneSignal.OSInFocusDisplay.InAppAlert);
|
11,448 | import android.content.pm.ResolveInfo;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.net.ConnectivityManager;
import android.os.Bundle;
<BUG>import com.onesignal.BuildConfig;
import com.onesignal.OSNotificationOpenResult;</BUG>
import com.onesignal.OneSignal;
import com.onesignal.OneSignalDbHelper;
import com.onesignal.ShadowBadgeCountUpdater;
| import com.onesignal.OSNotification;
import com.onesignal.OSNotificationOpenResult;
|
11,449 | import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.Robolectric;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.Shadows;
<BUG>import org.robolectric.annotation.Config;
import org.robolectric.shadows.ShadowApplication;</BUG>
import org.robolectric.shadows.ShadowConnectivityManager;
import org.robolectric.shadows.ShadowLog;
import org.robolectric.shadows.ShadowSystemClock;
| import org.robolectric.shadows.ShadowActivity;
import org.robolectric.shadows.ShadowApplication;
|
11,450 | import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
<BUG>import java.util.Map;
import static com.test.onesignal.GenerateNotificationRunner.getBaseNotifBundle;</BUG>
@Config(packageName = "com.onesignal.example",
constants = BuildConfig.class,
shadows = {ShadowOneSignalRestClient.class, ShadowPushRegistratorGPS.class, ShadowPushRegistratorADM.class, ShadowOSUtils.class},
| import static com.onesignal.OneSignalPackagePrivateHelper.GcmBroadcastReceiver_processBundle;
import static com.onesignal.OneSignalPackagePrivateHelper.NotificationBundleProcessor_Process;
import static com.onesignal.OneSignalPackagePrivateHelper.bundleAsJSONObject;
import static com.test.onesignal.GenerateNotificationRunner.getBaseNotifBundle;
|
11,451 | Assert.assertNull(Shadows.shadowOf(blankActivity).getNextStartedActivity());
}
@Test
public void testOpeningLaunchUrl() throws Exception {
Shadows.shadowOf(blankActivity).getNextStartedActivity();
<BUG>OneSignal.handleNotificationOpened(blankActivity, new JSONArray("[{ \"alert\": \"Test Msg\", \"custom\": { \"i\": \"UUID\", \"u\": \"http://google.com\" } }]"), false);
</BUG>
Intent intent = Shadows.shadowOf(blankActivity).getNextStartedActivity();
Assert.assertEquals("android.intent.action.VIEW", intent.getAction());
Assert.assertEquals("http://google.com", intent.getData().toString());
| OneSignal.handleNotificationReceivedWhenInFocus(blankActivity, new JSONArray("[{ \"alert\": \"Test Msg\", \"custom\": { \"i\": \"UUID\", \"u\": \"http://google.com\" } }]"), false);
|
11,452 | public static final Setting<Boolean> udc_enabled = setting( "neo4j.ext.udc.enabled", BOOLEAN, TRUE );
public static final Setting<Integer> first_delay =
setting( "neo4j.ext.udc.first_delay", INTEGER, Integer.toString( 10 * 1000 * 60 ), min( 1 ) );
public static final Setting<Integer> interval = setting( "neo4j.ext.udc.interval", INTEGER, Integer.toString(
1000 * 60 * 60 * 24 ), min( 1 ) );
<BUG>public static final Setting<HostnamePort> udc_host = setting( "neo4j.ext.udc.host", HOSTNAME_PORT,
"udc.neo4j.org" );</BUG>
public static final Setting<String> udc_source = setting( "neo4j.ext.udc.source", STRING, Settings.NO_DEFAULT,
illegalValueMessage( "Must be a valid source", matches( ANY ) ) );
| public static final Setting<String> udc_host = setting( "neo4j.ext.udc.host", STRING, "udc.neo4j.org" );
|
11,453 | RedisConnection<K, V> conn = super.connect(codec);
conn.auth(password);
return conn;</BUG>
}
@Override
<BUG>public <K, V> RedisAsyncConnection<K, V> connectAsync(RedisCodec<K, V> codec) {
RedisAsyncConnection<K, V> conn = super.connectAsync(codec);
conn.auth(password);
return conn;</BUG>
}
| public AuthenticatingRedisClient(String host, int port, String password) {
super(null, RedisURI.builder().withHost(host).withPort(port).withPassword(password).build());
public AuthenticatingRedisClient(String host, String password) {
super(null, RedisURI.builder().withHost(host).withPassword(password).build());
public <K, V> StatefulRedisConnection<K, V> connect(RedisCodec<K, V> codec) {
return super.connect(codec);
|
11,454 | RedisAsyncConnection<K, V> conn = super.connectAsync(codec);
conn.auth(password);
return conn;</BUG>
}
@Override
<BUG>public <K, V> RedisPubSubConnection<K, V> connectPubSub(RedisCodec<K, V> codec) {
RedisPubSubConnection<K, V> conn = super.connectPubSub(codec);
conn.auth(password);
return conn;</BUG>
}
| public AuthenticatingRedisClient(String host, int port, String password) {
super(null, RedisURI.builder().withHost(host).withPort(port).withPassword(password).build());
public AuthenticatingRedisClient(String host, String password) {
super(null, RedisURI.builder().withHost(host).withPassword(password).build());
public <K, V> StatefulRedisConnection<K, V> connect(RedisCodec<K, V> codec) {
return super.connect(codec);
|
11,455 | this.client = RedisClient.create(clientResources, getRedisURI());
} else {
this.client = RedisClient.create(getRedisURI());
}
client.setDefaultTimeout(timeout, TimeUnit.MILLISECONDS);
<BUG>this.internalPool = new GenericObjectPool<RedisAsyncConnection>(new LettuceFactory(client, dbIndex), poolConfig);
}</BUG>
private RedisURI getRedisURI() {
RedisURI redisUri = isRedisSentinelAware()
| this.internalPool = new GenericObjectPool<StatefulConnection<byte[], byte[]>>(new LettuceFactory(client, dbIndex),
|
11,456 | return internalPool.borrowObject();
} catch (Exception e) {
throw new PoolException("Could not get a resource from the pool", e);
}
}
<BUG>public void returnBrokenResource(final RedisAsyncConnection<byte[], byte[]> resource) {
</BUG>
try {
internalPool.invalidateObject(resource);
} catch (Exception e) {
| public void returnBrokenResource(final StatefulConnection<byte[], byte[]> resource) {
|
11,457 | internalPool.invalidateObject(resource);
} catch (Exception e) {
throw new PoolException("Could not invalidate the broken resource", e);
}
}
<BUG>public void returnResource(final RedisAsyncConnection<byte[], byte[]> resource) {
</BUG>
try {
internalPool.returnObject(resource);
} catch (Exception e) {
| public void returnResource(final StatefulConnection<byte[], byte[]> resource) {
|
11,458 | super();
this.client = client;
this.dbIndex = dbIndex;
}
@Override
<BUG>public void activateObject(PooledObject<RedisAsyncConnection> pooledObject) throws Exception {
pooledObject.getObject().select(dbIndex);
}
public void destroyObject(final PooledObject<RedisAsyncConnection> obj) throws Exception {
</BUG>
try {
| public void activateObject(PooledObject<StatefulConnection<byte[], byte[]>> pooledObject) throws Exception {
if (pooledObject.getObject() instanceof StatefulRedisConnection) {
((StatefulRedisConnection) pooledObject.getObject()).sync().select(dbIndex);
public void destroyObject(final PooledObject<StatefulConnection<byte[], byte[]>> obj) throws Exception {
|
11,459 | import java.util.List;
import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamException;
import org.jboss.as.controller.Extension;
import org.jboss.as.controller.ExtensionContext;
<BUG>import org.jboss.as.controller.SubsystemRegistration;
import org.jboss.as.controller.parsing.ExtensionParsingContext;</BUG>
import org.jboss.as.controller.parsing.ParseUtils;
import org.jboss.as.controller.persistence.SubsystemMarshallingContext;
import org.jboss.as.controller.registry.ManagementResourceRegistration;
| import org.jboss.as.controller.descriptions.ResourceDescriptionResolver;
import org.jboss.as.controller.descriptions.StandardResourceDescriptionResolver;
import org.jboss.as.controller.parsing.ExtensionParsingContext;
|
11,460 | public int getItemPosition(Object object) {
return POSITION_NONE;
}
@Override
public boolean isViewFromObject(View view, Object object) {
<BUG>BaseDetailFragment fragment = (BaseDetailFragment) object;
view.setTag(fragment.getCard().getId());
return super.isViewFromObject(view, object);</BUG>
}
| if (view != null && fragment != null) {
Card card = fragment.getCard();
if (card != null) {
view.setTag(card.getId());
return super.isViewFromObject(view, object);
|
11,461 | import android.content.Context;</BUG>
import android.graphics.drawable.Drawable;
import android.util.TypedValue;
import android.view.View;
<BUG>import android.view.ViewTreeObserver;
import static android.os.Build.VERSION_CODES.JELLY_BEAN;</BUG>
import static android.os.Build.VERSION_CODES.LOLLIPOP;
public final class Compatibility {
private Compatibility() {
throw new UnsupportedOperationException();
| package com.nilhcem.xebia.essentials.core.utils;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Context;
import android.view.Window;
import static android.os.Build.VERSION_CODES.JELLY_BEAN;
|
11,462 | page.setPivotX(0);
page.setPivotY(0);
page.setTranslationY(0);
page.setTranslationX(0);
page.setAlpha(1);
<BUG>}
public void setEnableTransformations(boolean enableTransformations) {</BUG>
mEnableTransformations = enableTransformations;
}
public void setPageTransformedListener(OnPageTransformedListener listener) {
| public void setEnableTransformations(boolean enableTransformations) {
|
11,463 | import com.nilhcem.xebia.essentials.core.data.provider.dao.CategoriesDao;
import com.nilhcem.xebia.essentials.core.utils.ColorUtils;
import com.nilhcem.xebia.essentials.events.CardChangedEvent;
import com.nilhcem.xebia.essentials.events.CategoryChangedEvent;
import com.nilhcem.xebia.essentials.model.Card;
<BUG>import com.nilhcem.xebia.essentials.model.Category;
import com.nilhcem.xebia.essentials.ui.base.BaseFragment;</BUG>
import com.nilhcem.xebia.essentials.ui.cards.random.RandomMenuHelper;
import java.util.Arrays;
import java.util.List;
| import com.nilhcem.xebia.essentials.ui.base.BaseActivity;
import com.nilhcem.xebia.essentials.ui.base.BaseFragment;
|
11,464 | if (mViewPager.getCurrentItem() != position) {
mDetailPagerTransformer.setEnableTransformations(false);
mViewPager.setCurrentItem(position, false);
mDetailPagerTransformer.setEnableTransformations(true);
}
<BUG>setShareIntent();
setViewPagerBackground(mDataProvider.getCardAt(position).getCategory().getColor());
}
}</BUG>
public void onEventMainThread(CategoryChangedEvent event) {
| setActionBarColor(mDataProvider.getCardAt(position).getCategory().getColor());
private void setActionBarColor(int color) {
setViewPagerBackground(color);
((BaseActivity) getActivity()).updateActionBarColor(color);
|
11,465 | import java.lang.reflect.Method;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
<BUG>import java.util.UUID;
import static me.lucko.luckperms.common.constants.Permission.MIGRATION;</BUG>
public class MigrationBPermissions extends SubCommand<Object> {
private static Field uConfigField;
private static Method getConfigurationSectionMethod = null;
| import java.util.function.Consumer;
import static me.lucko.luckperms.common.constants.Permission.MIGRATION;
|
11,466 | ex.printStackTrace();
}
migrateHolder(plugin, world, group, lpGroup);
plugin.getStorage().saveGroup(lpGroup);
}
<BUG>log.info("bPermissions Migration: Migrated " + groupCount + " groups in world " + world.getName() + ".");
log.info("bPermissions Migration: Starting user migration in world " + world.getName() + ".");
</BUG>
int userCount = 0;
| log.accept("Migrated " + groupCount + " groups in world " + world.getName() + ".");
log.accept("Starting user migration in world " + world.getName() + ".");
|
11,467 | uuid = UUID.fromString(user.getName());
} catch (IllegalArgumentException e) {
uuid = plugin.getUUID(user.getName());
}
if (uuid == null) {
<BUG>log.info("bPermissions Migration: Unable to migrate user " + user.getName() + ". Unable to get UUID.");
</BUG>
continue;
}
plugin.getStorage().loadUser(uuid, "null").join();
| log.accept("Unable to migrate user " + user.getName() + ". Unable to get UUID.");
|
11,468 | }
<BUG>log.info("bPermissions Migration: Success! Completed without any errors.");
return CommandResult.SUCCESS;</BUG>
}
}
| if (uuid == null) {
log.accept("Unable to migrate user " + user.getName() + ". Unable to get UUID.");
continue;
|
11,469 | import org.anjocaido.groupmanager.dataholder.worlds.WorldsHolder;
import java.util.AbstractMap;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
<BUG>import java.util.UUID;
import java.util.stream.Collectors;</BUG>
public class MigrationGroupManager extends SubCommand<Object> {
public MigrationGroupManager() {
super("groupmanager", "Migration from GroupManager", Permission.MIGRATION, Predicates.is(0),
| import java.util.function.Consumer;
import java.util.stream.Collectors;
|
11,470 | Arg.list(Arg.create("world names...", false, "a list of worlds to migrate permissions from"))
);
}
@Override
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, Object o, List<String> args, String label) throws CommandException {
<BUG>final Logger log = plugin.getLog();
if (!plugin.isPluginLoaded("GroupManager")) {
log.severe("GroupManager Migration: Error -> GroupManager is not loaded.");
return CommandResult.STATE_ERROR;</BUG>
}
| Consumer<String> log = s -> {
Message.MIGRATION_LOG.send(sender, s);
Message.MIGRATION_LOG.send(plugin.getConsoleSender(), s);
};
log.accept("Starting GroupManager migration.");
log.accept("Error -> GroupManager is not loaded.");
return CommandResult.STATE_ERROR;
|
11,471 | .collect(Collectors.toMap(n -> n, n -> true))
);
primaryGroups.put(uuid, user.getGroupName());
}
}
<BUG>log.info("GroupManager Migration: All existing GroupManager data has been processed. Now beginning the import process.");
log.info("GroupManager Migration: Found a total of " + users.size() + " users and " + groups.size() + " groups.");
</BUG>
for (Map.Entry<String, Map<Map.Entry<String, String>, Boolean>> e : groups.entrySet()) {
| log.accept("All existing GroupManager data has been processed. Now beginning the import process.");
log.accept("Found a total of " + users.size() + " users and " + groups.size() + " groups.");
|
11,472 | }
}
plugin.getStorage().saveUser(user);
plugin.getUserManager().cleanup(user);
}
<BUG>log.info("GroupManager Migration: Success! Completed without any errors.");
return CommandResult.SUCCESS;</BUG>
}
}
| users.get(uuid).put(new AbstractMap.SimpleEntry<>(world, node), value);
|
11,473 | import ru.tehkode.permissions.PermissionManager;
import ru.tehkode.permissions.PermissionUser;
import ru.tehkode.permissions.bukkit.PermissionsEx;
import java.lang.reflect.Field;
import java.util.List;
<BUG>import java.util.UUID;
import java.util.stream.Collectors;</BUG>
public class MigrationPermissionsEx extends SubCommand<Object> {
public MigrationPermissionsEx() {
super("permissionsex", "Migration from PermissionsEx", Permission.MIGRATION, Predicates.alwaysFalse(),
| import java.util.function.Consumer;
import java.util.stream.Collectors;
|
11,474 | );
}
@SuppressWarnings("deprecation")
@Override
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, Object o, List<String> args, String label) throws CommandException {
<BUG>final Logger log = plugin.getLog();
if (!plugin.isPluginLoaded("PermissionsEx")) {
log.severe("PermissionsEx Migration: Error -> PermissionsEx is not loaded.");
return CommandResult.STATE_ERROR;</BUG>
}
| Consumer<String> log = s -> {
Message.MIGRATION_LOG.send(sender, s);
Message.MIGRATION_LOG.send(plugin.getConsoleSender(), s);
};
log.accept("Starting PermissionsEx migration.");
log.accept("Error -> PermissionsEx is not loaded.");
return CommandResult.STATE_ERROR;
|
11,475 | if (!plugin.isPluginLoaded("PermissionsEx")) {
log.severe("PermissionsEx Migration: Error -> PermissionsEx is not loaded.");
return CommandResult.STATE_ERROR;</BUG>
}
if (plugin.getType() != PlatformType.BUKKIT) {
<BUG>log.severe("PEX import is not supported on this platform.");
</BUG>
return CommandResult.STATE_ERROR;
}
final List<String> worlds = args.stream()
| log.accept("Error -> PermissionsEx is not loaded.");
log.accept("PEX import is not supported on this platform.");
|
11,476 | ni = (NativeInterface) f.get(manager);
} catch (Throwable t) {
t.printStackTrace();
return CommandResult.FAILURE;
}
<BUG>log.info("PermissionsEx Migration: Starting group migration.");
int maxGroupWeight = 0;</BUG>
int groupCount = 0;
for (PermissionGroup group : manager.getGroupList()) {
int groupWeight = group.getWeight() * -1;
| log.accept("Starting group migration.");
int maxGroupWeight = 0;
|
11,477 | if (u == null) {
u = plugin.getUUID(user.getIdentifier());
}
}
if (u == null) {
<BUG>log.severe("Unable to get a UUID for user identifier: " + user.getIdentifier());
</BUG>
continue;
}
userCount++;
| log.accept("Unable to get a UUID for user identifier: " + user.getIdentifier());
|
11,478 | 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.Status;
import org.mariotaku.sqliteqb.library.AllColumns;</BUG>
import org.mariotaku.sqliteqb.library.Columns;
import org.mariotaku.sqliteqb.library.Columns.Column;
import org.mariotaku.sqliteqb.library.Expression;
| import org.mariotaku.pickncrop.library.PNCUtils;
import org.mariotaku.sqliteqb.library.AllColumns;
|
11,479 | 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());
|
11,480 | 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.format("Unable to delete %s", file));
}</BUG>
}
| if (deleteImage) {
Utils.deleteMedia(context, imageUri);
|
11,481 | 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, String.format("Unable to delete %s", file));
}</BUG>
}
| twitter.updateProfileBannerImage(fileBody);
if (deleteImage) {
Utils.deleteMedia(context, imageUri);
|
11,482 | 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.format("Unable to delete %s", file));
}</BUG>
}
| twitter.updateProfileBannerImage(fileBody);
if (deleteImage) {
Utils.deleteMedia(context, imageUri);
|
11,483 | 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.util.DataStoreUtils;
import org.mariotaku.twidere.util.ImagePreloader;</BUG>
import org.mariotaku.twidere.util.InternalTwitterContentUtils;
import org.mariotaku.twidere.util.JsonSerializer;
import org.mariotaku.twidere.util.NotificationManagerWrapper;
| import org.mariotaku.twidere.util.DebugLog;
import org.mariotaku.twidere.util.ImagePreloader;
|
11,484 | 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);
|
11,485 | 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);
|
11,486 | 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.util.JsonSerializer;</BUG>
import org.mariotaku.twidere.util.Utils;
| import org.mariotaku.twidere.util.DebugLog;
import org.mariotaku.twidere.util.JsonSerializer;
|
11,487 | }
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) {
Log.d(HotMobiLogger.LOGTAG, "getting cached location");
}</BUG>
final Location location = Utils.getCachedLocation(appContext);
| DebugLog.d(HotMobiLogger.LOGTAG, "getting cached location", null);
|
11,488 | 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 DestroyStatusTask task = new DestroyStatusTask(context,accountKey, statusId);
</BUG>
return asyncTaskManager.add(task, true);
}
public int destroyUserListAsync(final UserKey accountKey, final String listId) {
| final DestroyStatusTask task = new DestroyStatusTask(context, accountKey, statusId);
|
11,489 | @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.getException());
}</BUG>
}
| public UserKey[] getAccountKeys() {
return DataStoreUtils.getActivatedAccountKeys(context);
|
11,490 | 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);
|
11,491 | package org.hisp.dhis.android.core.configuration;
import android.content.ContentValues;
import android.database.MatrixCursor;
<BUG>import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;</BUG>
import org.junit.runner.RunWith;
import static com.google.common.truth.Truth.assertThat;
@RunWith(AndroidJUnit4.class)
| import org.hisp.dhis.android.core.configuration.ConfigurationModel.Columns;
import org.junit.Test;
|
11,492 | cachedFilesMap.put(path, cf2);
if (logger.isTraceEnabled()) logger.trace("Added CachedFile: " + path);
}
return cf2;
}
<BUG>public static CachedFile addCachedFile(File f) {
String path = f.getPath();</BUG>
CachedFile cf = inCache(f);
if (cf == null) {
cf = new CachedFile(path);
| if (f == null) {
if (logger.isTraceEnabled()) logger.trace("addCachedFile(f) - unexpected null parameter");
return null;
String path = f.getPath();
|
11,493 | return (b == null) ? defaults.getBookDetailsCustomFieldsAlways() : b;
}
public void setBookDetailsCustomFieldsAlways(Boolean value) {
setProperty(PROPERTY_NAME_BookDetailsCustomFieldsAlways, value);
}
<BUG>public Boolean getMinimizeChangedFiles() {
Boolean b = getBoolean(PROPERTY_NAME_MINIMIZECHANGEDFILES);
return (b == null) ? defaults.getMinimizeChangedFiles() : b;
}
public void setMinimizeChangedFiles(Boolean minimizeChangedFiles) {
setProperty(PROPERTY_NAME_MINIMIZECHANGEDFILES, minimizeChangedFiles);
}</BUG>
public Boolean isOnlyCatalogAtTargetReadOnly() {
| [DELETED] |
11,494 | return Locale.ENGLISH;
}
public String getIncludedFormatsList() {
return "EPUB, PDF, RTF, TXT, PRC, PDB, MOBI, LRF, LRX, FB2";
}
<BUG>public Boolean getMinimizeChangedFiles() {
return true;
}</BUG>
public Boolean getExternalIcons() {
return true;
| [DELETED] |
11,495 | import eu.optique.r2rml.api.model.RefObjectMap;
import eu.optique.r2rml.api.model.SQLBaseTableOrView;
import eu.optique.r2rml.api.model.SubjectMap;
import eu.optique.r2rml.api.model.Template;
import eu.optique.r2rml.api.model.TriplesMap;
<BUG>import eu.optique.r2rml.api.model.TermMap;
import org.apache.commons.rdf.api.RDF;</BUG>
import org.apache.commons.rdf.api.RDFTerm;
public class MappingFactoryImpl implements MappingFactory {
private RDF rdf;
| import org.apache.commons.rdf.api.IRI;
import org.apache.commons.rdf.api.RDF;
|
11,496 | @Override
public TriplesMap createTriplesMap(LogicalTable lt, SubjectMap sm, String triplesMapIdentifier) {
return new TriplesMapImpl(rdf, lt, sm, triplesMapIdentifier);
}
@Override
<BUG>public TriplesMap createTriplesMap(LogicalTable lt, SubjectMap sm,
PredicateObjectMap pom) {</BUG>
TriplesMap tm = new TriplesMapImpl(rdf, lt, sm);
tm.addPredicateObjectMap(pom);
| public TriplesMap createTriplesMap(LogicalTable lt, SubjectMap sm) {
return new TriplesMapImpl(rdf, lt, sm);
public TriplesMap createTriplesMap(LogicalTable lt, SubjectMap sm, PredicateObjectMap pom) {
|
11,497 | TriplesMap tm = new TriplesMapImpl(rdf, lt, sm, triplesMapIdentifier);
tm.addPredicateObjectMap(pom);
return tm;
}
@Override
<BUG>public TriplesMap createTriplesMap(LogicalTable lt, SubjectMap sm,
List<PredicateObjectMap> listOfPom) {</BUG>
TriplesMap tm = new TriplesMapImpl(rdf, lt, sm);
for (PredicateObjectMap pom : listOfPom) {
| public TriplesMap createTriplesMap(LogicalTable lt, SubjectMap sm, List<PredicateObjectMap> listOfPom) {
|
11,498 | tm.addPredicateObjectMap(pom);
}
return tm;
}
@Override
<BUG>public PredicateObjectMap createPredicateObjectMap(PredicateMap pm,
ObjectMap om) {</BUG>
return new PredicateObjectMapImpl(rdf, pm, om);
}
| [DELETED] |
11,499 |
ObjectMap om) {</BUG>
return new PredicateObjectMapImpl(rdf, pm, om);
}
@Override
<BUG>public PredicateObjectMap createPredicateObjectMap(PredicateMap pm,
RefObjectMap rom) {</BUG>
return new PredicateObjectMapImpl(rdf, pm, rom);
}
| tm.addPredicateObjectMap(pom);
return tm;
public TriplesMap createTriplesMap(LogicalTable lt, SubjectMap sm, PredicateObjectMap pom, String triplesMapIdentifier) {
TriplesMap tm = new TriplesMapImpl(rdf, lt, sm, triplesMapIdentifier);
tm.addPredicateObjectMap(pom);
return tm;
|
11,500 |
RefObjectMap rom) {</BUG>
return new PredicateObjectMapImpl(rdf, pm, rom);
}
@Override
<BUG>public PredicateObjectMap createPredicateObjectMap(List<PredicateMap> pms,
List<ObjectMap> oms, List<RefObjectMap> roms) {</BUG>
return new PredicateObjectMapImpl(rdf, pms, oms, roms);
}
| tm.addPredicateObjectMap(pom);
return tm;
public TriplesMap createTriplesMap(LogicalTable lt, SubjectMap sm, PredicateObjectMap pom, String triplesMapIdentifier) {
TriplesMap tm = new TriplesMapImpl(rdf, lt, sm, triplesMapIdentifier);
tm.addPredicateObjectMap(pom);
return tm;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.