id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
18,201 | 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.fragment.AbsStatusesFragment;
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;
|
18,202 | 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());
|
18,203 | 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 SharedPreferencesWrapper mPreferences;
| public class TwidereDns implements Dns, Constants {
|
18,204 | 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);
|
18,205 | final int hash = values.currentValueHash();
assert hash == bytes.hashCode();
long bucketOrdinal = bucketOrds.add(bytes, hash);
if (bucketOrdinal < 0) { // already seen
bucketOrdinal = - 1 - bucketOrdinal;
<BUG>}
collectBucket(doc, bucketOrdinal);
}</BUG>
}
private static Iterator<BytesRef> terms(final BytesValues.WithOrdinals bytesValues, boolean reverse) {
| collectExistingBucket(doc, bucketOrdinal);
} else {
|
18,206 | final BytesRef bytes = bytesValues.getValueByOrd(ord);
final int hash = bytesValues.currentValueHash();
assert hash == bytes.hashCode();
bucketOrd = bucketOrds.add(bytes, hash);
if (bucketOrd < 0) { // already seen in another segment
<BUG>bucketOrd = -1 - bucketOrd;
}
ordinalToBucket.set(ord, bucketOrd);
}
collectBucket(doc, bucketOrd);</BUG>
}
| collectExistingBucket(doc, bucketOrd);
} else {
collectBucket(doc, bucketOrd);
|
18,207 | for (int i = 0; i < valuesCount; ++i) {
final double val = values.nextValue();
final long bits = Double.doubleToRawLongBits(val);
long bucketOrdinal = bucketOrds.add(bits);
if (bucketOrdinal < 0) { // already seen
<BUG>bucketOrdinal = - 1 - bucketOrdinal;
}
collectBucket(doc, bucketOrdinal);</BUG>
}
}
| collectExistingBucket(doc, bucketOrdinal);
} else {
collectBucket(doc, bucketOrdinal);
|
18,208 | final int valuesCount = values.setDocument(doc);
for (int i = 0; i < valuesCount; ++i) {
final long val = values.nextValue();
long bucketOrdinal = bucketOrds.add(val);
if (bucketOrdinal < 0) { // already seen
<BUG>bucketOrdinal = - 1 - bucketOrdinal;
}
collectBucket(doc, bucketOrdinal);</BUG>
}
}
| collectExistingBucket(doc, bucketOrdinal);
} else {
collectBucket(doc, bucketOrdinal);
|
18,209 | final int valuesCount = values.setDocument(doc);
for (int i = 0; i < valuesCount; ++i) {
final long val = values.nextValue();
long bucketOrdinal = bucketOrds.add(val);
if (bucketOrdinal < 0) { // already seen
<BUG>bucketOrdinal = - 1 - bucketOrdinal;
}
collectBucket(doc, bucketOrdinal);</BUG>
}
}
| collectExistingBucket(doc, bucketOrdinal);
} else {
collectBucket(doc, bucketOrdinal);
|
18,210 | import org.spongepowered.api.world.Locatable;
import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.World;
import javax.annotation.Nullable;
import java.util.List;
<BUG>import java.util.Optional;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG>
public class CommandDelete extends FCCommandBase {
private static final FlagMapper MAPPER = map -> key -> value -> {
map.put(key, value);
| import java.util.stream.Stream;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
|
18,211 | .append(Text.of(TextColors.GREEN, "Usage: "))
.append(getUsage(source))
.build());
return CommandResult.empty();
} else if (isIn(REGIONS_ALIASES, parse.args[0])) {
<BUG>if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!"));
IRegion region = FGManager.getInstance().getRegion(parse.args[1]);
</BUG>
boolean isWorldRegion = false;
if (region == null) {
| String regionName = parse.args[1];
IRegion region = FGManager.getInstance().getRegion(regionName).orElse(null);
|
18,212 | </BUG>
isWorldRegion = true;
}
if (region == null)
<BUG>throw new CommandException(Text.of("No region exists with the name \"" + parse.args[1] + "\"!"));
if (region instanceof GlobalWorldRegion) {
</BUG>
throw new CommandException(Text.of("You may not delete the global region!"));
}
| if (world == null)
throw new CommandException(Text.of("No world exists with name \"" + worldName + "\"!"));
if (world == null) throw new CommandException(Text.of("Must specify a world!"));
region = FGManager.getInstance().getWorldRegion(world, regionName).orElse(null);
throw new CommandException(Text.of("No region exists with the name \"" + regionName + "\"!"));
if (region instanceof IGlobal) {
|
18,213 | source.getName() + " deleted " + (isWorldRegion ? "world" : "") + "region"
);
return CommandResult.success();
} else if (isIn(HANDLERS_ALIASES, parse.args[0])) {
if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!"));
<BUG>IHandler handler = FGManager.getInstance().gethandler(parse.args[1]);
if (handler == null)
throw new ArgumentParseException(Text.of("No handler exists with that name!"), parse.args[1], 1);
if (handler instanceof GlobalHandler)</BUG>
throw new CommandException(Text.of("You may not delete the global handler!"));
| Optional<IHandler> handlerOpt = FGManager.getInstance().gethandler(parse.args[1]);
if (!handlerOpt.isPresent())
IHandler handler = handlerOpt.get();
if (handler instanceof GlobalHandler)
|
18,214 | .excludeCurrent(true)
.autoCloseQuotes(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "handler").stream()
.filter(new StartsWithPredicate(parse.current.token))</BUG>
.map(args -> parse.current.prefix + args)
.collect(GuavaCollectors.toImmutableList());
else if (parse.current.index == 1) {
| return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
18,215 | .excludeCurrent(true)
.autoCloseQuotes(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "handler").stream()
.filter(new StartsWithPredicate(parse.current.token))</BUG>
.map(args -> parse.current.prefix + args)
.collect(GuavaCollectors.toImmutableList());
else if (parse.current.index == 1) {
| return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
18,216 | @Dependency(id = "foxcore")
},
description = "A world protection plugin built for SpongeAPI. Requires FoxCore.",
authors = {"gravityfox"},
url = "https://github.com/FoxDenStudio/FoxGuard")
<BUG>public final class FoxGuardMain {
public final Cause pluginCause = Cause.builder().named("plugin", this).build();
private static FoxGuardMain instanceField;</BUG>
@Inject
private Logger logger;
| private static FoxGuardMain instanceField;
|
18,217 | private UserStorageService userStorage;
private EconomyService economyService = null;
private boolean loaded = false;
private FCCommandDispatcher fgDispatcher;
public static FoxGuardMain instance() {
<BUG>return instanceField;
}</BUG>
@Listener
public void construct(GameConstructionEvent event) {
instanceField = this;
| }
public static Cause getCause() {
return instance().pluginCause;
}
|
18,218 | return configDirectory;
}
public boolean isLoaded() {
return loaded;
}
<BUG>public static Cause getCause() {
return instance().pluginCause;
}</BUG>
public EconomyService getEconomyService() {
return economyService;
| [DELETED] |
18,219 | import org.spongepowered.api.world.Locatable;
import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.World;
import javax.annotation.Nullable;
import java.util.*;
<BUG>import java.util.stream.Collectors;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG>
public class CommandHere extends FCCommandBase {
private static final String[] PRIORITY_ALIASES = {"priority", "prio", "p"};
private static final FlagMapper MAPPER = map -> key -> value -> {
| import java.util.stream.Stream;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
|
18,220 | .excludeCurrent(true)
.autoCloseQuotes(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "handler").stream()
.filter(new StartsWithPredicate(parse.current.token))</BUG>
.map(args -> parse.current.prefix + args)
.collect(GuavaCollectors.toImmutableList());
else if (parse.current.index > 0) {
| return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
18,221 | private static FGStorageManager instance;
private final Logger logger = FoxGuardMain.instance().getLogger();</BUG>
private final Set<LoadEntry> loaded = new HashSet<>();
private final Path directory = getDirectory();
private final Map<String, Path> worldDirectories;
<BUG>private FGStorageManager() {
defaultModifiedMap = new CacheMap<>((k, m) -> {</BUG>
if (k instanceof IFGObject) {
m.put((IFGObject) k, true);
return true;
| public final HashMap<IFGObject, Boolean> defaultModifiedMap;
private final UserStorageService userStorageService;
private final Logger logger = FoxGuardMain.instance().getLogger();
userStorageService = FoxGuardMain.instance().getUserStorage();
defaultModifiedMap = new CacheMap<>((k, m) -> {
|
18,222 | String name = fgObject.getName();
Path singleDir = dir.resolve(name.toLowerCase());
</BUG>
boolean shouldSave = fgObject.shouldSave();
if (force || shouldSave) {
<BUG>logger.info((shouldSave ? "S" : "Force s") + "aving handler \"" + name + "\" in directory: " + singleDir);
</BUG>
constructDirectory(singleDir);
try {
fgObject.save(singleDir);
| UUID owner = fgObject.getOwner();
boolean isOwned = !owner.equals(SERVER_UUID);
Optional<User> userOwner = userStorageService.get(owner);
String logName = (userOwner.isPresent() ? userOwner.get().getName() + ":" : "") + (isOwned ? owner + ":" : "") + name;
if (fgObject.autoSave()) {
Path singleDir = serverDir.resolve(name.toLowerCase());
logger.info((shouldSave ? "S" : "Force s") + "aving handler " + logName + " in directory: " + singleDir);
|
18,223 | if (fgObject.autoSave()) {
Path singleDir = dir.resolve(name.toLowerCase());
</BUG>
boolean shouldSave = fgObject.shouldSave();
if (force || shouldSave) {
<BUG>logger.info((shouldSave ? "S" : "Force s") + "aving world region \"" + name + "\" in directory: " + singleDir);
</BUG>
constructDirectory(singleDir);
try {
fgObject.save(singleDir);
| Path singleDir = serverDir.resolve(name.toLowerCase());
logger.info((shouldSave ? "S" : "Force s") + "aving world region " + logName + " in directory: " + singleDir);
|
18,224 | public synchronized void loadRegionLinks() {
logger.info("Loading region links");
try (DB mainDB = DBMaker.fileDB(directory.resolve("regions.foxdb").normalize().toString()).make()) {
Map<String, String> linksMap = mainDB.hashMap("links", Serializer.STRING, Serializer.STRING).createOrOpen();
linksMap.entrySet().forEach(entry -> {
<BUG>IRegion region = FGManager.getInstance().getRegion(entry.getKey());
if (region != null) {
logger.info("Loading links for region \"" + region.getName() + "\"");</BUG>
String handlersString = entry.getValue();
| Optional<IRegion> regionOpt = FGManager.getInstance().getRegion(entry.getKey());
if (regionOpt.isPresent()) {
IRegion region = regionOpt.get();
logger.info("Loading links for region \"" + region.getName() + "\"");
|
18,225 | public synchronized void loadWorldRegionLinks(World world) {
logger.info("Loading world region links for world \"" + world.getName() + "\"");
try (DB mainDB = DBMaker.fileDB(worldDirectories.get(world.getName()).resolve("wregions.foxdb").normalize().toString()).make()) {
Map<String, String> linksMap = mainDB.hashMap("links", Serializer.STRING, Serializer.STRING).createOrOpen();
linksMap.entrySet().forEach(entry -> {
<BUG>IRegion region = FGManager.getInstance().getWorldRegion(world, entry.getKey());
if (region != null) {
logger.info("Loading links for world region \"" + region.getName() + "\"");</BUG>
String handlersString = entry.getValue();
| Optional<IWorldRegion> regionOpt = FGManager.getInstance().getWorldRegion(world, entry.getKey());
if (regionOpt.isPresent()) {
IWorldRegion region = regionOpt.get();
logger.info("Loading links for world region \"" + region.getName() + "\"");
|
18,226 | StringBuilder builder = new StringBuilder();
for (Iterator<IHandler> it = handlers.iterator(); it.hasNext(); ) {
builder.append(it.next().getName());
if (it.hasNext()) builder.append(",");
}
<BUG>return builder.toString();
}</BUG>
private final class LoadEntry {
public final String name;
public final Type type;
| public enum Type {
REGION, WREGION, HANDLER
|
18,227 | .autoCloseQuotes(true)
.leaveFinalAsIs(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "worldregion", "handler", "controller").stream()
</BUG>
.filter(new StartsWithPredicate(parse.current.token))
.collect(GuavaCollectors.toImmutableList());
else if (parse.current.index == 1) {
| return Stream.of("region", "worldregion", "handler", "controller")
|
18,228 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
18,229 | final int lineStride = dst.getScanlineStride();
final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final byte[][] data = dst.getByteDataArrays();
final float[] warpData = new float[2 * dstWidth];
<BUG>int lineOffset = 0;
if (ctable == null) { // source does not have IndexColorModel
if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
18,230 | pixelOffset += pixelStride;
} // COLS LOOP
} // ROWS LOOP
}
} else {// source has IndexColorModel
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| } else if (caseB) {
for (int h = 0; h < dstHeight; h++) {
|
18,231 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
18,232 | final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final short[][] data = dst.getShortDataArrays();
final float[] warpData = new float[2 * dstWidth];
int lineOffset = 0;
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
18,233 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
18,234 | final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final short[][] data = dst.getShortDataArrays();
final float[] warpData = new float[2 * dstWidth];
int lineOffset = 0;
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
18,235 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
18,236 | final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final int[][] data = dst.getIntDataArrays();
final float[] warpData = new float[2 * dstWidth];
int lineOffset = 0;
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
18,237 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
18,238 | final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final float[][] data = dst.getFloatDataArrays();
final float[] warpData = new float[2 * dstWidth];
int lineOffset = 0;
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
18,239 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
18,240 | final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final double[][] data = dst.getDoubleDataArrays();
final float[] warpData = new float[2 * dstWidth];
int lineOffset = 0;
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
18,241 | }
return nodes;
}
private PermissionNode toPermissionNode(OrganizationalUnit ou) {
PermissionLeafNode node = new PermissionLeafNode();
<BUG>node.setNodeName(ou.getName());
node.addPermission(newPermission(ou, READ), i18n.OrganizationalUnitActionRead());
node.addPermission(newPermission(ou, UPDATE), i18n.OrganizationalUnitActionUpdate());
node.addPermission(newPermission(ou, DELETE), i18n.OrganizationalUnitActionDelete());
return node;</BUG>
}
| @Inject
public OrganizationalUnitTreeProvider(PermissionManager permissionManager, Caller<OrganizationalUnitSearchService> searchService) {
this.permissionManager = permissionManager;
this.searchService = searchService;
|
18,242 | }
return nodes;
}
private PermissionNode toPermissionNode(Repository r) {
PermissionLeafNode node = new PermissionLeafNode();
<BUG>node.setNodeName(r.getAlias());
node.addPermission(newPermission(r, READ), i18n.RepositoryActionRead());
node.addPermission(newPermission(r, UPDATE), i18n.RepositoryActionUpdate());
node.addPermission(newPermission(r, DELETE), i18n.RepositoryActionDelete());
return node;</BUG>
}
| @Inject
public RepositoryTreeProvider(PermissionManager permissionManager, Caller<RepositorySearchService> searchService) {
this.permissionManager = permissionManager;
this.searchService = searchService;
|
18,243 | CommonConstants INSTANCE = GWT.create(CommonConstants.class);
String IndexClonedRepositoryWarning();
String copyRepositoryUrl();
String ManagedRepository();
String RepoCloneFail();
<BUG>String RepositoriesNode();
String RepositoryResource();</BUG>
String RepositoryActionRead();
String RepositoryActionUpdate();
String RepositoryActionDelete();
| String RepositoriesHelp();
String RepositoryResource();
|
18,244 | String RepositorySourceLocal();
String RepositorySourceProject();
String RepositorySourceSettings();
String RepositorySourceDistributionManagement();
String RepositorySourceUnknown();
<BUG>String ProjectsNode();
String ProjectResource();</BUG>
String ProjectActionRead();
String ProjectActionUpdate();
String ProjectActionDelete();
| String ProjectsHelp();
String ProjectResource();
|
18,245 | package net.ttddyy.dsproxy.test;
import net.ttddyy.dsproxy.proxy.ParameterKey;
<BUG>import java.util.ArrayList;
import java.util.LinkedHashMap;</BUG>
import java.util.List;
import java.util.Map;
import static net.ttddyy.dsproxy.proxy.ParameterKeyUtils.toIndexMap;
| import java.util.HashMap;
import java.util.LinkedHashMap;
|
18,246 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
18,247 | final int lineStride = dst.getScanlineStride();
final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final byte[][] data = dst.getByteDataArrays();
final float[] warpData = new float[2 * dstWidth];
<BUG>int lineOffset = 0;
if (ctable == null) { // source does not have IndexColorModel
if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
18,248 | pixelOffset += pixelStride;
} // COLS LOOP
} // ROWS LOOP
}
} else {// source has IndexColorModel
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| } else if (caseB) {
for (int h = 0; h < dstHeight; h++) {
|
18,249 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
18,250 | final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final short[][] data = dst.getShortDataArrays();
final float[] warpData = new float[2 * dstWidth];
int lineOffset = 0;
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
18,251 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
18,252 | final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final short[][] data = dst.getShortDataArrays();
final float[] warpData = new float[2 * dstWidth];
int lineOffset = 0;
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
18,253 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
18,254 | final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final int[][] data = dst.getIntDataArrays();
final float[] warpData = new float[2 * dstWidth];
int lineOffset = 0;
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
18,255 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
18,256 | final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final float[][] data = dst.getFloatDataArrays();
final float[] warpData = new float[2 * dstWidth];
int lineOffset = 0;
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
18,257 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
18,258 | final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final double[][] data = dst.getDoubleDataArrays();
final float[] warpData = new float[2 * dstWidth];
int lineOffset = 0;
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
18,259 | permissionChecker, folder, ActionKeys.ACCESS) &&
!BookmarksFolderPermission.contains(
permissionChecker, folder, ActionKeys.VIEW)) {
return false;
}
<BUG>if (BookmarksFolderPermission.contains(
permissionChecker, folder, actionId)) {
return true;
}</BUG>
}
| [DELETED] |
18,260 | permissionChecker, dlFolder, ActionKeys.ACCESS) &&
!DLFolderPermission.contains(
permissionChecker, dlFolder, ActionKeys.VIEW)) {
return false;
}
<BUG>if (!actionId.equals(ActionKeys.OVERRIDE_CHECKOUT) &&
DLFolderPermission.contains(
permissionChecker, dlFolder, actionId)) {
return true;
}</BUG>
}
| [DELETED] |
18,261 | actionId = ActionKeys.ADD_SUBCATEGORY;
}
if (MBBanLocalServiceUtil.hasBan(
category.getGroupId(), permissionChecker.getUserId())) {
return false;
<BUG>}
long categoryId = category.getCategoryId();
if (PropsValues.PERMISSIONS_VIEW_DYNAMIC_INHERITANCE) {
long originalCategoryId = categoryId;
try {</BUG>
while (categoryId !=
| if (actionId.equals(ActionKeys.VIEW) &&
try {
|
18,262 | while (categoryId !=
MBCategoryConstants.DEFAULT_PARENT_CATEGORY_ID) {
category = MBCategoryLocalServiceUtil.getCategory(
categoryId);
if (!_hasPermission(
<BUG>permissionChecker, category, ActionKeys.VIEW)) {
</BUG>
return false;
}
categoryId = category.getParentCategoryId();
| permissionChecker, category, actionId)) {
|
18,263 | public static boolean debugMode = false;
@ModConfigProperty(category = "Debug", name = "debugModeGOTG", comment = "Enable/Disable Debug Mode for the Gift Of The Gods")
public static boolean debugModeGOTG = false;
@ModConfigProperty(category = "Debug", name = "debugModeEnchantments", comment = "Enable/Disable Debug Mode for the Enchantments")
public static boolean debugModeEnchantments = false;
<BUG>@ModConfigProperty(category = "Weapons", name = "enableSwordsRecipes", comment = "Enable/Disable The ArmorPlus Sword's Recipes")
public static boolean enableSwordsRecipes = true;
@ModConfigProperty(category = "Weapons", name = "enableBattleAxesRecipes", comment = "Enable/Disable The ArmorPlus Battle Axes's Recipes")
public static boolean enableBattleAxesRecipes = true;
@ModConfigProperty(category = "Weapons", name = "enableBowsRecipes", comment = "Enable/Disable The ArmorPlus Bows's Recipes")
public static boolean enableBowsRecipes = true;
@ModConfigProperty(category = "Armors.SuperStarArmor.Effects", name = "enableSuperStarHRegen", comment = "Enable/Disable The Super Star Helmet Regeneration")
</BUG>
public static boolean enableSuperStarHRegen = true;
| @ModConfigProperty(category = "Weapons", name = "enableSwordsRecipes", comment = "Enable/Disable ArmorPlus Sword's Recipes")
@ModConfigProperty(category = "Weapons", name = "enableBattleAxesRecipes", comment = "Enable/Disable ArmorPlus Battle Axes's Recipes")
@ModConfigProperty(category = "Weapons", name = "enableBowsRecipes", comment = "Enable/Disable ArmorPlus Bows's Recipes")
|
18,264 | import android.os.Bundle;
import android.os.SystemProperties;
import android.provider.SearchIndexableResource;
import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceCategory;
<BUG>import android.support.v7.preference.PreferenceScreen;
import android.telecom.PhoneAccountHandle;</BUG>
import android.telecom.TelecomManager;
import android.telephony.PhoneNumberUtils;
import android.telephony.PhoneStateListener;
| import android.telecom.PhoneAccount;
import android.telecom.PhoneAccountHandle;
|
18,265 | import org.apache.commons.io.FileUtils;
public class BetterFpsHelper {
public static final String MC_VERSION = "1.9";
public static final String VERSION = "1.2.1";
public static final String URL = "http://guichaguri.github.io/BetterFps/";
<BUG>public static final String UPDATE_URL = "https://raw.githubusercontent.com/Guichaguri/BetterFps/1.8/lastest-version.properties";
public static final LinkedHashMap<String, String> helpers = new LinkedHashMap<String, String>();</BUG>
public static final LinkedHashMap<String, String> displayHelpers = new LinkedHashMap<String, String>();
static {
helpers.put("vanilla", "VanillaMath");
| public static final String UPDATE_URL = "http://widget.mcf.li/mc-mods/minecraft/229876-betterfps.json";
public static final LinkedHashMap<String, String> helpers = new LinkedHashMap<String, String>();
|
18,266 | <BUG>package guichaguri.betterfps;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Properties;</BUG>
import net.minecraft.client.Minecraft;
| import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import java.io.InputStreamReader;
|
18,267 | import net.minecraft.util.text.event.ClickEvent;
import net.minecraft.util.text.event.HoverEvent;
public class UpdateChecker implements Runnable {
private static boolean updateCheck = false;
private static boolean done = false;
<BUG>private static Properties prop = null;
public static void check() {</BUG>
if(!BetterFpsConfig.getConfig().updateChecker) {
done = true;
return;
| private static String updateVersion = null;
private static String updateDownload = null;
public static void check() {
|
18,268 | thread.setDaemon(true);
thread.start();
}
}
public static void showChat() {
<BUG>if(!done) return;
if(prop == null) return;
if(BetterFpsHelper.VERSION.equals(prop.getProperty("version"))) {
prop = null;
return;
}</BUG>
if(!BetterFps.isClient) return;
| if(updateVersion == null && updateDownload == null) return;
|
18,269 | @CopyMode(Mode.IGNORE) // Ignore the constructor to prevent an infinite loop
public HopperBlock() {
}
@Override
@CopyMode(Mode.APPEND)
<BUG>public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) {
</BUG>
TileEntity te = worldIn.getTileEntity(pos);
if(te != null) {
TileEntityHopper hopper = (TileEntityHopper)te;
| public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block neighborBlock) {
|
18,270 | xml.appendAttribute("layout", "stacked");
break;
default:
throw new SystemException("Unknown layout type: " + select.getButtonLayout());
}
<BUG>xml.appendOptionalAttribute("min", min > 0, min);
xml.appendOptionalAttribute("max", max > 0, max);</BUG>
xml.appendClose();
List<?> options = select.getOptions();
boolean renderSelectionsOnly = readOnly;
| [DELETED] |
18,271 | if (minDate != null) {
xml.appendAttribute("min", new SimpleDateFormat(INTERNAL_DATE_FORMAT).format(minDate));
}
if (maxDate != null) {
<BUG>xml.appendAttribute("max", new SimpleDateFormat(INTERNAL_DATE_FORMAT).format(maxDate));
}</BUG>
xml.appendClose();
if (date == null) {
xml.appendEscaped(dateField.getText());
}
| if (date != null) {
xml.appendAttribute("date", new SimpleDateFormat(INTERNAL_DATE_FORMAT).format(date));
|
18,272 | class WEmailFieldRenderer extends AbstractWebXmlRenderer {
@Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WEmailField field = (WEmailField) component;
XmlStringBuilder xml = renderContext.getWriter();
<BUG>boolean isReadOnly = field.isReadOnly();
</BUG>
xml.appendTagOpen("ui:emailfield");
xml.appendAttribute("id", component.getId());
xml.appendOptionalAttribute("class", component.getHtmlClass());
| boolean readOnly = field.isReadOnly();
|
18,273 | xml.appendTagOpen("ui:emailfield");
xml.appendAttribute("id", component.getId());
xml.appendOptionalAttribute("class", component.getHtmlClass());
xml.appendOptionalAttribute("track", component.isTracking(), "true");
xml.appendOptionalAttribute("hidden", component.isHidden(), "true");
<BUG>xml.appendOptionalAttribute("readOnly", isReadOnly, "true");
if (!isReadOnly) {
int cols = field.getColumns();</BUG>
int maxLength = field.getMaxLength();
| if (readOnly) {
xml.appendAttribute("readOnly", "true");
} else {
int cols = field.getColumns();
|
18,274 | xml.appendOptionalAttribute("toolTip", widget.getToolTip());
xml.appendOptionalAttribute("accessibleText", widget.getAccessibleText());
xml.appendOptionalAttribute("acceptedMimeTypes", typesToString(widget.getFileTypes()));
xml.appendOptionalAttribute("maxFileSize", maxFileSize > 0, maxFileSize);
xml.appendOptionalAttribute("maxFiles", maxFiles > 0, maxFiles);
<BUG>if (widget.getColumns() != null) {
xml.appendAttribute("cols", widget.getColumns());
}</BUG>
if (dropzone != null) {
xml.appendAttribute("dropzone", dropzone.getId());
| [DELETED] |
18,275 | if (editor.getUseCamera()) {
xml.appendAttribute("camera", true);
}
}
if (widget.getFileAjaxAction() != null) {
<BUG>xml.appendAttribute("ajax", "true");
}</BUG>
if (widget.getFiles().isEmpty()) {
xml.appendEnd();
} else {
| if (widget.getColumns() != null) {
xml.appendAttribute("cols", widget.getColumns());
|
18,276 | int min = multiSelectPair.getMinSelect();
int max = multiSelectPair.getMaxSelect();</BUG>
xml.appendTagOpen("ui:multiselectpair");
xml.appendAttribute("id", component.getId());
xml.appendOptionalAttribute("class", component.getHtmlClass());
<BUG>xml.appendOptionalAttribute("track", component.isTracking(), "true");
xml.appendAttribute("size", rows < 2 ? WMultiSelectPair.DEFAULT_ROWS : rows);
xml.appendOptionalAttribute("disabled", disabled, "true");
xml.appendOptionalAttribute("hidden", multiSelectPair.isHidden(), "true");
</BUG>
xml.appendOptionalAttribute("required", multiSelectPair.isMandatory(), "true");
| int max = multiSelectPair.getMaxSelect();
xml.appendOptionalAttribute("disabled", multiSelectPair.isDisabled(), "true");
|
18,277 | xml.appendOptionalAttribute("shuffle", multiSelectPair.isShuffle(), "true");
xml.appendOptionalAttribute("fromListName", multiSelectPair.getAvailableListName());
xml.appendOptionalAttribute("toListName", multiSelectPair.getSelectedListName());
xml.appendOptionalAttribute("accessibleText", multiSelectPair.getAccessibleText());
xml.appendOptionalAttribute("min", min > 0, min);
<BUG>xml.appendOptionalAttribute("max", max > 0, max);
xml.appendClose();</BUG>
List<?> options = multiSelectPair.getOptions();
boolean renderSelectionsOnly = readOnly;
if (options != null) {
| }
xml.appendClose();
|
18,278 | import java.util.List;
final class WDropdownRenderer extends AbstractWebXmlRenderer {
@Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WDropdown dropdown = (WDropdown) component;
<BUG>XmlStringBuilder xml = renderContext.getWriter();
String dataKey = dropdown.getListCacheKey();
int optionWidth = dropdown.getOptionWidth();
boolean readOnly = dropdown.isReadOnly();</BUG>
xml.appendTagOpen("ui:dropdown");
| boolean readOnly = dropdown.isReadOnly();
|
18,279 | Intent intent = new Intent(Constants.SYSTEM_APP_SERVICE_START_ACTION);
Intent explicitIntent = createExplicitFromImplicitIntent(context, intent);
if (explicitIntent != null) {
intent = explicitIntent;
}
<BUG>intent.putExtra("code", operation);
intent.setPackage(Constants.PACKAGE_NAME);</BUG>
if (appUri != null) {
intent.putExtra("appUri", appUri);
}
| intent.putExtra(Constants.OPERATION_CODE, operation);
intent.setPackage(Constants.PACKAGE_NAME);
|
18,280 | try {
otaServerManager = new OTAServerManager(this.context);
otaServerManager.setStateChangeListener(this);
} catch (MalformedURLException e) {
otaServerManager = null;
<BUG>String message = "Firmware upgrade URL provided is not valid.";
sendBroadcast(Constants.Operation.GET_FIRMWARE_UPGRADE_PACKAGE_STATUS,
Constants.Status.MALFORMED_OTA_URL, message);</BUG>
CommonUtils.callAgentApp(context, Constants.Operation.
| if (Preference.getBoolean(context, context.getResources().getString(R.string.
firmware_status_check_in_progress))) {
CommonUtils.sendBroadcast(context, Constants.Operation.GET_FIRMWARE_UPGRADE_PACKAGE_STATUS, Constants.Code.FAILURE,
Constants.Status.MALFORMED_OTA_URL, message);
} else {
CommonUtils.sendBroadcast(context, Constants.Operation.UPGRADE_FIRMWARE, Constants.Code.FAILURE,
Constants.Status.MALFORMED_OTA_URL, message);
|
18,281 | con.setConnectTimeout(Constants.FIRMWARE_UPGRADE_CONNECTIVITY_TIMEOUT);
con.setReadTimeout(Constants.FIRMWARE_UPGRADE_READ_TIMEOUT);
return (long) con.getContentLength();
} catch (SocketTimeoutException e) {
String message = "Connection failure (Socket timeout) when retrieving update package size.";
<BUG>Log.e(TAG, message + e);
sendBroadcast(Constants.Operation.GET_FIRMWARE_UPGRADE_PACKAGE_STATUS,
Constants.Status.CONNECTION_FAILED, message);</BUG>
CommonUtils.callAgentApp(context, Constants.Operation.FAILED_FIRMWARE_UPGRADE_NOTIFICATION, 0, null);
return (long) -1;
| CommonUtils.sendBroadcast(context, operation, Constants.Code.FAILURE, Constants.Status.CONNECTION_FAILED, message);
|
18,282 | public static final String USERNAME = "username";
public static final String PASSWORD = "password";
public static final String STATUS = "status";
public static final String RESPONSE = "response";
public static final String PAYLOAD = "payLoad";
<BUG>public static final String CODE = "code";
</BUG>
public static final String TYPE = "type";
public static final String ID = "id";
public static final String TYPE_COMMAND = "COMMAND";
| public static final String OPERATION_CODE = "operation";
|
18,283 | public class ApplicationManagementService extends IntentService implements APIResultCallBack {
private static final String TAG = ApplicationManagementService.class.getName();
private static final String INTENT_KEY_PAYLOAD = "payload";
private static final String INTENT_KEY_STATUS = "status";
private static final String INTENT_KEY_SERVER = "server";
<BUG>private static final String INTENT_KEY_CODE = "code";
</BUG>
private static final String INTENT_KEY_APP_URI = "appUri";
private static final String INTENT_KEY_APP_NAME = "appName";
private static final String INTENT_KEY_MESSAGE = "message";
| private static final String INTENT_KEY_OPERATION_CODE = "operation";
|
18,284 | protected void onHandleIntent(Intent intent) {
Bundle extras = intent.getExtras();
context = this.getApplicationContext();
utils = new ServerConfig();
if (extras != null) {
<BUG>operationCode = extras.getString(INTENT_KEY_CODE);
</BUG>
if (extras.containsKey(INTENT_KEY_APP_URI)) {
appUri = extras.getString(INTENT_KEY_APP_URI);
}
| operationCode = extras.getString(INTENT_KEY_OPERATION_CODE);
|
18,285 | startAdmin();
} else {
Log.d(TAG, "Entered onHandleIntent of the Command Runner Service.");
Bundle extras = intent.getExtras();
if (extras != null) {
<BUG>operationCode = extras.getString("code");
</BUG>
if (extras.containsKey("command")) {
command = extras.getString("command");
if (command != null && (command.equals("true") || command.equals("false"))) {
| operationCode = extras.getString("operation");
|
18,286 | private void startAdmin() {
Intent intentDeviceAdmin = new Intent(this, MainActivity.class);
intentDeviceAdmin.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intentDeviceAdmin);
}
<BUG>public void doTask(String code) {
switch (code) {
case Constants.Operation.DEVICE_LOCK:</BUG>
enableHardLock();
| public void doTask(String operationCode) {
switch (operationCode) {
case Constants.Operation.DEVICE_LOCK:
|
18,287 | .getString(R.string.firmware_upgrade_automatic_retry), isAutomaticUpgrade);
if (!upgradeData.isNull(context.getResources().getString(R.string.firmware_server))) {
server = (String) upgradeData.get(context.getResources().getString(R.string.firmware_server));
if(server.isEmpty() || (!server.isEmpty() && !Patterns.WEB_URL.matcher(server).matches())) {
String message = "Firmware upgrade URL provided is not valid.";
<BUG>sendBroadcast(Constants.Operation.GET_FIRMWARE_UPGRADE_PACKAGE_STATUS,
Constants.Status.MALFORMED_OTA_URL, message);</BUG>
CommonUtils.callAgentApp(context, Constants.Operation.
FIRMWARE_UPGRADE_FAILURE, Preference.getInt(
context, context.getResources().getString(R.string.operation_id)), message);
| CommonUtils.sendBroadcast(context, Constants.Operation.UPGRADE_FIRMWARE, Constants.Code.FAILURE,
Constants.Status.MALFORMED_OTA_URL, message);
|
18,288 | } else {
Preference.putString(context, context.getResources().getString(R.string.firmware_server), server);
}
}
} catch (JSONException e) {
<BUG>Log.e(TAG, "Firmware upgrade payload parsing failed." + e);
}</BUG>
}
if (schedule != null && !schedule.trim().isEmpty()) {
Log.i(TAG, "Upgrade scheduled received: " + schedule);
| return;
|
18,289 | Log.i(TAG, "Upgrade scheduled received: " + schedule);
Preference.putString(context, context.getResources().getString(R.string.alarm_schedule), schedule);
try {
AlarmUtils.setOneTimeAlarm(context, schedule, Constants.Operation.UPGRADE_FIRMWARE, null);
} catch (ParseException e) {
<BUG>Log.e(TAG, "One time alarm time string parsing failed." + e);
}</BUG>
} else {
if (isStatusCheck) {
Log.i(TAG, "Firmware status check is initiated by admin.");
| CommonUtils.sendBroadcast(context, Constants.Operation.UPGRADE_FIRMWARE, Constants.Code.FAILURE,
Constants.Status.MALFORMED_REQUEST, e.getMessage());
}
|
18,290 | 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.util.DataStoreUtils;
import de.vanita5.twittnuker.util.ImagePreloader;</BUG>
import de.vanita5.twittnuker.util.InternalTwitterContentUtils;
import de.vanita5.twittnuker.util.JsonSerializer;
import de.vanita5.twittnuker.util.NotificationManagerWrapper;
| import de.vanita5.twittnuker.util.DebugLog;
import de.vanita5.twittnuker.util.ImagePreloader;
|
18,291 | 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);
|
18,292 | @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);
|
18,293 | 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);
|
18,294 | 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);
|
18,295 | 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);
|
18,296 | 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);
|
18,297 | 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.fragment.AbsStatusesFragment;
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;
|
18,298 | 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());
|
18,299 | 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 SharedPreferencesWrapper mPreferences;
| public class TwidereDns implements Dns, Constants {
|
18,300 | 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);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.