id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
6,901
configuration.getxAxis().setShowLastLabel(true); configuration.getxAxis().setMinRange(14 * DAY_IN_MILLIS); configuration.getxAxis().setTitle(new AxisTitle("")); PlotBand mask = new PlotBand(); mask.setColor(new SolidColor(0, 0, 0, 0.2)); <BUG>mask.setFrom(Util.toHighchartsTS(DEMO_DATASET_START)); mask.setTo(Util.toHighchartsTS(DEMO_DATASET_END)); configuration.getxAxis().setPlotBands(mask);</BUG> YAxis yAxis = configuration.getyAxis(); yAxis.setGridLineWidth(0);
mask.setFrom(Util.toHighchartsTS(DEMO_DATASET_START.atStartOfDay().toInstant(ZoneOffset.UTC))); mask.setTo(Util.toHighchartsTS(DEMO_DATASET_END.atStartOfDay().toInstant(ZoneOffset.UTC))); configuration.getxAxis().setPlotBands(mask);
6,902
fillColor.addColorStop(1, new SolidColor(69, 114, 167, 0.5)); masterPlotOptions.setFillColor(fillColor); masterPlotOptions.setPointInterval(24 * 3600 * 1000); masterPlotOptions.setMarker(new Marker(false)); masterPlotOptions <BUG>.setPointStart(Util.toHighchartsTS(DEMO_DATASET_START)); ls.setPlotOptions(masterPlotOptions);</BUG> ls.setName("USD to EUR"); ls.setData(FULL_DEMO_DATA_SET); configuration.addSeries(ls);
.setPointStart(Util.toHighchartsTS(DEMO_DATASET_START.atStartOfDay().toInstant(ZoneOffset.UTC))); ls.setPlotOptions(masterPlotOptions);
6,903
package com.vaadin.addon.charts.examples.lineandscatter; <BUG>import java.util.Date; import com.vaadin.addon.charts.Chart;</BUG> import com.vaadin.addon.charts.examples.AbstractVaadinChartExample; import com.vaadin.addon.charts.model.AxisTitle;
import java.time.LocalDate; import java.time.ZoneOffset; import com.vaadin.addon.charts.Chart;
6,904
hover.setRadius(5); hover.setLineWidth(1); states.setHover(hover); plotOptions.getMarker().setStates(states); plotOptions.setPointInterval(ONE_HOUR); <BUG>plotOptions.setPointStart(new Date(2009 - 1900, 9 - 1, 6).getTime()); ListSeries ls = new ListSeries();</BUG> ls.setName("Hestavollane"); ls.setData(4.3, 5.1, 4.3, 5.2, 5.4, 4.7, 3.5, 4.1, 5.6, 7.4, 6.9, 7.1, 7.9, 7.9, 7.5, 6.7, 7.7, 7.7, 7.4, 7.0, 7.1, 5.8, 5.9, 7.4,
LocalDate date =LocalDate.of(2009,9,6); plotOptions.setPointStart(date.atStartOfDay().toInstant(ZoneOffset.UTC)); ListSeries ls = new ListSeries();
6,905
return ndlopen(memAddressSafe(path), mode); } public static long dlopen(CharSequence path, int mode) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); try { <BUG>ByteBuffer pathEncoded = path == null ? null : stack.ASCII(path); return ndlopen(memAddressSafe(pathEncoded), mode);</BUG> } finally { stack.setPointer(stackPointer); }
ByteBuffer pathEncoded = stack.ASCII(path); return ndlopen(memAddressSafe(pathEncoded), mode);
6,906
public static int NFD_OpenDialog(CharSequence filterList, CharSequence defaultPath, PointerBuffer outPath) { if ( CHECKS ) checkBuffer(outPath, 1); MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); try { <BUG>ByteBuffer filterListEncoded = filterList == null ? null : stack.UTF8(filterList); ByteBuffer defaultPathEncoded = defaultPath == null ? null : stack.UTF8(defaultPath); return nNFD_OpenDialog(memAddressSafe(filterListEncoded), memAddressSafe(defaultPathEncoded), memAddress(outPath));</BUG> } finally { stack.setPointer(stackPointer);
ByteBuffer filterListEncoded = stack.UTF8(filterList); ByteBuffer defaultPathEncoded = stack.UTF8(defaultPath); return nNFD_OpenDialog(memAddressSafe(filterListEncoded), memAddressSafe(defaultPathEncoded), memAddress(outPath));
6,907
return nNFD_OpenDialogMultiple(memAddressSafe(filterList), memAddressSafe(defaultPath), outPaths.address()); } public static int NFD_OpenDialogMultiple(CharSequence filterList, CharSequence defaultPath, NFDPathSet outPaths) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); try { <BUG>ByteBuffer filterListEncoded = filterList == null ? null : stack.UTF8(filterList); ByteBuffer defaultPathEncoded = defaultPath == null ? null : stack.UTF8(defaultPath); return nNFD_OpenDialogMultiple(memAddressSafe(filterListEncoded), memAddressSafe(defaultPathEncoded), outPaths.address());</BUG> } finally { stack.setPointer(stackPointer);
ByteBuffer filterListEncoded = stack.UTF8(filterList); ByteBuffer defaultPathEncoded = stack.UTF8(defaultPath); return nNFD_OpenDialogMultiple(memAddressSafe(filterListEncoded), memAddressSafe(defaultPathEncoded), outPaths.address());
6,908
public static int NFD_SaveDialog(CharSequence filterList, CharSequence defaultPath, PointerBuffer outPath) { if ( CHECKS ) checkBuffer(outPath, 1); MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); try { <BUG>ByteBuffer filterListEncoded = filterList == null ? null : stack.UTF8(filterList); ByteBuffer defaultPathEncoded = defaultPath == null ? null : stack.UTF8(defaultPath); return nNFD_SaveDialog(memAddressSafe(filterListEncoded), memAddressSafe(defaultPathEncoded), memAddress(outPath));</BUG> } finally { stack.setPointer(stackPointer);
ByteBuffer filterListEncoded = stack.UTF8(filterList); ByteBuffer defaultPathEncoded = stack.UTF8(defaultPath); return nNFD_SaveDialog(memAddressSafe(filterListEncoded), memAddressSafe(defaultPathEncoded), memAddress(outPath));
6,909
return nXOpenDisplay(memAddressSafe(display_name)); } public static long XOpenDisplay(CharSequence display_name) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); try { <BUG>ByteBuffer display_nameEncoded = display_name == null ? null : stack.ASCII(display_name); return nXOpenDisplay(memAddressSafe(display_nameEncoded));</BUG> } finally { stack.setPointer(stackPointer); }
ByteBuffer display_nameEncoded = stack.ASCII(display_name); return nXOpenDisplay(memAddressSafe(display_nameEncoded));
6,910
return ndlopen(memAddressSafe(filename), mode); } public static long dlopen(CharSequence filename, int mode) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); try { <BUG>ByteBuffer filenameEncoded = filename == null ? null : stack.ASCII(filename); return ndlopen(memAddressSafe(filenameEncoded), mode);</BUG> } finally { stack.setPointer(stackPointer); }
ByteBuffer filenameEncoded = stack.ASCII(filename); return ndlopen(memAddressSafe(filenameEncoded), mode);
6,911
nje_malloc_stats_print(write_cb == null ? NULL : write_cb.address(), memAddressSafe(je_cbopaque), memAddressSafe(opts)); } public static void je_malloc_stats_print(MallocMessageCallbackI write_cb, ByteBuffer je_cbopaque, CharSequence opts) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); try { <BUG>ByteBuffer optsEncoded = opts == null ? null : stack.ASCII(opts); nje_malloc_stats_print(write_cb == null ? NULL : write_cb.address(), memAddressSafe(je_cbopaque), memAddressSafe(optsEncoded));</BUG> } finally { stack.setPointer(stackPointer); }
ByteBuffer optsEncoded = stack.ASCII(opts); nje_malloc_stats_print(write_cb == null ? NULL : write_cb.address(), memAddressSafe(je_cbopaque), memAddressSafe(optsEncoded));
6,912
return nCreateWindowEx(dwExStyle, memAddressSafe(lpClassName), memAddressSafe(lpWindowName), dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam); } public static long CreateWindowEx(int dwExStyle, CharSequence lpClassName, CharSequence lpWindowName, int dwStyle, int x, int y, int nWidth, int nHeight, long hWndParent, long hMenu, long hInstance, long lpParam) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); try { <BUG>ByteBuffer lpClassNameEncoded = lpClassName == null ? null : stack.UTF16(lpClassName); ByteBuffer lpWindowNameEncoded = lpWindowName == null ? null : stack.UTF16(lpWindowName); return nCreateWindowEx(dwExStyle, memAddressSafe(lpClassNameEncoded), memAddressSafe(lpWindowNameEncoded), dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);</BUG> } finally { stack.setPointer(stackPointer);
ByteBuffer lpClassNameEncoded = stack.UTF16(lpClassName); ByteBuffer lpWindowNameEncoded = stack.UTF16(lpWindowName); return nCreateWindowEx(dwExStyle, memAddressSafe(lpClassNameEncoded), memAddressSafe(lpWindowNameEncoded), dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
6,913
return nEnumDisplayDevices(memAddressSafe(lpDevice), iDevNum, lpDisplayDevice.address(), dwFlags) != 0; } public static boolean EnumDisplayDevices(CharSequence lpDevice, int iDevNum, DISPLAY_DEVICE lpDisplayDevice, int dwFlags) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); try { <BUG>ByteBuffer lpDeviceEncoded = lpDevice == null ? null : stack.UTF16(lpDevice); return nEnumDisplayDevices(memAddressSafe(lpDeviceEncoded), iDevNum, lpDisplayDevice.address(), dwFlags) != 0;</BUG> } finally { stack.setPointer(stackPointer); }
ByteBuffer lpDeviceEncoded = stack.UTF16(lpDevice); return nEnumDisplayDevices(memAddressSafe(lpDeviceEncoded), iDevNum, lpDisplayDevice.address(), dwFlags) != 0;
6,914
return nEnumDisplaySettingsEx(memAddressSafe(lpszDeviceName), iModeNum, lpDevMode.address(), dwFlags) != 0; } public static boolean EnumDisplaySettingsEx(CharSequence lpszDeviceName, int iModeNum, DEVMODE lpDevMode, int dwFlags) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); try { <BUG>ByteBuffer lpszDeviceNameEncoded = lpszDeviceName == null ? null : stack.UTF16(lpszDeviceName); return nEnumDisplaySettingsEx(memAddressSafe(lpszDeviceNameEncoded), iModeNum, lpDevMode.address(), dwFlags) != 0;</BUG> } finally { stack.setPointer(stackPointer); }
ByteBuffer lpszDeviceNameEncoded = stack.UTF16(lpszDeviceName); return nEnumDisplaySettingsEx(memAddressSafe(lpszDeviceNameEncoded), iModeNum, lpDevMode.address(), dwFlags) != 0;
6,915
return nChangeDisplaySettingsEx(memAddressSafe(lpszDeviceName), lpDevMode == null ? NULL : lpDevMode.address(), hwnd, dwflags, lParam); } public static int ChangeDisplaySettingsEx(CharSequence lpszDeviceName, DEVMODE lpDevMode, long hwnd, int dwflags, long lParam) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); try { <BUG>ByteBuffer lpszDeviceNameEncoded = lpszDeviceName == null ? null : stack.UTF16(lpszDeviceName); return nChangeDisplaySettingsEx(memAddressSafe(lpszDeviceNameEncoded), lpDevMode == null ? NULL : lpDevMode.address(), hwnd, dwflags, lParam);</BUG> } finally { stack.setPointer(stackPointer); }
ByteBuffer lpszDeviceNameEncoded = stack.UTF16(lpszDeviceName); return nChangeDisplaySettingsEx(memAddressSafe(lpszDeviceNameEncoded), lpDevMode == null ? NULL : lpDevMode.address(), hwnd, dwflags, lParam);
6,916
return nalcOpenDevice(memAddressSafe(deviceSpecifier)); } public static long alcOpenDevice(CharSequence deviceSpecifier) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); try { <BUG>ByteBuffer deviceSpecifierEncoded = deviceSpecifier == null ? null : stack.UTF8(deviceSpecifier); return nalcOpenDevice(memAddressSafe(deviceSpecifierEncoded));</BUG> } finally { stack.setPointer(stackPointer); }
ByteBuffer deviceSpecifierEncoded = stack.UTF8(deviceSpecifier); return nalcOpenDevice(memAddressSafe(deviceSpecifierEncoded));
6,917
if ( CHECKS ) checkPointer(session); MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); try { ByteBuffer propertyNameEncoded = stack.ASCII(propertyName); <BUG>ByteBuffer defaultValEncoded = defaultVal == null ? null : stack.UTF8(defaultVal); long __result = novr_GetString(session, memAddress(propertyNameEncoded), memAddressSafe(defaultValEncoded));</BUG> return memUTF8(__result); } finally { stack.setPointer(stackPointer);
checkNT1(message); long __result = novr_TraceMessage(level, memAddress(message)); } public static String ovr_TraceMessage(int level, CharSequence message) { ByteBuffer messageEncoded = stack.UTF8(message); long __result = novr_TraceMessage(level, memAddress(messageEncoded));
6,918
return nGetModuleHandle(memAddressSafe(moduleName)); } public static long GetModuleHandle(CharSequence moduleName) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); try { <BUG>ByteBuffer moduleNameEncoded = moduleName == null ? null : stack.UTF16(moduleName); return nGetModuleHandle(memAddressSafe(moduleNameEncoded));</BUG> } finally { stack.setPointer(stackPointer); }
ByteBuffer moduleNameEncoded = stack.UTF16(moduleName); return nGetModuleHandle(memAddressSafe(moduleNameEncoded));
6,919
return nalcCaptureOpenDevice(memAddressSafe(devicename), frequency, format, buffersize); } public static long alcCaptureOpenDevice(CharSequence devicename, int frequency, int format, int buffersize) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); try { <BUG>ByteBuffer devicenameEncoded = devicename == null ? null : stack.UTF8(devicename); return nalcCaptureOpenDevice(memAddressSafe(devicenameEncoded), frequency, format, buffersize);</BUG> } finally { stack.setPointer(stackPointer); }
ByteBuffer devicenameEncoded = stack.UTF8(devicename); return nalcCaptureOpenDevice(memAddressSafe(devicenameEncoded), frequency, format, buffersize);
6,920
return nalcCaptureOpenDevice(memAddressSafe(devicename), frequency, format, buffersize); } public static long alcCaptureOpenDevice(CharSequence devicename, int frequency, int format, int buffersize) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); try { <BUG>ByteBuffer devicenameEncoded = devicename == null ? null : stack.UTF8(devicename); return nalcCaptureOpenDevice(memAddressSafe(devicenameEncoded), frequency, format, buffersize);</BUG> } finally { stack.setPointer(stackPointer); }
ByteBuffer devicenameEncoded = stack.UTF8(devicename); return nalcCaptureOpenDevice(memAddressSafe(devicenameEncoded), frequency, format, buffersize);
6,921
return nalcLoopbackOpenDeviceSOFT(memAddressSafe(deviceName)); } public static long alcLoopbackOpenDeviceSOFT(CharSequence deviceName) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); try { <BUG>ByteBuffer deviceNameEncoded = deviceName == null ? null : stack.UTF8(deviceName); return nalcLoopbackOpenDeviceSOFT(memAddressSafe(deviceNameEncoded));</BUG> } finally { stack.setPointer(stackPointer); }
ByteBuffer deviceNameEncoded = stack.UTF8(deviceName); return nalcLoopbackOpenDeviceSOFT(memAddressSafe(deviceNameEncoded));
6,922
rest("/cart/").description("Personal Shopping Cart Service") .produces(MediaType.APPLICATION_JSON_VALUE) .options("/{cartId}") .route().id("getCartOptionsRoute").end().endRest() .options("/checkout/{cartId}") <BUG>.route().id("checkoutCartOptionsRoute").end().endRest() .options("/{cartId}/{itemId}/{quantity}")</BUG> .route().id("cartAddDeleteOptionsRoute").end().endRest() .post("/checkout/{cartId}").description("Finalize shopping cart and process payment") .param().name("cartId").type(RestParamType.path).description("The ID of the cart to process").dataType("string").endParam()
.options("/{cartId}/{tmpId}") .route().id("cartSetOptionsRoute").end().endRest() .options("/{cartId}/{itemId}/{quantity}")
6,923
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;
6,924
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());
6,925
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
6,926
<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;
6,927
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]
6,928
<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;
6,929
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;
6,930
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;
6,931
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);
6,932
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 {
6,933
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(),
6,934
) ); }else{ return new TimeNode( generateDayCandidatesQuestionMarkNotSupported( <BUG>date.getYear(), date.getMonthOfYear(), </BUG> ((DayOfWeekFieldDefinition) cronDefinition.getFieldDefinition(DAY_OF_WEEK) ).getMondayDoWValue()
date.getYear(), date.getMonthValue(),
6,935
} public DateTime lastExecution(DateTime date){ </BUG> Validate.notNull(date); try { <BUG>DateTime previousMatch = previousClosestMatch(date); </BUG> if(previousMatch.equals(date)){ previousMatch = previousClosestMatch(date.minusSeconds(1)); }
public java.time.Duration timeToNextExecution(ZonedDateTime date){ return java.time.Duration.between(date, nextExecution(date)); public ZonedDateTime lastExecution(ZonedDateTime date){ ZonedDateTime previousMatch = previousClosestMatch(date);
6,936
return previousMatch; } catch (NoSuchValueException e) { throw new IllegalArgumentException(e); } } <BUG>public Duration timeFromLastExecution(DateTime date){ return new Interval(lastExecution(date), date).toDuration(); } public boolean isMatch(DateTime date){ </BUG> return nextExecution(lastExecution(date)).equals(date);
[DELETED]
6,937
<BUG>package com.cronutils.model.time.generator; import com.cronutils.model.field.CronField;</BUG> import com.cronutils.model.field.expression.Every; import com.cronutils.model.field.expression.FieldExpression; import com.google.common.annotations.VisibleForTesting;
import java.time.ZonedDateTime; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.cronutils.model.field.CronField;
6,938
import com.cronutils.model.field.CronField;</BUG> import com.cronutils.model.field.expression.Every; import com.cronutils.model.field.expression.FieldExpression; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.Lists; <BUG>import org.joda.time.DateTime; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.List;</BUG> class EveryFieldValueGenerator extends FieldValueGenerator {
package com.cronutils.model.time.generator; import java.time.ZonedDateTime; import java.util.List; import com.cronutils.model.field.CronField;
6,939
private static final Logger log = LoggerFactory.getLogger(EveryFieldValueGenerator.class); public EveryFieldValueGenerator(CronField cronField) { super(cronField); log.trace(String.format( "processing \"%s\" at %s", <BUG>cronField.getExpression().asString(), DateTime.now() </BUG> )); } @Override
cronField.getExpression().asString(), ZonedDateTime.now()
6,940
Bundle savedInstanceState) { final View rootView = inflater.inflate(R.layout.tab_qibla, container, false); final QiblaCompassView qiblaCompassView = (QiblaCompassView)rootView.findViewById(R.id.qibla_compass); qiblaCompassView.setConstants(((TextView)rootView.findViewById(R.id.bearing_north)), getText(R.string.bearing_north), ((TextView)rootView.findViewById(R.id.bearing_qibla)), getText(R.string.bearing_qibla)); <BUG>sOrientationListener = new SensorListener() { </BUG> public void onSensorChanged(int s, float v[]) { float northDirection = v[SensorManager.DATA_X]; qiblaCompassView.setDirections(northDirection, sQiblaDirection);
sOrientationListener = new android.hardware.SensorListener() {
6,941
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.*;
6,942
.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);
6,943
</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) {
6,944
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)
6,945
.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))
6,946
.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))
6,947
@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;
6,948
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; }
6,949
return configDirectory; } public boolean isLoaded() { return loaded; } <BUG>public static Cause getCause() { return instance().pluginCause; }</BUG> public EconomyService getEconomyService() { return economyService;
[DELETED]
6,950
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.*;
6,951
.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))
6,952
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) -> {
6,953
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);
6,954
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);
6,955
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() + "\"");
6,956
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() + "\"");
6,957
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
6,958
.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")
6,959
import org.jetbrains.plugins.groovy.codeInspection.threading.*; import org.jetbrains.plugins.groovy.codeInspection.unassignedVariable.UnassignedVariableAccessInspection; import org.jetbrains.plugins.groovy.codeInspection.unusedDef.UnusedDefInspection; import org.jetbrains.plugins.groovy.codeInspection.validity.GroovyDuplicateSwitchBranchInspection; import org.jetbrains.plugins.groovy.codeInspection.validity.GroovyMethodWithInconsistentReturnsInspection; <BUG>import org.jetbrains.plugins.groovy.codeInspection.validity.GroovyUnreachableStatementInspection; public class GroovyInspectionProvider implements InspectionToolProvider, ApplicationComponent {</BUG> public Class[] getInspectionClasses() { return new Class[] { SecondUnsafeCallInspection.class,
import org.jetbrains.plugins.groovy.codeInspection.noReturnMethod.MissingReturnInspection; public class GroovyInspectionProvider implements InspectionToolProvider, ApplicationComponent {
6,960
package org.jetbrains.plugins.groovy.lang.psi.controlFlow; import com.intellij.openapi.diagnostic.Logger; import gnu.trove.TIntHashSet; import gnu.trove.TObjectIntHashMap; <BUG>import java.util.*; public class ControlFlowUtil {</BUG> private static final Logger LOG = Logger.getInstance("org.jetbrains.plugins.groovy.lang.psi.controlFlow.ControlFlowUtil"); public static int[] postorder(Instruction[] flow) { int[] result = new int[flow.length];
import org.jetbrains.plugins.groovy.lang.psi.api.statements.branch.GrReturnStatement; public class ControlFlowUtil {
6,961
@Override public void preInit() { asphalt = MilitaryBaseDecor.INSTANCE.getManager().newBlock(BlockAsphalt.class, ItemBlockColdWar.class); reinforcedRail = MilitaryBaseDecor.INSTANCE.getManager().newBlock(BlockReinforcedRail.class, ItemBlockColdWar.class); <BUG>MilitaryBaseDecor.CREATIVE_TAB_1.itemStack = new ItemStack(asphalt); </BUG> } @Override public void postInit()
MilitaryBaseDecor.MAIN_TAB.itemStack = new ItemStack(asphalt);
6,962
this.setBlockName("reinforced_rail"); this.setBlockTextureName(MilitaryBaseDecor.PREFIX + "reinforced_rail"); this.setHardness(10F); this.setResistance(10F); this.setStepSound(soundTypeMetal); <BUG>this.setCreativeTab(MilitaryBaseDecor.CREATIVE_TAB_1); </BUG> } @Override public float getRailMaxSpeed(World world, EntityMinecart cart, int y, int x, int z)
this.setCreativeTab(MilitaryBaseDecor.MAIN_TAB);
6,963
public static final String ASSETS_PATH = "/assets/militarybasedecor/"; public static final String TEXTURE_PATH = "textures/"; public static final String GUI_PATH = TEXTURE_PATH + "gui/";</BUG> public static final String MODEL_PATH = "models/"; <BUG>public static final String MODEL_DIRECTORY = ASSETS_PATH + MODEL_PATH; public static final String MODEL_TEXTURE_PATH = TEXTURE_PATH + MODEL_PATH; public static final String BLOCK_PATH = TEXTURE_PATH + "blocks/"; public static final String ITEM_PATH = TEXTURE_PATH + "items/";</BUG> @Mod.Instance(DOMAIN) public static MilitaryBaseDecor INSTANCE;
import cpw.mods.fml.common.event.FMLPreInitializationEvent; @Mod(modid = MilitaryBaseDecor.DOMAIN, name = "Military Base Decor", version = "@MAJOR@.@MINOR@.@REVIS@.@BUILD@", dependencies = "required-after:VoltzEngine") public final class MilitaryBaseDecor extends AbstractMod { public static final String DOMAIN = "militarybasedecor"; public static final String PREFIX = DOMAIN + ":";
6,964
public static final IModelCustom GLASS_FLOOR_PANEL_MODEL = model("Glass_Floor_Panel.tcn"); public static final IModelCustom REINFORCED_GLASS_FLOOR_PANEL_MODEL = model("Reinforced_Glass_Floor_Panel.tcn");</BUG> public static final IModelCustom ADVANCED_SANDBAG_MODEL = model("Advanced_Sandbag.tcn"); public static final ResourceLocation PANE_BARBS_TEXTURE = texture("Pane_Barbs"); <BUG>public static final ResourceLocation MESHED_FLOOR_PANEL_TEXTURE = texture("Meshed_Floor_Panel"); public static final ResourceLocation GLASS_FLOOR_PANEL_TEXTURE = texture("Glass_Floor_Panel"); public static final ResourceLocation REINFORCED_GLASS_FLOOR_PANEL_TEXTURE = texture("Reinforced_Glass_Floor_Panel");</BUG> public static final ResourceLocation ADVANCED_SANDBAG_TEXTURE = texture("Advanced_Sandbag"); public static IModelCustom model(String name) {
import net.minecraftforge.client.model.IModelCustom; @SideOnly(Side.CLIENT) public final class Assets public static final IModelCustom PANE_BARBS_MODEL = model("Pane_Barbs.tcn");
6,965
default: throw new SystemException(); } } } <BUG>protected void invokeTransactionCommitIfNotLocalTransaction(CompensableTransaction compensable) throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException { Transaction transaction = compensable.getTransaction();</BUG> TransactionContext transactionContext = transaction.getTransactionContext(); TransactionXid xid = transactionContext.getXid();
protected void invokeTransactionCommitIfNotLocalTransaction(CompensableTransaction compensable) throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, Transaction transaction = compensable.getTransaction();
6,966
import java.util.Collections; import java.util.Comparator; import java.util.Date; import java.util.HashMap; import java.util.List; <BUG>import java.util.Map; import javax.xml.parsers.DocumentBuilder;</BUG> import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.TransformerFactory;
import javax.xml.XMLConstants; import javax.xml.parsers.DocumentBuilder;
6,967
import javax.xml.transform.stream.StreamResult; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.pentaho.di.core.database.DatabaseMeta; <BUG>import org.pentaho.di.core.xml.XMLHandler; import org.pentaho.pms.core.CWM;</BUG> import org.pentaho.pms.core.exception.PentahoMetadataException; import org.pentaho.pms.factory.CwmSchemaFactoryInterface; import org.pentaho.pms.messages.Messages;
import org.pentaho.metadata.util.XmiParser; import org.pentaho.pms.core.CWM;
6,968
import org.pentaho.metadata.query.model.Constraint; import org.pentaho.metadata.query.model.Order; import org.pentaho.metadata.query.model.Parameter; import org.pentaho.metadata.query.model.Query; import org.pentaho.metadata.query.model.Selection; <BUG>import org.pentaho.metadata.repository.IMetadataDomainRepository; import org.pentaho.pms.core.exception.PentahoMetadataException;</BUG> import org.pentaho.reporting.libraries.base.util.CSVTokenizer; import org.w3c.dom.Document; import org.w3c.dom.Element;
import org.pentaho.metadata.util.XmiParser; import org.pentaho.pms.core.exception.PentahoMetadataException;
6,969
package org.pentaho.metadata.query.model.util; import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; <BUG>import static junit.framework.Assert.fail; import javax.xml.parsers.DocumentBuilder;</BUG> import javax.xml.parsers.DocumentBuilderFactory; import org.junit.Before; import org.junit.Test;
import static org.mockito.Mockito.mock; import javax.xml.parsers.DocumentBuilder;
6,970
synchronized void onSuccess() { checkFailureRate(circuitBreakerMetrics.onSuccess()); } private void checkFailureRate(float currentFailureRate) { if (currentFailureRate >= failureRateThreshold) { <BUG>stateMachine.transitionToOpenState(CircuitBreaker.StateTransition.CLOSED_TO_OPEN, circuitBreakerMetrics); }</BUG> } @Override CircuitBreaker.State getState() {
stateMachine.transitionToOpenState(circuitBreakerMetrics);
6,971
package io.github.robwin.circuitbreaker; import io.github.robwin.circuitbreaker.event.CircuitBreakerEvent; <BUG>import io.github.robwin.circuitbreaker.internal.CircuitBreakerStateMachine; </BUG> import io.github.robwin.circuitbreaker.utils.CircuitBreakerUtils; import io.github.robwin.metrics.StopWatch; import io.reactivex.Flowable;
import io.github.robwin.circuitbreaker.internal.*;
6,972
import java.util.function.Function; import java.util.function.Supplier; public interface CircuitBreaker { boolean isCallPermitted(); void onError(Duration duration, Throwable throwable); <BUG>void onSuccess(Duration duration); String getName();</BUG> State getState(); CircuitBreakerConfig getCircuitBreakerConfig(); Metrics getMetrics();
void transitionToClosedState(); void transitionToOpenState(); void transitionToHalfClosedState(); String getName();
6,973
} enum StateTransition { CLOSED_TO_OPEN(State.CLOSED, State.OPEN), HALF_OPEN_TO_CLOSED(State.HALF_OPEN, State.CLOSED), HALF_OPEN_TO_OPEN(State.HALF_OPEN, State.OPEN), <BUG>OPEN_TO_HALF_OPEN(State.OPEN, State.HALF_OPEN); State fromState;</BUG> State toState; StateTransition(State fromState, State toState) {
OPEN_TO_HALF_OPEN(State.OPEN, State.HALF_OPEN), FORCED_OPEN_TO_CLOSED(State.OPEN, State.CLOSED); State fromState;
6,974
package io.github.robwin.circuitbreaker.internal; <BUG>import io.github.robwin.circuitbreaker.CircuitBreaker; import io.github.robwin.circuitbreaker.CircuitBreakerOpenException;</BUG> import java.time.Instant; final class OpenState extends CircuitBreakerState { private final Instant retryAfterWaitDuration;
import io.github.robwin.circuitbreaker.CircuitBreakerConfig; import io.github.robwin.circuitbreaker.CircuitBreakerOpenException;
6,975
this.queryLogger = Loggers.getLogger(logger, ".query"); this.fetchLogger = Loggers.getLogger(logger, ".fetch"); queryLogger.setLevel(level); fetchLogger.setLevel(level); indexSettingsService.addListener(new ApplySettings()); <BUG>} private long parseTimeSetting(String name, long defaultNanos) { try { return componentSettings.getAsTime(name, TimeValue.timeValueNanos(defaultNanos)).nanos(); } catch (ElasticSearchParseException e) { logger.error("Could not parse setting for [{}], disabling", name); return -1; }</BUG> }
[DELETED]
6,976
while (_stayAlive) { while (_doRun) { I2CPMessage msg = null; try { msg = in.take(); <BUG>if (msg.getType() == PoisonI2CPMessage.MESSAGE_TYPE) cancelRunner(); else _listener.messageReceived(QueuedI2CPMessageReader.this, msg); } catch (InterruptedException ie) {}</BUG> }
if (msg.getType() == PoisonI2CPMessage.MESSAGE_TYPE) { _listener.disconnected(QueuedI2CPMessageReader.this); } else { } catch (InterruptedException ie) {}
6,977
for (Town town : towns) { jComboBox3.addItem(town.getName()); } jComboBox3.addActionListener(new ActionListener() { @Override <BUG>public void actionPerformed(ActionEvent e) { changeTown(towns.get(jComboBox3.getSelectedIndex())); }</BUG> }); initComponents();
if (towns.size() > 0 && jComboBox3.getSelectedIndex() >= 0) {
6,978
mainLevelToBuild = new javax.swing.JSpinner(); mainPic = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); farmLevelToBuild = new javax.swing.JSpinner(); storageLevelToBuild = new javax.swing.JSpinner(); <BUG>saveButton = new javax.swing.JButton(); jPanel2 = new javax.swing.JPanel();</BUG> jLabel3 = new javax.swing.JLabel(); swordPic = new javax.swing.JLabel(); swordToBuild = new javax.swing.JSpinner();
jScrollPane1 = new javax.swing.JScrollPane(); jPanel2 = new javax.swing.JPanel();
6,979
.addComponent(oraclePic)) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(trade_officePic) .addComponent(trade_officeLevelToBuild, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE))) .addComponent(jLabel2)) <BUG>.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) );</BUG> jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap(347, Short.MAX_VALUE)) );
6,980
saveButton.setText("Save"); saveButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { saveButtonActionPerformed(evt); } <BUG>}); jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());</BUG> jLabel3.setText("Troops"); swordPic.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N swordPic.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jScrollPane1.setPreferredSize(new java.awt.Dimension(1096, 130)); jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());
6,981
.addComponent(colonize_shipToBuild, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(0, 0, 0) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(sea_monsterPic, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(sea_monsterToBuild, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)) <BUG>.addGap(0, 12, Short.MAX_VALUE)) </BUG> ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 0, Short.MAX_VALUE))
6,982
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup(</BUG> layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) <BUG>.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel1) .addGap(92, 92, 92)) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)</BUG> .addGroup(layout.createSequentialGroup()
layout.setHorizontalGroup(
6,983
private javax.swing.JSpinner ironerLevelToBuild; private javax.swing.JLabel ironerPic; private JComboBox<String> jComboBox1; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; <BUG>private javax.swing.JLabel jLabel3; private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel2; private javax.swing.JSpinner libraryLevelToBuild;</BUG> private javax.swing.JLabel libraryPic;
private javax.swing.JLabel jLabel4; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JSpinner libraryLevelToBuild;
6,984
package Grepolis.GUI; <BUG>import Grepolis.GrepolisBot; import Grepolis.IO.Saver;</BUG> import Grepolis.Town; import javax.swing.*; import javax.swing.event.ChangeEvent;
import Grepolis.IO.Loader; import Grepolis.IO.Saver;
6,985
private void addJTabbedPaneListener() { ChangeListener changeListener = new ChangeListener() { public void stateChanged(ChangeEvent changeEvent) { JTabbedPane sourceTabbedPane = (JTabbedPane) changeEvent.getSource(); int index = sourceTabbedPane.getSelectedIndex(); <BUG>if (index == 1) { //queue tab queueTab.changeTown();</BUG> } else if (index == 2) { //farming tab farmingTab.setTowns(towns); }
Loader.loadTemplateTowns(); queueTab.changeTown();
6,986
import com.continuuity.weave.api.RunId; import com.continuuity.weave.api.SecureStore; import com.continuuity.weave.api.SecureStoreUpdater; import com.continuuity.weave.yarn.YarnSecureStore; import org.apache.hadoop.conf.Configuration; <BUG>import org.apache.hadoop.security.Credentials; public final class HBaseSecureStoreUpdater implements SecureStoreUpdater {</BUG> private final Configuration hConf; private long nextUpdateTime = -1; private Credentials credentials;
import java.util.concurrent.TimeUnit; public final class HBaseSecureStoreUpdater implements SecureStoreUpdater {
6,987
package org.zkoss.zul.impl; import java.util.List; import java.util.LinkedList; <BUG>import java.util.Iterator; import org.zkoss.zk.ui.WrongValueException;</BUG> public class Utils { public static final int[] stringToInts(String numbers, int defaultValue)
import org.zkoss.lang.Strings; import org.zkoss.zk.ui.Desktop; import org.zkoss.zk.ui.AbstractComponent; import org.zkoss.zk.ui.WrongValueException;
6,988
import java.util.Locale; import java.util.Map; import java.util.TreeMap; public class DependencyConvergenceReport extends AbstractProjectInfoReport <BUG>{ private List reactorProjects; private static final int PERCENTAGE = 100;</BUG> public String getOutputName() {
private static final int PERCENTAGE = 100; private static final List SUPPORTED_FONT_FAMILY_NAMES = Arrays.asList( GraphicsEnvironment .getLocalGraphicsEnvironment().getAvailableFontFamilyNames() );
6,989
sink.section1(); sink.sectionTitle1(); sink.text( getI18nString( locale, "title" ) ); sink.sectionTitle1_(); Map dependencyMap = getDependencyMap(); <BUG>generateLegend( locale, sink ); generateStats( locale, sink, dependencyMap ); generateConvergence( locale, sink, dependencyMap ); sink.section1_();</BUG> sink.body_();
sink.lineBreak(); sink.section1_();
6,990
Iterator it = artifactMap.keySet().iterator(); while ( it.hasNext() ) { String version = (String) it.next(); sink.tableRow(); <BUG>sink.tableCell(); sink.text( version );</BUG> sink.tableCell_(); sink.tableCell(); generateVersionDetails( sink, artifactMap, version );
sink.tableCell( String.valueOf( cellWidth ) + "px" ); sink.text( version );
6,991
sink.tableCell(); sink.text( getI18nString( locale, "legend.shared" ) ); sink.tableCell_(); sink.tableRow_(); sink.tableRow(); <BUG>sink.tableCell(); iconError( sink );</BUG> sink.tableCell_(); sink.tableCell(); sink.text( getI18nString( locale, "legend.different" ) );
sink.tableCell( "15px" ); // according /images/icon_error_sml.gif iconError( sink );
6,992
sink.tableCaption(); sink.text( getI18nString( locale, "stats.caption" ) ); sink.tableCaption_();</BUG> sink.tableRow(); <BUG>sink.tableHeaderCell(); sink.text( getI18nString( locale, "stats.subprojects" ) + ":" ); sink.tableHeaderCell_();</BUG> sink.tableCell(); sink.text( String.valueOf( reactorProjects.size() ) ); sink.tableCell_();
sink.bold(); sink.bold_(); sink.tableCaption_(); sink.tableHeaderCell( headerCellWidth ); sink.text( getI18nString( locale, "stats.subprojects" ) ); sink.tableHeaderCell_();
6,993
sink.tableCell(); sink.text( String.valueOf( reactorProjects.size() ) ); sink.tableCell_(); sink.tableRow_(); sink.tableRow(); <BUG>sink.tableHeaderCell(); sink.text( getI18nString( locale, "stats.dependencies" ) + ":" ); sink.tableHeaderCell_();</BUG> sink.tableCell(); sink.text( String.valueOf( depCount ) );
sink.tableHeaderCell( headerCellWidth ); sink.text( getI18nString( locale, "stats.dependencies" ) ); sink.tableHeaderCell_();
6,994
sink.text( String.valueOf( convergence ) + "%" ); sink.bold_(); sink.tableCell_(); sink.tableRow_(); sink.tableRow(); <BUG>sink.tableHeaderCell(); sink.text( getI18nString( locale, "stats.readyrelease" ) + ":" ); sink.tableHeaderCell_();</BUG> sink.tableCell(); if ( convergence >= PERCENTAGE && snapshotCount <= 0 )
sink.tableHeaderCell( headerCellWidth ); sink.text( getI18nString( locale, "stats.readyrelease" ) ); sink.tableHeaderCell_();
6,995
{ ReverseDependencyLink p1 = (ReverseDependencyLink) o1; ReverseDependencyLink p2 = (ReverseDependencyLink) o2; return p1.getProject().getId().compareTo( p2.getProject().getId() ); } <BUG>else {</BUG> return 0; } }
iconError( sink );
6,996
try { log.debug("Loading native gnustl_shared..."); //$NON-NLS-1$ System.loadLibrary("gnustl_shared"); log.debug("Loading native cpufeatures_proxy..."); //$NON-NLS-1$ System.loadLibrary("cpufeatures_proxy"); <BUG>if (PlatformUtil.AVIAN_LIBRARY) { log.debug("Loading load routing test..."); //$NON-NLS-1$ System.loadLibrary("routing_test"); testRoutingPing(); }</BUG> if(android.os.Build.VERSION.SDK_INT >= 8) {
[DELETED]
6,997
} @RootTask static Task<Exec.Result> exec(String parameter, int number) { Task<String> task1 = MyTask.create(parameter); Task<Integer> task2 = Adder.create(number, number + 2); <BUG>return Task.ofType(Exec.Result.class).named("exec", "/bin/sh") .in(() -> task1)</BUG> .in(() -> task2) .process(Exec.exec((str, i) -> args("/bin/sh", "-c", "\"echo " + i + "\""))); }
return Task.named("exec", "/bin/sh").ofType(Exec.Result.class) .in(() -> task1)
6,998
return args; } static class MyTask { static final int PLUS = 10; static Task<String> create(String parameter) { <BUG>return Task.ofType(String.class).named("MyTask", parameter) .in(() -> Adder.create(parameter.length(), PLUS))</BUG> .in(() -> Fib.create(parameter.length())) .process((sum, fib) -> something(parameter, sum, fib)); }
return Task.named("MyTask", parameter).ofType(String.class) .in(() -> Adder.create(parameter.length(), PLUS))
6,999
final String instanceField = "from instance"; final TaskContext context = TaskContext.inmem(); final AwaitingConsumer<String> val = new AwaitingConsumer<>(); @Test public void shouldJavaUtilSerialize() throws Exception { <BUG>Task<Long> task1 = Task.ofType(Long.class).named("Foo", "Bar", 39) .process(() -> 9999L); Task<String> task2 = Task.ofType(String.class).named("Baz", 40) .in(() -> task1)</BUG> .ins(() -> singletonList(task1))
Task<Long> task1 = Task.named("Foo", "Bar", 39).ofType(Long.class) Task<String> task2 = Task.named("Baz", 40).ofType(String.class) .in(() -> task1)
7,000
assertEquals(des.id().name(), "Baz"); assertEquals(val.awaitAndGet(), "[9999] hello 10004"); } @Test(expected = NotSerializableException.class) public void shouldNotSerializeWithInstanceFieldReference() throws Exception { <BUG>Task<String> task = Task.ofType(String.class).named("WithRef") .process(() -> instanceField + " causes an outer reference");</BUG> serialize(task); } @Test
Task<String> task = Task.named("WithRef").ofType(String.class) .process(() -> instanceField + " causes an outer reference");