text
stringlengths
171
29.4k
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public int compareTo(DurationField durationField) { if (durationField.isSupported()) { return 1; } return 0; } // Test Case [/INST] ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function protected static int between(ReadablePartial start, ReadablePartial end, ReadablePeriod zeroInstance) { if (start == null || end == null) { throw new Ille...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public class ZoneInfoCompiler { static DateTimeOfYear cStartOfYear; static Chronology cLenientISO; static ThreadLocal<Boolean> cVerbose = new ThreadLocal<Boolean>()...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public static LocalDateTime fromCalendarFields(Calendar calendar) { if (calendar == null) { throw new IllegalArgumentException("The calendar must not be n...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public static LocalDate fromCalendarFields(Calendar calendar) { if (calendar == null) { throw new IllegalArgumentException("The calendar must not be null"...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function @SuppressWarnings("deprecation") public static LocalDateTime fromDateFields(Date date) { if (date == null) { throw new IllegalArgumentException("The d...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function @SuppressWarnings("deprecation") public static LocalDate fromDateFields(Date date) { if (date == null) { throw new IllegalArgumentException("The date ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public int calculatePrintedLength(ReadablePeriod period, Locale locale) { long valueLong = getFieldValue(period); if (valueLong == Long.MAX_VALUE)...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public int[] add(ReadablePartial partial, int fieldIndex, int[] values, int valueToAdd) { // overridden as superclass algorithm can't handle // 2004-02-29 + 4...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public static long safeMultiply(long val1, int val2) { switch (val2) { case -1: return -val1; case 0: return 0...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public int parseInto(ReadWritableInstant instant, String text, int position) { DateTimeParser parser = requireParser(); if (instant == null) { thr...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public long adjustOffset(long instant, boolean earlierOrLater) { // a bit messy, but will work in all non-pathological cases // evaluate 3 hours befo...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public long getDateTimeMillis(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public int getOffsetFromLocal(long instantLocal) { // get the offset at instantLocal (first estimate) final int offsetLocal = getOffset(instantLocal); ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public Partial(DateTimeFieldType[] types, int[] values, Chronology chronology) { super(); chronology = DateTimeUtils.getChronology(chronology).withUTC(); ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public int compareTo(DurationField durationField) { return 0; } // Test Case [/INST] public void testWith_baseAndArgHaveNoRange() { Partial test = ne...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public int parseInto(DateTimeParserBucket bucket, String text, int position) { String str = text.substring(position); for (String id : ALL_IDS) { ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function protected BasePeriod(long duration) { this(duration, null, null); // bug [3264409] } // Test Case [/INST] public void testToPeriod_fixedZone() throws...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private static synchronized String getConvertedId(String id) { Map<String, String> map = cZoneIdConversion; if (map == null) { // Backwards compat...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public long computeMillis(boolean resetFields, String text) { SavedField[] savedFields = iSavedFields; int count = iSavedFieldsCount; if (iSavedFields...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public int getOffsetFromLocal(long instantLocal) { // get the offset at instantLocal (first estimate) final int offsetLocal = getOffset(instantLocal); ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public long set(long instant, int value) { // lenient needs to handle time zone chronologies // so we do the calculation using local milliseconds long...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public long add(long instant, int value) { if (iTimeField) { int offset = getOffsetToAdd(instant); long localInstant = iField....
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public long add(long instant, int value) { if (iTimeField) { int offset = getOffsetToAdd(instant); long localInstant = iField....
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public long addWrapField(long instant, int value) { if (iTimeField) { int offset = getOffsetToAdd(instant); long localInstant ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public long addWrapField(long instant, int value) { if (iTimeField) { int offset = getOffsetToAdd(instant); long localInstant ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public long addWrapField(long instant, int value) { if (iTimeField) { int offset = getOffsetToAdd(instant); long localInstant ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public long roundFloor(long instant) { if (iTimeField) { int offset = getOffsetToAdd(instant); instant = iField.roundFloor(ins...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public long roundCeiling(long instant) { if (iTimeField) { int offset = getOffsetToAdd(instant); instant = iField.roundCeiling...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function X // Test Case [/INST] public void testWithSecondOfMinuteInDstChange() { DateTime dateTime = new DateTime("2010-10-31T02:30:10.123+02:00", ZONE_PARIS); asser...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function private static PeriodFormatter toFormatter(List<Object> elementPairs, boolean notPrinter, boolean notParser) { if (notPrinter && notParser) { throw new Il...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public void add(DurationFieldType type, int amount) { if (type == null) { throw new IllegalArgumentException("Field must not be null"); } ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public void addYears(final int years) { setMillis(getChronology().years().add(getMillis(), years)); } // Test Case [/INST] public void testAddYears_int_d...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public void addWeekyears(final int weekyears) { setMillis(getChronology().weekyears().add(getMillis(), weekyears)); } // Test Case [/INST] public void te...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public void addMonths(final int months) { setMillis(getChronology().months().add(getMillis(), months)); } // Test Case [/INST] public void testAddYears_i...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public void addWeeks(final int weeks) { setMillis(getChronology().weeks().add(getMillis(), weeks)); } // Test Case [/INST] public void testAddYears_int_...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public void addDays(final int days) { setMillis(getChronology().days().add(getMillis(), days)); } // Test Case [/INST] public void testAddYears_int_dstOv...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public void addHours(final int hours) { setMillis(getChronology().hours().add(getMillis(), hours)); } // Test Case [/INST] public void testAddYears_int_d...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public void addMinutes(final int minutes) { setMillis(getChronology().minutes().add(getMillis(), minutes)); } // Test Case [/INST] public void testAddYea...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public void addSeconds(final int seconds) { setMillis(getChronology().seconds().add(getMillis(), seconds)); } // Test Case [/INST] public void testAddYea...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public void addMillis(final int millis) { setMillis(getChronology().millis().add(getMillis(), millis)); } // Test Case [/INST] public void testAddYears_i...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public Partial with(DateTimeFieldType fieldType, int value) { if (fieldType == null) { throw new IllegalArgumentException("The field type must not be null...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public Period normalizedStandard(PeriodType type) { type = DateTimeUtils.getPeriodType(type); long millis = getMillis(); // no overflow can happen, even with...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public static synchronized GJChronology getInstance( DateTimeZone zone, ReadableInstant gregorianCutover, int minDaysInFirstWeek) { ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public int parseInto(ReadWritableInstant instant, String text, int position) { DateTimeParser parser = requireParser(); if (instant == null) { thr...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public static DateTimeZone forOffsetHoursMinutes(int hoursOffset, int minutesOffset) throws IllegalArgumentException { if (hoursOffset == 0 && minutesOffset == 0) { ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public static DateTimeZone forOffsetHoursMinutes(int hoursOffset, int minutesOffset) throws IllegalArgumentException { if (hoursOffset == 0 && minutesOffset == 0) { ...
<s>[INST] <<SYS>> You are a helpful assistant. Generate a test case that triggers the bug for the buggy function. <</SYS>> // Buggy Function public static DateTimeZone forOffsetMillis(int millisOffset) { String id = printOffset(millisOffset); return fixedOffsetZone(id, millisOffset); } // Test...