id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
12,001
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")
12,002
package com.example.appnotificationmanagerdemo1; import android.annotation.SuppressLint; import android.app.ActionBar; import android.app.ActionBar.Tab; <BUG>import android.app.Activity; import android.app.AlertDialog;</BUG> import android.app.DatePickerDialog; import android.app.Dialog; import android.app.Fragment;
import android.app.AlarmManager; import android.app.AlertDialog;
12,003
NotificationManager mNotificationManager; String one,two,three; Notification.Builder mNotificationBuilder; int mLightOn= 1000; int mLightOff= 1000; <BUG>int mColor = Color.BLUE; public jNotificationManager(Controls _ctrls, long _Self) { //Add more others news "_xxx" params if needed!</BUG> context = _ctrls.activity; pascalObj = _Self; controls = _ctrls;
int mColor; int mId; public jNotificationManager(Controls _ctrls, long _Self) { //Add more others news "_xxx" params if needed!
12,004
catch (Exception e) { Log.e("jNotificationManager", "Failure to get drawable id.", e); return 0; } } <BUG>public void Notify(int _id, String _title, String _subject, String _body, String _iconIdentifier){ </BUG> int icon; if (_iconIdentifier.equals("")) icon = android.R.drawable.ic_dialog_info;
public void Notify(int _id, String _title, String _subject, String _body, String _iconIdentifier, int _color){
12,005
mNotificationBuilder = new Notification.Builder(controls.activity); //need API >= 11 !! mNotificationBuilder.setContentTitle(_title); mNotificationBuilder.setContentText(_subject); mNotificationBuilder.setContentInfo(_body); mNotificationBuilder.setSmallIcon(icon); <BUG>mNotificationBuilder.setLights(mColor, mLightOn, mLightOff); //thanks to freris if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {</BUG> mNotificationManager.notify(_id, mNotificationBuilder.build()); }
mNotificationBuilder.setLights(_color, mLightOn, mLightOff); //thanks to freris mColor = _color; mId = _id; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
12,006
package com.example.dummyapp; import android.annotation.SuppressLint; import android.app.ActionBar; import android.app.ActionBar.Tab; <BUG>import android.app.Activity; import android.app.AlertDialog;</BUG> import android.app.DatePickerDialog; import android.app.Dialog; import android.app.Fragment;
import android.app.AlarmManager; import android.app.AlertDialog;
12,007
NotificationManager mNotificationManager; String one,two,three; Notification.Builder mNotificationBuilder; int mLightOn= 1000; int mLightOff= 1000; <BUG>int mColor = Color.BLUE; public jNotificationManager(Controls _ctrls, long _Self) { //Add more others news "_xxx" params if needed!</BUG> context = _ctrls.activity; pascalObj = _Self; controls = _ctrls;
int mColor; int mId; public jNotificationManager(Controls _ctrls, long _Self) { //Add more others news "_xxx" params if needed!
12,008
catch (Exception e) { Log.e("jNotificationManager", "Failure to get drawable id.", e); return 0; } } <BUG>public void Notify(int _id, String _title, String _subject, String _body, String _iconIdentifier){ </BUG> int icon; if (_iconIdentifier.equals("")) icon = android.R.drawable.ic_dialog_info;
public void Notify(int _id, String _title, String _subject, String _body, String _iconIdentifier, int _color){
12,009
mNotificationBuilder = new Notification.Builder(controls.activity); //need API >= 11 !! mNotificationBuilder.setContentTitle(_title); mNotificationBuilder.setContentText(_subject); mNotificationBuilder.setContentInfo(_body); mNotificationBuilder.setSmallIcon(icon); <BUG>mNotificationBuilder.setLights(mColor, mLightOn, mLightOff); //thanks to freris if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {</BUG> mNotificationManager.notify(_id, mNotificationBuilder.build()); }
mNotificationBuilder.setLights(_color, mLightOn, mLightOff); //thanks to freris mColor = _color; mId = _id; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
12,010
pathLabel.setText("<html><u>" + shortenPath(reportPath) + "</u></html>"); pathLabel.setToolTipText(reportPath); reportProgressBar.setIndeterminate(true); reportProgressBar.setMaximum(100); processingLabel.setText("Queuing..."); <BUG>STATUS = ReportStatus.QUEUING; final String linkPath = reportPath;</BUG> pathLabel.addMouseListener(new MouseListener() { @Override public void mouseClicked(MouseEvent e) {
if (reportPath != null) { final String linkPath = reportPath;
12,011
public final class Tuple<T> { private final T red; private final T black; public Tuple(T red, T black) { this.red = red; <BUG>this.black = black; }</BUG> public T getRed() { return red; }
@SuppressWarnings("unchecked") public static <U> Tuple<U> of(Object red, Object black) { return new Tuple<>((U)red, (U)black);
12,012
TypeTag singleParameterTag = copyGenericTypesInto(actualParameterRawType, tag); prefabValues.realizeCacheFor(singleParameterTag, clone); Object red = ci.callFactory(factoryType, factoryMethod, classes(declaredParameterRawType), objects(prefabValues.giveRed(singleParameterTag))); Object black = ci.callFactory(factoryType, factoryMethod, <BUG>classes(declaredParameterRawType), objects(prefabValues.giveBlack(singleParameterTag))); @SuppressWarnings("unchecked") Tuple<T> result = new Tuple<>((T)red, (T)black); return result;</BUG> }
return Tuple.of(red, black);
12,013
public Tuple<EnumSet> createValues(TypeTag tag, PrefabValues prefabValues, LinkedHashSet<TypeTag> typeStack) { ConditionalInstantiator ci = new ConditionalInstantiator(EnumSet.class.getName()); LinkedHashSet<TypeTag> clone = cloneWith(typeStack, tag); TypeTag entryTag = determineAndCacheActualTypeTag(0, tag, prefabValues, clone, Enum.class); EnumSet red = (EnumSet)ci.callFactory("of", classes(Enum.class), objects(prefabValues.giveRed(entryTag))); <BUG>EnumSet black = (EnumSet)ci.callFactory("of", classes(Enum.class), objects(prefabValues.giveBlack(entryTag))); @SuppressWarnings("unchecked") Tuple<EnumSet> result = new Tuple<>(red, black); return result;</BUG> }
return new Tuple<>(red, black);
12,014
@Override public Tuple<T> createValues(TypeTag tag, PrefabValues prefabValues, LinkedHashSet<TypeTag> typeStack) { ConditionalInstantiator ci = new ConditionalInstantiator(typeName); TypeTag singleParameterTag = copyGenericTypesInto(parameterRawType, tag); Object red = ci.instantiate(classes(parameterRawType), objects(prefabValues.giveRed(singleParameterTag))); <BUG>Object black = ci.instantiate(classes(parameterRawType), objects(prefabValues.giveBlack(singleParameterTag))); @SuppressWarnings("unchecked") Tuple<T> result = new Tuple<>((T)red, (T)black); return result;</BUG> }
return Tuple.of(red, black);
12,015
return new Tuple<>(red, black); </BUG> } <BUG>private T createWith(Object key, Object value) { </BUG> @SuppressWarnings("unchecked") Map map = new HashMap(); try { Method add = Map.class.getMethod("put", Object.class, Object.class);
@Override public Tuple<T> createValues(TypeTag tag, PrefabValues prefabValues, LinkedHashSet<TypeTag> typeStack) { LinkedHashSet<TypeTag> clone = cloneWith(typeStack, tag); TypeTag keyTag = determineAndCacheActualTypeTag(0, tag, prefabValues, clone, Enum.class); TypeTag valueTag = determineAndCacheActualTypeTag(1, tag, prefabValues, clone, Enum.class); Object red = createWith(prefabValues.giveRed(keyTag), prefabValues.giveBlack(valueTag)); Object black = createWith(prefabValues.giveBlack(keyTag), prefabValues.giveBlack(valueTag)); return Tuple.of(red, black); private Object createWith(Object key, Object value) {
12,016
InputStream stream = IOUtils.toInputStream(receipt, "UTF-8"); XPathReader reader = new XPathReader(stream); Set<String> experimentAccessions = parseReceiptSection(reader, "EXPERIMENT"); Set<String> sampleAccessions = parseReceiptSection(reader, "SAMPLE"); Set<String> runAccessions = parseReceiptSection(reader, "RUN"); <BUG>Set<String> studyAccessions = parseReceiptSection(reader, "STUDY"); Set<String> errors = parseReceiptErrors(reader); return new ENAReceipt(experimentAccessions, sampleAccessions, runAccessions, studyAccessions, errors); </BUG> } catch (IOException e) {
Set<String> infoMessages = parseReceiptInfoMessages(reader); return new ENAReceipt(experimentAccessions, sampleAccessions, runAccessions, studyAccessions, infoMessages, errors);
12,017
setLayout(new BorderLayout()); } public void constructErrorPane(List<ErrorMessage> errorMessages, String action) { JLabel info = UIHelper.createLabel(action+ " failed with " + errorMessages.size() <BUG>+ (errorMessages.size() > 1 ? " errors" : " error") </BUG> + ". Here is why:", UIHelper.VER_11_BOLD, UIHelper.RED_COLOR); info.setHorizontalAlignment(SwingConstants.LEFT); add(UIHelper.padComponentVerticalBox(30, info), BorderLayout.NORTH);
+ (errorMessages.size() > 1 ? " messages" : " message")
12,018
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.*;
12,019
.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);
12,020
</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) {
12,021
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)
12,022
.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))
12,023
.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))
12,024
@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;
12,025
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; }
12,026
return configDirectory; } public boolean isLoaded() { return loaded; } <BUG>public static Cause getCause() { return instance().pluginCause; }</BUG> public EconomyService getEconomyService() { return economyService;
[DELETED]
12,027
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.*;
12,028
.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))
12,029
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) -> {
12,030
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);
12,031
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);
12,032
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() + "\"");
12,033
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() + "\"");
12,034
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
12,035
.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")
12,036
customTokens.put("%%mlFinalForestsPerHost%%", hubConfig.finalForestsPerHost.toString()); customTokens.put("%%mlTraceAppserverName%%", hubConfig.traceHttpName); customTokens.put("%%mlTracePort%%", hubConfig.tracePort.toString()); customTokens.put("%%mlTraceDbName%%", hubConfig.traceDbName); customTokens.put("%%mlTraceForestsPerHost%%", hubConfig.traceForestsPerHost.toString()); <BUG>customTokens.put("%%mlModulesDbName%%", hubConfig.modulesDbName); }</BUG> public void init() { try { LOGGER.error("PLUGINS DIR: " + pluginsDir.toString());
customTokens.put("%%mlTriggersDbName%%", hubConfig.triggersDbName); customTokens.put("%%mlSchemasDbName%%", hubConfig.schemasDbName); }
12,037
import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.LocalFileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.util.Progressable; <BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*; public class S3AFileSystem extends FileSystem {</BUG> private URI uri; private Path workingDir; private AmazonS3Client s3;
import static org.apache.hadoop.fs.s3a.Constants.*; public class S3AFileSystem extends FileSystem {
12,038
public void initialize(URI name, Configuration conf) throws IOException { super.initialize(name, conf); uri = URI.create(name.getScheme() + "://" + name.getAuthority()); workingDir = new Path("/user", System.getProperty("user.name")).makeQualified(this.uri, this.getWorkingDirectory()); <BUG>String accessKey = conf.get(ACCESS_KEY, null); String secretKey = conf.get(SECRET_KEY, null); </BUG> String userInfo = name.getUserInfo();
String accessKey = conf.get(NEW_ACCESS_KEY, conf.get(OLD_ACCESS_KEY, null)); String secretKey = conf.get(NEW_SECRET_KEY, conf.get(OLD_SECRET_KEY, null));
12,039
} else { accessKey = userInfo; } } AWSCredentialsProviderChain credentials = new AWSCredentialsProviderChain( <BUG>new S3ABasicAWSCredentialsProvider(accessKey, secretKey), new InstanceProfileCredentialsProvider(), new S3AAnonymousAWSCredentialsProvider() );</BUG> bucket = name.getHost();
new BasicAWSCredentialsProvider(accessKey, secretKey), new AnonymousAWSCredentialsProvider()
12,040
awsConf.setSocketTimeout(conf.getInt(SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT)); </BUG> s3 = new AmazonS3Client(credentials, awsConf); <BUG>maxKeys = conf.getInt(MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS); partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); partSizeThreshold = conf.getInt(MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD); </BUG> if (partSize < 5 * 1024 * 1024) {
new InstanceProfileCredentialsProvider(), new AnonymousAWSCredentialsProvider() bucket = name.getHost(); ClientConfiguration awsConf = new ClientConfiguration(); awsConf.setMaxConnections(conf.getInt(NEW_MAXIMUM_CONNECTIONS, conf.getInt(OLD_MAXIMUM_CONNECTIONS, DEFAULT_MAXIMUM_CONNECTIONS))); awsConf.setProtocol(conf.getBoolean(NEW_SECURE_CONNECTIONS, conf.getBoolean(OLD_SECURE_CONNECTIONS, DEFAULT_SECURE_CONNECTIONS)) ? Protocol.HTTPS : Protocol.HTTP); awsConf.setMaxErrorRetry(conf.getInt(NEW_MAX_ERROR_RETRIES, conf.getInt(OLD_MAX_ERROR_RETRIES, DEFAULT_MAX_ERROR_RETRIES))); awsConf.setSocketTimeout(conf.getInt(NEW_SOCKET_TIMEOUT, conf.getInt(OLD_SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT))); maxKeys = conf.getInt(NEW_MAX_PAGING_KEYS, conf.getInt(OLD_MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS)); partSize = conf.getLong(NEW_MULTIPART_SIZE, conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE)); partSizeThreshold = conf.getInt(NEW_MIN_MULTIPART_THRESHOLD, conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD));
12,041
cannedACL = null; } if (!s3.doesBucketExist(bucket)) { throw new IOException("Bucket " + bucket + " does not exist"); } <BUG>boolean purgeExistingMultipart = conf.getBoolean(PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART); long purgeExistingMultipartAge = conf.getLong(PURGE_EXISTING_MULTIPART_AGE, DEFAULT_PURGE_EXISTING_MULTIPART_AGE); </BUG> if (purgeExistingMultipart) {
boolean purgeExistingMultipart = conf.getBoolean(NEW_PURGE_EXISTING_MULTIPART, conf.getBoolean(OLD_PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART)); long purgeExistingMultipartAge = conf.getLong(NEW_PURGE_EXISTING_MULTIPART_AGE, conf.getLong(OLD_PURGE_EXISTING_MULTIPART_AGE, DEFAULT_PURGE_EXISTING_MULTIPART_AGE));
12,042
import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; <BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*; public class S3AOutputStream extends OutputStream {</BUG> private OutputStream backupStream; private File backupFile; private boolean closed;
import static org.apache.hadoop.fs.s3a.Constants.*; public class S3AOutputStream extends OutputStream {
12,043
this.client = client; this.progress = progress; this.fs = fs; this.cannedACL = cannedACL; this.statistics = statistics; <BUG>partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); partSizeThreshold = conf.getInt(MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD); </BUG> if (conf.get(BUFFER_DIR, null) != null) {
partSize = conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); partSizeThreshold = conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
12,044
import org.kevoree.modeling.java2typescript.json.tsconfig.CompilerOptions; import org.kevoree.modeling.java2typescript.json.tsconfig.TsConfig; import org.kevoree.modeling.java2typescript.translators.ClassTranslator; import java.io.File; import java.io.IOException; <BUG>import java.net.URI; import java.nio.file.Paths;</BUG> import java.util.ArrayList; import java.util.Collections; import java.util.List;
import java.net.URISyntaxException; import java.nio.file.Paths;
12,045
e.printStackTrace(); } } private void visit(PsiDirectory dir) { ctx.enterPackage(dir.getName(), rootPassed); <BUG>if(!rootPassed) { </BUG> rootPassed = true; } dir.acceptChildren(visitor);
if (!rootPassed) {
12,046
compilerOptions.setNoImplicitAny(true); compilerOptions.setDeclaration(true); compilerOptions.setRemoveComments(true); compilerOptions.setPreserveConstEnums(true); compilerOptions.setSuppressImplicitAnyIndexErrors(true); <BUG>compilerOptions.setOutDir(URI.create("built")); </BUG> tsConfig.setCompilerOptions(compilerOptions); Atom atom = new Atom(); atom.setRewriteTsConfig(true);
compilerOptions.setOutDir(URI.create(".."));
12,047
plugin.getLogger().addHandler(new WebsendPluginLoggerHandler(plugin)); } } public static void startRecording(String pluginName) { <BUG>if(Main.getSettings().isDebugMode()){ Main.getMainLogger().info("Starting output recording of plugin "+pluginName); }</BUG> if(!handlersRegistered){
Main.logDebugInfo("Starting output recording of plugin "+pluginName);
12,048
pluginOutputHashMap.put(pluginName, new ArrayList<String>()); } public static ArrayList<String> stopRecording(String pluginName) { ArrayList<String> result = pluginOutputHashMap.get(pluginName); <BUG>if(Main.getSettings().isDebugMode()){ Main.getMainLogger().info("Stopping output recording of plugin "+pluginName); Main.getMainLogger().info("Recorded "+result.size()+" entries."); }</BUG> pluginOutputHashMap.remove(pluginName);
Main.logDebugInfo("Stopping output recording of plugin "+pluginName); Main.logDebugInfo("Recorded "+result.size()+" entries.");
12,049
} public void parse(String line, Player player) { // Now it's slightly better. if (line.contains(";")) { // check split sign <BUG>if (Main.getSettings().isDebugMode()) { Main.getMainLogger().info("Websend: ';' found"); }</BUG> String[] lineArray = line.split(";"); // split line into seperate
Main.logDebugInfo("Websend: ';' found");
12,050
else if (lineArray[i].contains("/Output/")) { parseOutput(lineArray[i], player); } else <BUG>{ if (Main.getSettings().isDebugMode()) { Main.getMainLogger().log(Level.WARNING, "Websend: No command or output tag found!");</BUG> }
[DELETED]
12,051
Main.getMainLogger().info("Websend ERROR: While parsing php output, websend found"); Main.getMainLogger().info("an error on output line " + line + ": Invalid command."); } } private void parseOutput(String line, Player player) <BUG>{ if (Main.getSettings().isDebugMode()) { Main.getMainLogger().info("Websend: An output line was found."); }</BUG> String splittedLine[];
Main.logDebugInfo("Command parsing: An output line was found.");
12,052
onBroadcast(splittedLine[1]); } } private void onSetResponseURL(String line) { <BUG>String newURL = line.split("SetResponseURL:")[1]; if (Main.getSettings().isDebugMode()) { Main.getMainLogger().info("Websend: Changed ResponseURL to " + newURL); }</BUG> settings.setResponseURL(newURL);
Main.logDebugInfo("Command parsing: Changed ResponseURL to " + newURL);
12,053
if (player == null) { Main.getMainLogger().info("Websend: ExecutePlayerCommand is used in a wrong context."); } String[] commandArray = line.split("ExecutePlayerCommand:"); <BUG>if (Main.getSettings().isDebugMode()) { Main.getMainLogger().info("Websend: An ExecutePlayerCommand was found: '" + Util.stringArrayToString(commandArray) + "'"); }</BUG> Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(Main.getInstance(), new Task(commandArray, player)
Main.logDebugInfo("Command parsing: An ExecutePlayerCommand was found: '" + Util.stringArrayToString(commandArray) + "'");
12,054
}); } private void onExecutePlayerCommand(String line) { String[] commandArray = line.split("ExecutePlayerCommand-"); <BUG>if (Main.getSettings().isDebugMode()) { Main.getMainLogger().info("Websend: An ExecutePlayerCommand was found: '" + Util.stringArrayToString(commandArray) + "'"); }</BUG> Object[] taskArgs = new Object[] { commandArray };
Main.logDebugInfo("Command parsing: An ExecutePlayerCommand was found: '" + Util.stringArrayToString(commandArray) + "'");
12,055
String playerName = commandDataArray[0]; String message = commandDataArray[1]; Player currentPlayer = server.getPlayer(playerName); if ("console".equals(playerName)) { <BUG>if (Main.getSettings().isDebugMode()) { Main.getMainLogger().info("Websend: Player 'console'? Using PrintToConsole instead."); }</BUG> }
Main.logDebugInfo("Websend: Player 'console'? Using PrintToConsole instead.");
12,056
compiledDir = new File(com.github.websend.Main.getScriptsDir(), "compiled"); scripts = new HashMap<String, Script>(); } public void invokeScript(String name) { <BUG>if (Main.getSettings().isDebugMode()) { Main.getMainLogger().log(Level.WARNING, "Searching script: " + name); }</BUG> Script script = scripts.get(name);
Main.logDebugInfo(Level.WARNING, "Searching script: " + name);
12,057
}</BUG> Script script = scripts.get(name); if (script != null) { <BUG>if (Main.getSettings().isDebugMode()) { Main.getMainLogger().log(Level.WARNING, "Found script, invoking main method."); }</BUG> script.invoke();
compiledDir = new File(com.github.websend.Main.getScriptsDir(), "compiled"); scripts = new HashMap<String, Script>(); } public void invokeScript(String name) Main.logDebugInfo(Level.WARNING, "Searching script: " + name); Main.logDebugInfo(Level.WARNING, "Found script, invoking main method.");
12,058
Main.getMainLogger().info("No script with name: " + name); } } public void clearScripts() { <BUG>if (Main.getSettings().isDebugMode()) { Main.getMainLogger().log(Level.WARNING, "Cleared scripts map."); }</BUG> scripts.clear();
Main.logDebugInfo(Level.WARNING, "Cleared scripts map.");
12,059
scripts.remove(scriptName); scripts.put(scriptName, loadScriptFromDir(new File(Main.getScriptsDir(), scriptName))); } public void loadScripts() { <BUG>if (Main.getSettings().isDebugMode()) { Main.getMainLogger().log(Level.WARNING, "Loading scripts"); }</BUG> File[] directories = scriptsDir.listFiles(new DirectoryFilter());
Main.logDebugInfo(Level.WARNING, "Loading scripts");
12,060
File[] directories = scriptsDir.listFiles(new DirectoryFilter()); for (File cur : directories) { if (!cur.getName().equals("compiled")) { <BUG>if (Main.getSettings().isDebugMode()) { Main.getMainLogger().log(Level.WARNING, "Loading script: " + cur.getName()); }</BUG> Script newScript = loadScriptFromDir(cur);
Main.logDebugInfo(Level.WARNING, "Loading script: " + cur.getName());
12,061
Main.getMainLogger().log(Level.WARNING, "Failed to load script info for: " + script.name, ex); } } private boolean compileClasses(String name, File[] javaFiles) { <BUG>if (Main.getSettings().isDebugMode()) { Main.getMainLogger().log(Level.WARNING, "Compiling classes"); }</BUG> try
Main.logDebugInfo(Level.WARNING, "Compiling classes");
12,062
message = "The server responded to the request with a redirection message. Assuming request OK. ("+reason+")"; }else if(responseCode < 200){ message = "The server responded to the request with a continue or protocol switching message. Assuming request OK. ("+reason+")"; }else{ message = "The server responded to the request with an unknown response code ("+responseCode+"). Assuming request OK. ("+reason+")"; <BUG>} if (Main.getSettings().isDebugMode()) { Main.getMainLogger().log(logLevel, message); }</BUG> CommandParser parser = new CommandParser();
Main.logDebugInfo(logLevel, message);
12,063
public class UserControllerTest { private static final Logger LOGGER = Logger.getLogger( UserControllerTest.class.getName() ); Properties properties = new Properties(); InputStream input = null; <BUG>private String neo4jServerPort = System.getProperty( "neo4j.server.port" ); private String neo4jRemoteShellPort = System.getProperty( "neo4j.remoteShell.port" ); private String neo4jGraphDb = System.getProperty( "neo4j.graph.db" ); private ServerControls server;</BUG> @Before
private String dbmsConnectorHttpPort = System.getProperty( "dbms.connector.http.port" ); private String dbmsConnectorBoltPort = System.getProperty( "dbms.connector.bolt.port" ); private String dbmsShellPort = System.getProperty( "dbms.shell.port" ); private String dbmsDirectoriesData = System.getProperty( "dbms.directories.data" ); private ServerControls server;
12,064
@Bean public Configuration getConfiguration() { if ( StringUtils.isEmpty( url ) ) { <BUG>url = "http://localhost:" + port; </BUG> } Configuration config = new Configuration(); config.driverConfiguration().setDriverClassName( HttpDriver.class.getName() )
url = "http://localhost:" + dbmsConnectorHttpPort;
12,065
e.printStackTrace(); } filePlayback=null; } @Override <BUG>public void stop() { if ( filePlayback!=null ) filePlayback.stop(); } void initFiles() throws FileNotFoundException {</BUG> if ((dataDir.length() != 0) && !dataDir.endsWith("/")) { dataDir = dataDir + "/"; } // guard path if needed String samples_str = dataDir + "samples"; String events_str = dataDir + "events";
@Override public boolean isrunning(){ if ( filePlayback!=null ) return filePlayback.isrunning(); return false; } void initFiles() throws FileNotFoundException {
12,066
public class BufferMonitor extends Thread implements FieldtripBufferMonitor { public static final String TAG = BufferMonitor.class.toString(); private final Context context; private final SparseArray<BufferConnectionInfo> clients = new SparseArray<BufferConnectionInfo>(); private final BufferInfo info; <BUG>private final BroadcastReceiver mMessageReceiver = new BroadcastReceiver() { @Override public void onReceive(final Context context, final Intent intent) { if (intent.getIntExtra(C.MESSAGE_TYPE, -1) == C.UPDATE_REQUEST) { Log.i(TAG, "Received update request."); sendAllInfo(); } } };</BUG> private boolean run = true;
[DELETED]
12,067
public static final String CLIENT_INFO_TIME = "c_time"; public static final String CLIENT_INFO_WAITTIMEOUT = "c_waitTimeout"; public static final String CLIENT_INFO_CONNECTED = "c_connected"; public static final String CLIENT_INFO_CHANGED = "c_changed"; public static final String CLIENT_INFO_DIFF = "c_diff"; <BUG>public static final int UPDATE_REQUEST = 0; </BUG> public static final int UPDATE = 1; public static final int REQUEST_PUT_HEADER = 2; public static final int REQUEST_FLUSH_HEADER = 3;
public static final int THREAD_INFO_TYPE = 0;
12,068
package nl.dcc.buffer_bci.bufferclientsservice; import android.os.Parcel; import android.os.Parcelable; <BUG>import nl.dcc.buffer_bci.bufferservicecontroller.C; public class ThreadInfo implements Parcelable {</BUG> public static final Creator<ThreadInfo> CREATOR = new Creator<ThreadInfo>() { @Override public ThreadInfo createFromParcel(final Parcel in) {
import nl.dcc.buffer_bci.C; public class ThreadInfo implements Parcelable {
12,069
if (leafNode == null) return true; int start = i - leafNode.getStartOffset() + scopeStartOffset; LOG.assertTrue(start >= 0); boolean contains = leafNode.getTextLength() - start >= patternLength; if (contains && !processor.execute(leafNode.getPsi(), start)) return false; <BUG>if (!processInjectedFile(leafNode.getPsi(), processor, searcher)) return false; TreeElement prev = leafNode;</BUG> CompositeElement run = leafNode.getTreeParent(); while (run != null) {
Boolean result = processInjectedFile(leafNode.getPsi(), processor, searcher); if (result != null && !result.booleanValue()) return false; boolean injectedFound = result != null; TreeElement prev = leafNode;
12,070
LOG.assertTrue(start >= 0, "i=" + i + " scopeStartOffset=" + scopeStartOffset + " leafElement=" + leafElement.toString() + " " + leafElement.getTextRange().getStartOffset() + " scope=" + scope.toString()); } boolean contains = leafElement.getTextLength() - start >= patternLength; if (contains && !processor.execute(leafElement, start)) return false; <BUG>if (!processInjectedFile(leafElement, processor, searcher)) return false; PsiElement prev = leafElement;</BUG> PsiElement run = leafElement.getParent(); while (run != null) {
Boolean result = processInjectedFile(leafElement, processor, searcher); if (result != null && !result.booleanValue()) return false; boolean injectedFound = result != null; PsiElement prev = leafElement;
12,071
package com.example.mapdemo; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.OnMapReadyCallback; <BUG>import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.Polygon;</BUG> import com.google.android.gms.maps.model.PolygonOptions; import android.graphics.Color;
import com.google.android.gms.maps.model.Dash; import com.google.android.gms.maps.model.Dot; import com.google.android.gms.maps.model.Gap; import com.google.android.gms.maps.model.JointType; import com.google.android.gms.maps.model.PatternItem; import com.google.android.gms.maps.model.Polygon;
12,072
LWLink link = new LWLink(parentCopy, childCopy); addLink(link); } } } <BUG>public void layout(LWNode currentNode) </BUG> { System.out.println("calling layout() on " + currentNode.toString()); originalNodes.add(currentNode);
public void layout(LWNode currentNode, int number, int total)
12,073
LWNode parentNode = (LWNode)parentHash.get(currentNode); if(parentNode != null) { Point2D point = parentNode.getLocation(); float x = (float)point.getX(); <BUG>float y = (float)point.getY(); x += 10; y += 30; </BUG> copyNode.setLocation(x, y);
int xIncrement = 50 / total; int xOffSet = number * xIncrement; x = x - 10; y += 60;
12,074
copyNode.setLocation(x, y); } else { copyNode.setLocation(200f, 0f); <BUG>} for (Iterator i = currentNode.getLinks().iterator(); i.hasNext();)</BUG> { LWLink link = (LWLink)i.next(); LWNode nextNode = null;
int nextNumber = 0; int nextTotal = currentNode.getLinks().size() - 1; //taking out the parent node for (Iterator i = currentNode.getLinks().iterator(); i.hasNext();)
12,075
LWLink link = (LWLink)i.next(); LWNode nextNode = null; if ((nextNode = (LWNode)link.getComponent1()) == currentNode) nextNode = (LWNode)link.getComponent2(); if(!originalNodes.contains(nextNode)) <BUG>layout(nextNode); }</BUG> } public void createHierarchy() {
layout(nextNode, nextNumber, nextTotal); nextNumber++;
12,076
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
12,077
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++) {
12,078
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++) {
12,079
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
12,080
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++) {
12,081
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
12,082
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++) {
12,083
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
12,084
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++) {
12,085
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
12,086
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++) {
12,087
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
12,088
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++) {
12,089
package com.cronutils.model.time.generator; import java.util.Collections; <BUG>import java.util.List; import org.apache.commons.lang3.Validate;</BUG> import com.cronutils.model.field.CronField; import com.cronutils.model.field.expression.FieldExpression; public abstract class FieldValueGenerator {
import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.Validate;
12,090
import java.util.ResourceBundle; import java.util.function.Function;</BUG> class DescriptionStrategyFactory { private DescriptionStrategyFactory() {} public static DescriptionStrategy daysOfWeekInstance(final ResourceBundle bundle, final FieldExpression expression) { <BUG>final Function<Integer, String> nominal = integer -> new DateTime().withDayOfWeek(integer).dayOfWeek().getAsText(bundle.getLocale()); </BUG> NominalDescriptionStrategy dow = new NominalDescriptionStrategy(bundle, nominal, expression); dow.addDescription(fieldExpression -> { if (fieldExpression instanceof On) {
import java.util.function.Function; import com.cronutils.model.field.expression.FieldExpression; import com.cronutils.model.field.expression.On; final Function<Integer, String> nominal = integer -> DayOfWeek.of(integer).getDisplayName(TextStyle.FULL, bundle.getLocale());
12,091
return dom; } public static DescriptionStrategy monthsInstance(final ResourceBundle bundle, final FieldExpression expression) { return new NominalDescriptionStrategy( bundle, <BUG>integer -> new DateTime().withMonthOfYear(integer).monthOfYear().getAsText(bundle.getLocale()), expression</BUG> ); } public static DescriptionStrategy plainInstance(ResourceBundle bundle, final FieldExpression expression) {
integer -> Month.of(integer).getDisplayName(TextStyle.FULL, bundle.getLocale()), expression
12,092
<BUG>package com.cronutils.model.time.generator; import com.cronutils.mapper.WeekDay;</BUG> import com.cronutils.model.field.CronField; import com.cronutils.model.field.CronFieldName; import com.cronutils.model.field.constraint.FieldConstraintsBuilder;
import java.time.LocalDate; import java.util.Collections; import java.util.List; import java.util.Set; import org.apache.commons.lang3.Validate; import com.cronutils.mapper.WeekDay;
12,093
import com.cronutils.model.field.expression.Between; import com.cronutils.model.field.expression.FieldExpression; import com.cronutils.parser.CronParserField; import com.google.common.collect.Lists; import com.google.common.collect.Sets; <BUG>import org.apache.commons.lang3.Validate; import org.joda.time.DateTime; import java.util.Collections; import java.util.List; import java.util.Set;</BUG> class BetweenDayOfWeekValueGenerator extends FieldValueGenerator {
[DELETED]
12,094
<BUG>package com.cronutils.model.time.generator; import com.cronutils.model.field.CronField;</BUG> import com.cronutils.model.field.CronFieldName; import com.cronutils.model.field.expression.FieldExpression; import com.cronutils.model.field.expression.On;
import java.time.DayOfWeek; import java.time.LocalDate; import java.util.List; import org.apache.commons.lang3.Validate; import com.cronutils.model.field.CronField;
12,095
import com.cronutils.model.field.CronField;</BUG> import com.cronutils.model.field.CronFieldName; import com.cronutils.model.field.expression.FieldExpression; import com.cronutils.model.field.expression.On; import com.google.common.collect.Lists; <BUG>import org.apache.commons.lang3.Validate; import org.joda.time.DateTime; import java.util.List;</BUG> class OnDayOfMonthValueGenerator extends FieldValueGenerator { private int year;
package com.cronutils.model.time.generator; import java.time.DayOfWeek; import java.time.LocalDate; import java.util.List; import com.cronutils.model.field.CronField;
12,096
class OnDayOfMonthValueGenerator extends FieldValueGenerator { private int year; private int month; public OnDayOfMonthValueGenerator(CronField cronField, int year, int month) { super(cronField); <BUG>Validate.isTrue(CronFieldName.DAY_OF_MONTH.equals(cronField.getField()), "CronField does not belong to day of month"); this.year = year;</BUG> this.month = month; }
Validate.isTrue(CronFieldName.DAY_OF_MONTH.equals(cronField.getField()), "CronField does not belong to day of" + " month"); this.year = year;
12,097
package com.cronutils.mapper; public class ConstantsMapper { private ConstantsMapper() {} public static final WeekDay QUARTZ_WEEK_DAY = new WeekDay(2, false); <BUG>public static final WeekDay JODATIME_WEEK_DAY = new WeekDay(1, false); </BUG> public static final WeekDay CRONTAB_WEEK_DAY = new WeekDay(1, true); public static int weekDayMapping(WeekDay source, WeekDay target, int weekday){ return source.mapTo(weekday, target);
public static final WeekDay JAVA8 = new WeekDay(1, false);
12,098
return nextMatch; } catch (NoSuchValueException e) { throw new IllegalArgumentException(e); } } <BUG>DateTime nextClosestMatch(DateTime date) throws NoSuchValueException { </BUG> List<Integer> year = yearsValueGenerator.generateCandidates(date.getYear(), date.getYear()); TimeNode days = null; int lowestMonth = months.getValues().get(0);
ZonedDateTime nextClosestMatch(ZonedDateTime date) throws NoSuchValueException {
12,099
boolean questionMarkSupported = cronDefinition.getFieldDefinition(DAY_OF_WEEK).getConstraints().getSpecialChars().contains(QUESTION_MARK); if(questionMarkSupported){ return new TimeNode( generateDayCandidatesQuestionMarkSupported( <BUG>date.getYear(), date.getMonthOfYear(), </BUG> ((DayOfWeekFieldDefinition) cronDefinition.getFieldDefinition(DAY_OF_WEEK) ).getMondayDoWValue()
date.getYear(), date.getMonthValue(),
12,100
) ); }else{ return new TimeNode( generateDayCandidatesQuestionMarkNotSupported( <BUG>date.getYear(), date.getMonthOfYear(), </BUG> ((DayOfWeekFieldDefinition) cronDefinition.getFieldDefinition(DAY_OF_WEEK) ).getMondayDoWValue()
date.getYear(), date.getMonthValue(),