rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
| meta
stringlengths 141
403
|
---|---|---|---|
private void cleanUpAfterRoll(int field, int delta) { switch (field) { case ERA: case YEAR: case MONTH: // check that day of month is still in correct range if (fields[DAY_OF_MONTH] > getActualMaximum(DAY_OF_MONTH)) fields[DAY_OF_MONTH] = getActualMaximum(DAY_OF_MONTH); isTimeSet = false; isSet[WEEK_OF_MONTH] = false; isSet[DAY_OF_WEEK] = false; isSet[DAY_OF_WEEK_IN_MONTH] = false; isSet[DAY_OF_YEAR] = false; isSet[WEEK_OF_YEAR] = false; break; case DAY_OF_MONTH: isSet[WEEK_OF_MONTH] = false; isSet[DAY_OF_WEEK] = false; isSet[DAY_OF_WEEK_IN_MONTH] = false; isSet[DAY_OF_YEAR] = false; isSet[WEEK_OF_YEAR] = false; time += delta * (24 * 60 * 60 * 1000L); break; case WEEK_OF_MONTH: isSet[DAY_OF_MONTH] = false; isSet[DAY_OF_WEEK_IN_MONTH] = false; isSet[DAY_OF_YEAR] = false; isSet[WEEK_OF_YEAR] = false; time += delta * (7 * 24 * 60 * 60 * 1000L); break; case DAY_OF_WEEK_IN_MONTH: isSet[DAY_OF_MONTH] = false; isSet[WEEK_OF_MONTH] = false; isSet[DAY_OF_YEAR] = false; isSet[WEEK_OF_YEAR] = false; time += delta * (7 * 24 * 60 * 60 * 1000L); break; case DAY_OF_YEAR: isSet[MONTH] = false; isSet[DAY_OF_MONTH] = false; isSet[WEEK_OF_MONTH] = false; isSet[DAY_OF_WEEK_IN_MONTH] = false; isSet[DAY_OF_WEEK] = false; isSet[WEEK_OF_YEAR] = false; time += delta * (24 * 60 * 60 * 1000L); break; case WEEK_OF_YEAR: isSet[MONTH] = false; isSet[DAY_OF_MONTH] = false; isSet[WEEK_OF_MONTH] = false; isSet[DAY_OF_WEEK_IN_MONTH] = false; isSet[DAY_OF_YEAR] = false; time += delta * (7 * 24 * 60 * 60 * 1000L); break; case AM_PM: isSet[HOUR_OF_DAY] = false; time += delta * (12 * 60 * 60 * 1000L); break; case HOUR: isSet[HOUR_OF_DAY] = false; time += delta * (60 * 60 * 1000L); break; case HOUR_OF_DAY: isSet[HOUR] = false; isSet[AM_PM] = false; time += delta * (60 * 60 * 1000L); break; case MINUTE: time += delta * (60 * 1000L); break; case SECOND: time += delta * (1000L); break; case MILLISECOND: time += delta; break; } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/GregorianCalendar.java/clean/core/src/classpath/java/java/util/GregorianCalendar.java
|
||
private void cleanUpAfterRoll(int field, int delta) { switch (field) { case ERA: case YEAR: case MONTH: // check that day of month is still in correct range if (fields[DAY_OF_MONTH] > getActualMaximum(DAY_OF_MONTH)) fields[DAY_OF_MONTH] = getActualMaximum(DAY_OF_MONTH); isTimeSet = false; isSet[WEEK_OF_MONTH] = false; isSet[DAY_OF_WEEK] = false; isSet[DAY_OF_WEEK_IN_MONTH] = false; isSet[DAY_OF_YEAR] = false; isSet[WEEK_OF_YEAR] = false; break; case DAY_OF_MONTH: isSet[WEEK_OF_MONTH] = false; isSet[DAY_OF_WEEK] = false; isSet[DAY_OF_WEEK_IN_MONTH] = false; isSet[DAY_OF_YEAR] = false; isSet[WEEK_OF_YEAR] = false; time += delta * (24 * 60 * 60 * 1000L); break; case WEEK_OF_MONTH: isSet[DAY_OF_MONTH] = false; isSet[DAY_OF_WEEK_IN_MONTH] = false; isSet[DAY_OF_YEAR] = false; isSet[WEEK_OF_YEAR] = false; time += delta * (7 * 24 * 60 * 60 * 1000L); break; case DAY_OF_WEEK_IN_MONTH: isSet[DAY_OF_MONTH] = false; isSet[WEEK_OF_MONTH] = false; isSet[DAY_OF_YEAR] = false; isSet[WEEK_OF_YEAR] = false; time += delta * (7 * 24 * 60 * 60 * 1000L); break; case DAY_OF_YEAR: isSet[MONTH] = false; isSet[DAY_OF_MONTH] = false; isSet[WEEK_OF_MONTH] = false; isSet[DAY_OF_WEEK_IN_MONTH] = false; isSet[DAY_OF_WEEK] = false; isSet[WEEK_OF_YEAR] = false; time += delta * (24 * 60 * 60 * 1000L); break; case WEEK_OF_YEAR: isSet[MONTH] = false; isSet[DAY_OF_MONTH] = false; isSet[WEEK_OF_MONTH] = false; isSet[DAY_OF_WEEK_IN_MONTH] = false; isSet[DAY_OF_YEAR] = false; time += delta * (7 * 24 * 60 * 60 * 1000L); break; case AM_PM: isSet[HOUR_OF_DAY] = false; time += delta * (12 * 60 * 60 * 1000L); break; case HOUR: isSet[HOUR_OF_DAY] = false; time += delta * (60 * 60 * 1000L); break; case HOUR_OF_DAY: isSet[HOUR] = false; isSet[AM_PM] = false; time += delta * (60 * 60 * 1000L); break; case MINUTE: time += delta * (60 * 1000L); break; case SECOND: time += delta * (1000L); break; case MILLISECOND: time += delta; break; } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/GregorianCalendar.java/clean/core/src/classpath/java/java/util/GregorianCalendar.java
|
||
private void cleanUpAfterRoll(int field, int delta) { switch (field) { case ERA: case YEAR: case MONTH: // check that day of month is still in correct range if (fields[DAY_OF_MONTH] > getActualMaximum(DAY_OF_MONTH)) fields[DAY_OF_MONTH] = getActualMaximum(DAY_OF_MONTH); isTimeSet = false; isSet[WEEK_OF_MONTH] = false; isSet[DAY_OF_WEEK] = false; isSet[DAY_OF_WEEK_IN_MONTH] = false; isSet[DAY_OF_YEAR] = false; isSet[WEEK_OF_YEAR] = false; break; case DAY_OF_MONTH: isSet[WEEK_OF_MONTH] = false; isSet[DAY_OF_WEEK] = false; isSet[DAY_OF_WEEK_IN_MONTH] = false; isSet[DAY_OF_YEAR] = false; isSet[WEEK_OF_YEAR] = false; time += delta * (24 * 60 * 60 * 1000L); break; case WEEK_OF_MONTH: isSet[DAY_OF_MONTH] = false; isSet[DAY_OF_WEEK_IN_MONTH] = false; isSet[DAY_OF_YEAR] = false; isSet[WEEK_OF_YEAR] = false; time += delta * (7 * 24 * 60 * 60 * 1000L); break; case DAY_OF_WEEK_IN_MONTH: isSet[DAY_OF_MONTH] = false; isSet[WEEK_OF_MONTH] = false; isSet[DAY_OF_YEAR] = false; isSet[WEEK_OF_YEAR] = false; time += delta * (7 * 24 * 60 * 60 * 1000L); break; case DAY_OF_YEAR: isSet[MONTH] = false; isSet[DAY_OF_MONTH] = false; isSet[WEEK_OF_MONTH] = false; isSet[DAY_OF_WEEK_IN_MONTH] = false; isSet[DAY_OF_WEEK] = false; isSet[WEEK_OF_YEAR] = false; time += delta * (24 * 60 * 60 * 1000L); break; case WEEK_OF_YEAR: isSet[MONTH] = false; isSet[DAY_OF_MONTH] = false; isSet[WEEK_OF_MONTH] = false; isSet[DAY_OF_WEEK_IN_MONTH] = false; isSet[DAY_OF_YEAR] = false; time += delta * (7 * 24 * 60 * 60 * 1000L); break; case AM_PM: isSet[HOUR_OF_DAY] = false; time += delta * (12 * 60 * 60 * 1000L); break; case HOUR: isSet[HOUR_OF_DAY] = false; time += delta * (60 * 60 * 1000L); break; case HOUR_OF_DAY: isSet[HOUR] = false; isSet[AM_PM] = false; time += delta * (60 * 60 * 1000L); break; case MINUTE: time += delta * (60 * 1000L); break; case SECOND: time += delta * (1000L); break; case MILLISECOND: time += delta; break; } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/GregorianCalendar.java/clean/core/src/classpath/java/java/util/GregorianCalendar.java
|
||
fields[DST_OFFSET] = zone.getOffset(fields[ERA], fields[YEAR], fields[MONTH], fields[DAY_OF_MONTH], fields[DAY_OF_WEEK], millisInDay) - fields[ZONE_OFFSET];
|
fields[DST_OFFSET] = zone.getOffset(fields[ERA], fields[YEAR], fields[MONTH], fields[DAY_OF_MONTH], fields[DAY_OF_WEEK], millisInDay) - fields[ZONE_OFFSET];
|
protected synchronized void computeFields() { boolean gregorian = (time >= gregorianCutover); TimeZone zone = getTimeZone(); fields[ZONE_OFFSET] = zone.getRawOffset(); long localTime = time + fields[ZONE_OFFSET]; long day = localTime / (24 * 60 * 60 * 1000L); int millisInDay = (int) (localTime % (24 * 60 * 60 * 1000L)); if (millisInDay < 0) { millisInDay += (24 * 60 * 60 * 1000); day--; } calculateDay(fields, day, gregorian); fields[DST_OFFSET] = zone.getOffset(fields[ERA], fields[YEAR], fields[MONTH], fields[DAY_OF_MONTH], fields[DAY_OF_WEEK], millisInDay) - fields[ZONE_OFFSET]; millisInDay += fields[DST_OFFSET]; if (millisInDay >= 24 * 60 * 60 * 1000) { millisInDay -= 24 * 60 * 60 * 1000; calculateDay(fields, ++day, gregorian); } fields[DAY_OF_WEEK_IN_MONTH] = (fields[DAY_OF_MONTH] + 6) / 7; // which day of the week are we (0..6), relative to getFirstDayOfWeek int relativeWeekday = (7 + fields[DAY_OF_WEEK] - getFirstDayOfWeek()) % 7; fields[WEEK_OF_MONTH] = (fields[DAY_OF_MONTH] - relativeWeekday + 12) / 7; int weekOfYear = (fields[DAY_OF_YEAR] - relativeWeekday + 6) / 7; // Do the Correction: getMinimalDaysInFirstWeek() is always in the // first week. int minDays = getMinimalDaysInFirstWeek(); int firstWeekday = (7 + getWeekDay(fields[YEAR], minDays) - getFirstDayOfWeek()) % 7; if (minDays - firstWeekday < 1) weekOfYear++; fields[WEEK_OF_YEAR] = weekOfYear; int hourOfDay = millisInDay / (60 * 60 * 1000); fields[AM_PM] = (hourOfDay < 12) ? AM : PM; int hour = hourOfDay % 12; fields[HOUR] = (hour == 0) ? 12 : hour; fields[HOUR_OF_DAY] = hourOfDay; millisInDay %= (60 * 60 * 1000); fields[MINUTE] = millisInDay / (60 * 1000); millisInDay %= (60 * 1000); fields[SECOND] = millisInDay / (1000); fields[MILLISECOND] = millisInDay % 1000; areFieldsSet = isSet[ERA] = isSet[YEAR] = isSet[MONTH] = isSet[WEEK_OF_YEAR] = isSet[WEEK_OF_MONTH] = isSet[DAY_OF_MONTH] = isSet[DAY_OF_YEAR] = isSet[DAY_OF_WEEK] = isSet[DAY_OF_WEEK_IN_MONTH] = isSet[AM_PM] = isSet[HOUR] = isSet[HOUR_OF_DAY] = isSet[MINUTE] = isSet[SECOND] = isSet[MILLISECOND] = isSet[ZONE_OFFSET] = isSet[DST_OFFSET] = true; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/GregorianCalendar.java/clean/core/src/classpath/java/java/util/GregorianCalendar.java
|
int firstWeekday = (7 + getWeekDay(fields[YEAR], minDays) - getFirstDayOfWeek()) % 7;
|
int firstWeekday = (7 + getWeekDay(fields[YEAR], minDays) - getFirstDayOfWeek()) % 7;
|
protected synchronized void computeFields() { boolean gregorian = (time >= gregorianCutover); TimeZone zone = getTimeZone(); fields[ZONE_OFFSET] = zone.getRawOffset(); long localTime = time + fields[ZONE_OFFSET]; long day = localTime / (24 * 60 * 60 * 1000L); int millisInDay = (int) (localTime % (24 * 60 * 60 * 1000L)); if (millisInDay < 0) { millisInDay += (24 * 60 * 60 * 1000); day--; } calculateDay(fields, day, gregorian); fields[DST_OFFSET] = zone.getOffset(fields[ERA], fields[YEAR], fields[MONTH], fields[DAY_OF_MONTH], fields[DAY_OF_WEEK], millisInDay) - fields[ZONE_OFFSET]; millisInDay += fields[DST_OFFSET]; if (millisInDay >= 24 * 60 * 60 * 1000) { millisInDay -= 24 * 60 * 60 * 1000; calculateDay(fields, ++day, gregorian); } fields[DAY_OF_WEEK_IN_MONTH] = (fields[DAY_OF_MONTH] + 6) / 7; // which day of the week are we (0..6), relative to getFirstDayOfWeek int relativeWeekday = (7 + fields[DAY_OF_WEEK] - getFirstDayOfWeek()) % 7; fields[WEEK_OF_MONTH] = (fields[DAY_OF_MONTH] - relativeWeekday + 12) / 7; int weekOfYear = (fields[DAY_OF_YEAR] - relativeWeekday + 6) / 7; // Do the Correction: getMinimalDaysInFirstWeek() is always in the // first week. int minDays = getMinimalDaysInFirstWeek(); int firstWeekday = (7 + getWeekDay(fields[YEAR], minDays) - getFirstDayOfWeek()) % 7; if (minDays - firstWeekday < 1) weekOfYear++; fields[WEEK_OF_YEAR] = weekOfYear; int hourOfDay = millisInDay / (60 * 60 * 1000); fields[AM_PM] = (hourOfDay < 12) ? AM : PM; int hour = hourOfDay % 12; fields[HOUR] = (hour == 0) ? 12 : hour; fields[HOUR_OF_DAY] = hourOfDay; millisInDay %= (60 * 60 * 1000); fields[MINUTE] = millisInDay / (60 * 1000); millisInDay %= (60 * 1000); fields[SECOND] = millisInDay / (1000); fields[MILLISECOND] = millisInDay % 1000; areFieldsSet = isSet[ERA] = isSet[YEAR] = isSet[MONTH] = isSet[WEEK_OF_YEAR] = isSet[WEEK_OF_MONTH] = isSet[DAY_OF_MONTH] = isSet[DAY_OF_YEAR] = isSet[DAY_OF_WEEK] = isSet[DAY_OF_WEEK_IN_MONTH] = isSet[AM_PM] = isSet[HOUR] = isSet[HOUR_OF_DAY] = isSet[MINUTE] = isSet[SECOND] = isSet[MILLISECOND] = isSet[ZONE_OFFSET] = isSet[DST_OFFSET] = true; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/GregorianCalendar.java/clean/core/src/classpath/java/java/util/GregorianCalendar.java
|
protected synchronized void computeFields() { boolean gregorian = (time >= gregorianCutover); TimeZone zone = getTimeZone(); fields[ZONE_OFFSET] = zone.getRawOffset(); long localTime = time + fields[ZONE_OFFSET]; long day = localTime / (24 * 60 * 60 * 1000L); int millisInDay = (int) (localTime % (24 * 60 * 60 * 1000L)); if (millisInDay < 0) { millisInDay += (24 * 60 * 60 * 1000); day--; } calculateDay(fields, day, gregorian); fields[DST_OFFSET] = zone.getOffset(fields[ERA], fields[YEAR], fields[MONTH], fields[DAY_OF_MONTH], fields[DAY_OF_WEEK], millisInDay) - fields[ZONE_OFFSET]; millisInDay += fields[DST_OFFSET]; if (millisInDay >= 24 * 60 * 60 * 1000) { millisInDay -= 24 * 60 * 60 * 1000; calculateDay(fields, ++day, gregorian); } fields[DAY_OF_WEEK_IN_MONTH] = (fields[DAY_OF_MONTH] + 6) / 7; // which day of the week are we (0..6), relative to getFirstDayOfWeek int relativeWeekday = (7 + fields[DAY_OF_WEEK] - getFirstDayOfWeek()) % 7; fields[WEEK_OF_MONTH] = (fields[DAY_OF_MONTH] - relativeWeekday + 12) / 7; int weekOfYear = (fields[DAY_OF_YEAR] - relativeWeekday + 6) / 7; // Do the Correction: getMinimalDaysInFirstWeek() is always in the // first week. int minDays = getMinimalDaysInFirstWeek(); int firstWeekday = (7 + getWeekDay(fields[YEAR], minDays) - getFirstDayOfWeek()) % 7; if (minDays - firstWeekday < 1) weekOfYear++; fields[WEEK_OF_YEAR] = weekOfYear; int hourOfDay = millisInDay / (60 * 60 * 1000); fields[AM_PM] = (hourOfDay < 12) ? AM : PM; int hour = hourOfDay % 12; fields[HOUR] = (hour == 0) ? 12 : hour; fields[HOUR_OF_DAY] = hourOfDay; millisInDay %= (60 * 60 * 1000); fields[MINUTE] = millisInDay / (60 * 1000); millisInDay %= (60 * 1000); fields[SECOND] = millisInDay / (1000); fields[MILLISECOND] = millisInDay % 1000; areFieldsSet = isSet[ERA] = isSet[YEAR] = isSet[MONTH] = isSet[WEEK_OF_YEAR] = isSet[WEEK_OF_MONTH] = isSet[DAY_OF_MONTH] = isSet[DAY_OF_YEAR] = isSet[DAY_OF_WEEK] = isSet[DAY_OF_WEEK_IN_MONTH] = isSet[AM_PM] = isSet[HOUR] = isSet[HOUR_OF_DAY] = isSet[MINUTE] = isSet[SECOND] = isSet[MILLISECOND] = isSet[ZONE_OFFSET] = isSet[DST_OFFSET] = true; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/GregorianCalendar.java/clean/core/src/classpath/java/java/util/GregorianCalendar.java
|
||
areFieldsSet = isSet[ERA] = isSet[YEAR] = isSet[MONTH] = isSet[WEEK_OF_YEAR] = isSet[WEEK_OF_MONTH] = isSet[DAY_OF_MONTH] = isSet[DAY_OF_YEAR] = isSet[DAY_OF_WEEK] = isSet[DAY_OF_WEEK_IN_MONTH] = isSet[AM_PM] = isSet[HOUR] = isSet[HOUR_OF_DAY] = isSet[MINUTE] = isSet[SECOND] = isSet[MILLISECOND] = isSet[ZONE_OFFSET] = isSet[DST_OFFSET] = true;
|
areFieldsSet = isSet[ERA] = isSet[YEAR] = isSet[MONTH] = isSet[WEEK_OF_YEAR] = isSet[WEEK_OF_MONTH] = isSet[DAY_OF_MONTH] = isSet[DAY_OF_YEAR] = isSet[DAY_OF_WEEK] = isSet[DAY_OF_WEEK_IN_MONTH] = isSet[AM_PM] = isSet[HOUR] = isSet[HOUR_OF_DAY] = isSet[MINUTE] = isSet[SECOND] = isSet[MILLISECOND] = isSet[ZONE_OFFSET] = isSet[DST_OFFSET] = true;
|
protected synchronized void computeFields() { boolean gregorian = (time >= gregorianCutover); TimeZone zone = getTimeZone(); fields[ZONE_OFFSET] = zone.getRawOffset(); long localTime = time + fields[ZONE_OFFSET]; long day = localTime / (24 * 60 * 60 * 1000L); int millisInDay = (int) (localTime % (24 * 60 * 60 * 1000L)); if (millisInDay < 0) { millisInDay += (24 * 60 * 60 * 1000); day--; } calculateDay(fields, day, gregorian); fields[DST_OFFSET] = zone.getOffset(fields[ERA], fields[YEAR], fields[MONTH], fields[DAY_OF_MONTH], fields[DAY_OF_WEEK], millisInDay) - fields[ZONE_OFFSET]; millisInDay += fields[DST_OFFSET]; if (millisInDay >= 24 * 60 * 60 * 1000) { millisInDay -= 24 * 60 * 60 * 1000; calculateDay(fields, ++day, gregorian); } fields[DAY_OF_WEEK_IN_MONTH] = (fields[DAY_OF_MONTH] + 6) / 7; // which day of the week are we (0..6), relative to getFirstDayOfWeek int relativeWeekday = (7 + fields[DAY_OF_WEEK] - getFirstDayOfWeek()) % 7; fields[WEEK_OF_MONTH] = (fields[DAY_OF_MONTH] - relativeWeekday + 12) / 7; int weekOfYear = (fields[DAY_OF_YEAR] - relativeWeekday + 6) / 7; // Do the Correction: getMinimalDaysInFirstWeek() is always in the // first week. int minDays = getMinimalDaysInFirstWeek(); int firstWeekday = (7 + getWeekDay(fields[YEAR], minDays) - getFirstDayOfWeek()) % 7; if (minDays - firstWeekday < 1) weekOfYear++; fields[WEEK_OF_YEAR] = weekOfYear; int hourOfDay = millisInDay / (60 * 60 * 1000); fields[AM_PM] = (hourOfDay < 12) ? AM : PM; int hour = hourOfDay % 12; fields[HOUR] = (hour == 0) ? 12 : hour; fields[HOUR_OF_DAY] = hourOfDay; millisInDay %= (60 * 60 * 1000); fields[MINUTE] = millisInDay / (60 * 1000); millisInDay %= (60 * 1000); fields[SECOND] = millisInDay / (1000); fields[MILLISECOND] = millisInDay % 1000; areFieldsSet = isSet[ERA] = isSet[YEAR] = isSet[MONTH] = isSet[WEEK_OF_YEAR] = isSet[WEEK_OF_MONTH] = isSet[DAY_OF_MONTH] = isSet[DAY_OF_YEAR] = isSet[DAY_OF_WEEK] = isSet[DAY_OF_WEEK_IN_MONTH] = isSet[AM_PM] = isSet[HOUR] = isSet[HOUR_OF_DAY] = isSet[MINUTE] = isSet[SECOND] = isSet[MILLISECOND] = isSet[ZONE_OFFSET] = isSet[DST_OFFSET] = true; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/GregorianCalendar.java/clean/core/src/classpath/java/java/util/GregorianCalendar.java
|
if (hour < 0 || hour >= 24 || minute < 0 || minute > 59 || second < 0 || second > 59 || millis < 0 || millis >= 1000)
|
if (hour < 0 || hour >= 24 || minute < 0 || minute > 59 || second < 0 || second > 59 || millis < 0 || millis >= 1000)
|
protected synchronized void computeTime() { int era = isSet[ERA] ? fields[ERA] : AD; int year = isSet[YEAR] ? fields[YEAR] : 1970; if (isLenient() && isSet[MONTH]) { int month = fields[MONTH]; year += month / 12; month %= 12; if (month < 0) { month += 12; year--; } fields[MONTH] = month; isSet[YEAR] = true; fields[YEAR] = year; } if (era == BC) year = 1 - year; int[] daysOfYear = getDayOfYear(year); int hour = 0; if (isSet[HOUR_OF_DAY]) hour = fields[HOUR_OF_DAY]; else if (isSet[HOUR]) { hour = fields[HOUR]; if (isSet[AM_PM] && fields[AM_PM] == PM) if (hour != 12) /* not Noon */ hour += 12; /* Fix the problem of the status of 12:00 AM (midnight). */ if (isSet[AM_PM] && fields[AM_PM] == AM && hour == 12) hour = 0; } int minute = isSet[MINUTE] ? fields[MINUTE] : 0; int second = isSet[SECOND] ? fields[SECOND] : 0; int millis = isSet[MILLISECOND] ? fields[MILLISECOND] : 0; int millisInDay; if (isLenient()) { // prevent overflow long allMillis = (((hour * 60L) + minute) * 60L + second) * 1000L + millis; daysOfYear[1] += allMillis / (24 * 60 * 60 * 1000L); millisInDay = (int) (allMillis % (24 * 60 * 60 * 1000L)); } else { if (hour < 0 || hour >= 24 || minute < 0 || minute > 59 || second < 0 || second > 59 || millis < 0 || millis >= 1000) throw new IllegalArgumentException(); millisInDay = (((hour * 60) + minute) * 60 + second) * 1000 + millis; } time = getLinearTime(year, daysOfYear[0], millisInDay); // Add the relative days after calculating the linear time, to // get right behaviour when jumping over the gregorianCutover. time += daysOfYear[1] * (24 * 60 * 60 * 1000L); TimeZone zone = getTimeZone(); int rawOffset = isSet[ZONE_OFFSET] ? fields[ZONE_OFFSET] : zone.getRawOffset(); int day = (int) (time / (24 * 60 * 60 * 1000L)); millisInDay = (int) (time % (24 * 60 * 60 * 1000L)); if (millisInDay < 0) { millisInDay += (24 * 60 * 60 * 1000); day--; } int[] f = new int[FIELD_COUNT]; calculateDay(f, day, time - rawOffset >= gregorianCutover); year = f[YEAR]; int month = f[MONTH]; day = f[DAY_OF_MONTH]; int weekday = f[DAY_OF_WEEK]; int dstOffset = isSet[DST_OFFSET] ? fields[DST_OFFSET] : (zone.getOffset((year < 0) ? BC : AD, (year < 0) ? 1 - year : year, month, day, weekday, millisInDay) - zone.getRawOffset()); time -= rawOffset + dstOffset; isTimeSet = true; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/GregorianCalendar.java/clean/core/src/classpath/java/java/util/GregorianCalendar.java
|
protected synchronized void computeTime() { int era = isSet[ERA] ? fields[ERA] : AD; int year = isSet[YEAR] ? fields[YEAR] : 1970; if (isLenient() && isSet[MONTH]) { int month = fields[MONTH]; year += month / 12; month %= 12; if (month < 0) { month += 12; year--; } fields[MONTH] = month; isSet[YEAR] = true; fields[YEAR] = year; } if (era == BC) year = 1 - year; int[] daysOfYear = getDayOfYear(year); int hour = 0; if (isSet[HOUR_OF_DAY]) hour = fields[HOUR_OF_DAY]; else if (isSet[HOUR]) { hour = fields[HOUR]; if (isSet[AM_PM] && fields[AM_PM] == PM) if (hour != 12) /* not Noon */ hour += 12; /* Fix the problem of the status of 12:00 AM (midnight). */ if (isSet[AM_PM] && fields[AM_PM] == AM && hour == 12) hour = 0; } int minute = isSet[MINUTE] ? fields[MINUTE] : 0; int second = isSet[SECOND] ? fields[SECOND] : 0; int millis = isSet[MILLISECOND] ? fields[MILLISECOND] : 0; int millisInDay; if (isLenient()) { // prevent overflow long allMillis = (((hour * 60L) + minute) * 60L + second) * 1000L + millis; daysOfYear[1] += allMillis / (24 * 60 * 60 * 1000L); millisInDay = (int) (allMillis % (24 * 60 * 60 * 1000L)); } else { if (hour < 0 || hour >= 24 || minute < 0 || minute > 59 || second < 0 || second > 59 || millis < 0 || millis >= 1000) throw new IllegalArgumentException(); millisInDay = (((hour * 60) + minute) * 60 + second) * 1000 + millis; } time = getLinearTime(year, daysOfYear[0], millisInDay); // Add the relative days after calculating the linear time, to // get right behaviour when jumping over the gregorianCutover. time += daysOfYear[1] * (24 * 60 * 60 * 1000L); TimeZone zone = getTimeZone(); int rawOffset = isSet[ZONE_OFFSET] ? fields[ZONE_OFFSET] : zone.getRawOffset(); int day = (int) (time / (24 * 60 * 60 * 1000L)); millisInDay = (int) (time % (24 * 60 * 60 * 1000L)); if (millisInDay < 0) { millisInDay += (24 * 60 * 60 * 1000); day--; } int[] f = new int[FIELD_COUNT]; calculateDay(f, day, time - rawOffset >= gregorianCutover); year = f[YEAR]; int month = f[MONTH]; day = f[DAY_OF_MONTH]; int weekday = f[DAY_OF_WEEK]; int dstOffset = isSet[DST_OFFSET] ? fields[DST_OFFSET] : (zone.getOffset((year < 0) ? BC : AD, (year < 0) ? 1 - year : year, month, day, weekday, millisInDay) - zone.getRawOffset()); time -= rawOffset + dstOffset; isTimeSet = true; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/GregorianCalendar.java/clean/core/src/classpath/java/java/util/GregorianCalendar.java
|
||
int rawOffset = isSet[ZONE_OFFSET] ? fields[ZONE_OFFSET] : zone.getRawOffset();
|
int rawOffset = isSet[ZONE_OFFSET] ? fields[ZONE_OFFSET] : zone.getRawOffset();
|
protected synchronized void computeTime() { int era = isSet[ERA] ? fields[ERA] : AD; int year = isSet[YEAR] ? fields[YEAR] : 1970; if (isLenient() && isSet[MONTH]) { int month = fields[MONTH]; year += month / 12; month %= 12; if (month < 0) { month += 12; year--; } fields[MONTH] = month; isSet[YEAR] = true; fields[YEAR] = year; } if (era == BC) year = 1 - year; int[] daysOfYear = getDayOfYear(year); int hour = 0; if (isSet[HOUR_OF_DAY]) hour = fields[HOUR_OF_DAY]; else if (isSet[HOUR]) { hour = fields[HOUR]; if (isSet[AM_PM] && fields[AM_PM] == PM) if (hour != 12) /* not Noon */ hour += 12; /* Fix the problem of the status of 12:00 AM (midnight). */ if (isSet[AM_PM] && fields[AM_PM] == AM && hour == 12) hour = 0; } int minute = isSet[MINUTE] ? fields[MINUTE] : 0; int second = isSet[SECOND] ? fields[SECOND] : 0; int millis = isSet[MILLISECOND] ? fields[MILLISECOND] : 0; int millisInDay; if (isLenient()) { // prevent overflow long allMillis = (((hour * 60L) + minute) * 60L + second) * 1000L + millis; daysOfYear[1] += allMillis / (24 * 60 * 60 * 1000L); millisInDay = (int) (allMillis % (24 * 60 * 60 * 1000L)); } else { if (hour < 0 || hour >= 24 || minute < 0 || minute > 59 || second < 0 || second > 59 || millis < 0 || millis >= 1000) throw new IllegalArgumentException(); millisInDay = (((hour * 60) + minute) * 60 + second) * 1000 + millis; } time = getLinearTime(year, daysOfYear[0], millisInDay); // Add the relative days after calculating the linear time, to // get right behaviour when jumping over the gregorianCutover. time += daysOfYear[1] * (24 * 60 * 60 * 1000L); TimeZone zone = getTimeZone(); int rawOffset = isSet[ZONE_OFFSET] ? fields[ZONE_OFFSET] : zone.getRawOffset(); int day = (int) (time / (24 * 60 * 60 * 1000L)); millisInDay = (int) (time % (24 * 60 * 60 * 1000L)); if (millisInDay < 0) { millisInDay += (24 * 60 * 60 * 1000); day--; } int[] f = new int[FIELD_COUNT]; calculateDay(f, day, time - rawOffset >= gregorianCutover); year = f[YEAR]; int month = f[MONTH]; day = f[DAY_OF_MONTH]; int weekday = f[DAY_OF_WEEK]; int dstOffset = isSet[DST_OFFSET] ? fields[DST_OFFSET] : (zone.getOffset((year < 0) ? BC : AD, (year < 0) ? 1 - year : year, month, day, weekday, millisInDay) - zone.getRawOffset()); time -= rawOffset + dstOffset; isTimeSet = true; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/GregorianCalendar.java/clean/core/src/classpath/java/java/util/GregorianCalendar.java
|
int dstOffset = isSet[DST_OFFSET] ? fields[DST_OFFSET] : (zone.getOffset((year < 0) ? BC : AD, (year < 0) ? 1 - year : year, month, day, weekday, millisInDay)
|
int dstOffset = isSet[DST_OFFSET] ? fields[DST_OFFSET] : (zone.getOffset((year < 0) ? BC : AD, (year < 0) ? 1 - year : year, month, day, weekday, millisInDay)
|
protected synchronized void computeTime() { int era = isSet[ERA] ? fields[ERA] : AD; int year = isSet[YEAR] ? fields[YEAR] : 1970; if (isLenient() && isSet[MONTH]) { int month = fields[MONTH]; year += month / 12; month %= 12; if (month < 0) { month += 12; year--; } fields[MONTH] = month; isSet[YEAR] = true; fields[YEAR] = year; } if (era == BC) year = 1 - year; int[] daysOfYear = getDayOfYear(year); int hour = 0; if (isSet[HOUR_OF_DAY]) hour = fields[HOUR_OF_DAY]; else if (isSet[HOUR]) { hour = fields[HOUR]; if (isSet[AM_PM] && fields[AM_PM] == PM) if (hour != 12) /* not Noon */ hour += 12; /* Fix the problem of the status of 12:00 AM (midnight). */ if (isSet[AM_PM] && fields[AM_PM] == AM && hour == 12) hour = 0; } int minute = isSet[MINUTE] ? fields[MINUTE] : 0; int second = isSet[SECOND] ? fields[SECOND] : 0; int millis = isSet[MILLISECOND] ? fields[MILLISECOND] : 0; int millisInDay; if (isLenient()) { // prevent overflow long allMillis = (((hour * 60L) + minute) * 60L + second) * 1000L + millis; daysOfYear[1] += allMillis / (24 * 60 * 60 * 1000L); millisInDay = (int) (allMillis % (24 * 60 * 60 * 1000L)); } else { if (hour < 0 || hour >= 24 || minute < 0 || minute > 59 || second < 0 || second > 59 || millis < 0 || millis >= 1000) throw new IllegalArgumentException(); millisInDay = (((hour * 60) + minute) * 60 + second) * 1000 + millis; } time = getLinearTime(year, daysOfYear[0], millisInDay); // Add the relative days after calculating the linear time, to // get right behaviour when jumping over the gregorianCutover. time += daysOfYear[1] * (24 * 60 * 60 * 1000L); TimeZone zone = getTimeZone(); int rawOffset = isSet[ZONE_OFFSET] ? fields[ZONE_OFFSET] : zone.getRawOffset(); int day = (int) (time / (24 * 60 * 60 * 1000L)); millisInDay = (int) (time % (24 * 60 * 60 * 1000L)); if (millisInDay < 0) { millisInDay += (24 * 60 * 60 * 1000); day--; } int[] f = new int[FIELD_COUNT]; calculateDay(f, day, time - rawOffset >= gregorianCutover); year = f[YEAR]; int month = f[MONTH]; day = f[DAY_OF_MONTH]; int weekday = f[DAY_OF_WEEK]; int dstOffset = isSet[DST_OFFSET] ? fields[DST_OFFSET] : (zone.getOffset((year < 0) ? BC : AD, (year < 0) ? 1 - year : year, month, day, weekday, millisInDay) - zone.getRawOffset()); time -= rawOffset + dstOffset; isTimeSet = true; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/GregorianCalendar.java/clean/core/src/classpath/java/java/util/GregorianCalendar.java
|
if (!(o instanceof GregorianCalendar))
|
if (! (o instanceof GregorianCalendar))
|
public boolean equals(Object o) { if (!(o instanceof GregorianCalendar)) return false; GregorianCalendar cal = (GregorianCalendar) o; return (cal.getTimeInMillis() == getTimeInMillis()); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/GregorianCalendar.java/clean/core/src/classpath/java/java/util/GregorianCalendar.java
|
if (!areFieldsSet || !isSet[ERA] || !isSet[YEAR])
|
if (! areFieldsSet || ! isSet[ERA] || ! isSet[YEAR])
|
public int getActualMaximum(int field) { switch (field) { case WEEK_OF_YEAR: { if (!areFieldsSet || !isSet[ERA] || !isSet[YEAR]) complete(); // This is wrong for the year that contains the gregorian change. // I.e it gives the weeks in the julian year or in the gregorian // year in that case. int year = fields[ERA] == AD ? fields[YEAR] : 1 - fields[YEAR]; int lastDay = isLeapYear(year) ? 366 : 365; int weekday = getWeekDay(year, lastDay); int week = (lastDay + 6 - (7 + weekday - getFirstDayOfWeek()) % 7) / 7; int minimalDays = getMinimalDaysInFirstWeek(); int firstWeekday = getWeekDay(year, minimalDays); /* * Is there a set of days at the beginning of the year, before the * first day of the week, equal to or greater than the minimum number * of days required in the first week? */ if (minimalDays - (7 + firstWeekday - getFirstDayOfWeek()) % 7 < 1) return week + 1; /* Add week 1: firstWeekday through to firstDayOfWeek */ } case DAY_OF_MONTH: { if (!areFieldsSet || !isSet[MONTH]) complete(); int month = fields[MONTH]; // If you change this, you should also change // SimpleTimeZone.getDaysInMonth(); if (month == FEBRUARY) { if (!isSet[YEAR] || !isSet[ERA]) complete(); int year = fields[ERA] == AD ? fields[YEAR] : 1 - fields[YEAR]; return isLeapYear(year) ? 29 : 28; } else if (month < AUGUST) return 31 - (month & 1); else return 30 + (month & 1); } case DAY_OF_YEAR: { if (!areFieldsSet || !isSet[ERA] || !isSet[YEAR]) complete(); int year = fields[ERA] == AD ? fields[YEAR] : 1 - fields[YEAR]; return isLeapYear(year) ? 366 : 365; } case DAY_OF_WEEK_IN_MONTH: { // This is wrong for the month that contains the gregorian change. int daysInMonth = getActualMaximum(DAY_OF_MONTH); // That's black magic, I know return (daysInMonth - (fields[DAY_OF_MONTH] - 1) % 7 + 6) / 7; } case WEEK_OF_MONTH: { int daysInMonth = getActualMaximum(DAY_OF_MONTH); int weekday = (daysInMonth - fields[DAY_OF_MONTH] + fields[DAY_OF_WEEK] - SUNDAY) % 7 + SUNDAY; return (daysInMonth + 6 - (7 + weekday - getFirstDayOfWeek()) % 7) / 7; } default: return maximums[field]; } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/GregorianCalendar.java/clean/core/src/classpath/java/java/util/GregorianCalendar.java
|
int week = (lastDay + 6 - (7 + weekday - getFirstDayOfWeek()) % 7) / 7;
|
int week = (lastDay + 6 - (7 + weekday - getFirstDayOfWeek()) % 7) / 7;
|
public int getActualMaximum(int field) { switch (field) { case WEEK_OF_YEAR: { if (!areFieldsSet || !isSet[ERA] || !isSet[YEAR]) complete(); // This is wrong for the year that contains the gregorian change. // I.e it gives the weeks in the julian year or in the gregorian // year in that case. int year = fields[ERA] == AD ? fields[YEAR] : 1 - fields[YEAR]; int lastDay = isLeapYear(year) ? 366 : 365; int weekday = getWeekDay(year, lastDay); int week = (lastDay + 6 - (7 + weekday - getFirstDayOfWeek()) % 7) / 7; int minimalDays = getMinimalDaysInFirstWeek(); int firstWeekday = getWeekDay(year, minimalDays); /* * Is there a set of days at the beginning of the year, before the * first day of the week, equal to or greater than the minimum number * of days required in the first week? */ if (minimalDays - (7 + firstWeekday - getFirstDayOfWeek()) % 7 < 1) return week + 1; /* Add week 1: firstWeekday through to firstDayOfWeek */ } case DAY_OF_MONTH: { if (!areFieldsSet || !isSet[MONTH]) complete(); int month = fields[MONTH]; // If you change this, you should also change // SimpleTimeZone.getDaysInMonth(); if (month == FEBRUARY) { if (!isSet[YEAR] || !isSet[ERA]) complete(); int year = fields[ERA] == AD ? fields[YEAR] : 1 - fields[YEAR]; return isLeapYear(year) ? 29 : 28; } else if (month < AUGUST) return 31 - (month & 1); else return 30 + (month & 1); } case DAY_OF_YEAR: { if (!areFieldsSet || !isSet[ERA] || !isSet[YEAR]) complete(); int year = fields[ERA] == AD ? fields[YEAR] : 1 - fields[YEAR]; return isLeapYear(year) ? 366 : 365; } case DAY_OF_WEEK_IN_MONTH: { // This is wrong for the month that contains the gregorian change. int daysInMonth = getActualMaximum(DAY_OF_MONTH); // That's black magic, I know return (daysInMonth - (fields[DAY_OF_MONTH] - 1) % 7 + 6) / 7; } case WEEK_OF_MONTH: { int daysInMonth = getActualMaximum(DAY_OF_MONTH); int weekday = (daysInMonth - fields[DAY_OF_MONTH] + fields[DAY_OF_WEEK] - SUNDAY) % 7 + SUNDAY; return (daysInMonth + 6 - (7 + weekday - getFirstDayOfWeek()) % 7) / 7; } default: return maximums[field]; } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/GregorianCalendar.java/clean/core/src/classpath/java/java/util/GregorianCalendar.java
|
if (!areFieldsSet || !isSet[MONTH])
|
if (! areFieldsSet || ! isSet[MONTH])
|
public int getActualMaximum(int field) { switch (field) { case WEEK_OF_YEAR: { if (!areFieldsSet || !isSet[ERA] || !isSet[YEAR]) complete(); // This is wrong for the year that contains the gregorian change. // I.e it gives the weeks in the julian year or in the gregorian // year in that case. int year = fields[ERA] == AD ? fields[YEAR] : 1 - fields[YEAR]; int lastDay = isLeapYear(year) ? 366 : 365; int weekday = getWeekDay(year, lastDay); int week = (lastDay + 6 - (7 + weekday - getFirstDayOfWeek()) % 7) / 7; int minimalDays = getMinimalDaysInFirstWeek(); int firstWeekday = getWeekDay(year, minimalDays); /* * Is there a set of days at the beginning of the year, before the * first day of the week, equal to or greater than the minimum number * of days required in the first week? */ if (minimalDays - (7 + firstWeekday - getFirstDayOfWeek()) % 7 < 1) return week + 1; /* Add week 1: firstWeekday through to firstDayOfWeek */ } case DAY_OF_MONTH: { if (!areFieldsSet || !isSet[MONTH]) complete(); int month = fields[MONTH]; // If you change this, you should also change // SimpleTimeZone.getDaysInMonth(); if (month == FEBRUARY) { if (!isSet[YEAR] || !isSet[ERA]) complete(); int year = fields[ERA] == AD ? fields[YEAR] : 1 - fields[YEAR]; return isLeapYear(year) ? 29 : 28; } else if (month < AUGUST) return 31 - (month & 1); else return 30 + (month & 1); } case DAY_OF_YEAR: { if (!areFieldsSet || !isSet[ERA] || !isSet[YEAR]) complete(); int year = fields[ERA] == AD ? fields[YEAR] : 1 - fields[YEAR]; return isLeapYear(year) ? 366 : 365; } case DAY_OF_WEEK_IN_MONTH: { // This is wrong for the month that contains the gregorian change. int daysInMonth = getActualMaximum(DAY_OF_MONTH); // That's black magic, I know return (daysInMonth - (fields[DAY_OF_MONTH] - 1) % 7 + 6) / 7; } case WEEK_OF_MONTH: { int daysInMonth = getActualMaximum(DAY_OF_MONTH); int weekday = (daysInMonth - fields[DAY_OF_MONTH] + fields[DAY_OF_WEEK] - SUNDAY) % 7 + SUNDAY; return (daysInMonth + 6 - (7 + weekday - getFirstDayOfWeek()) % 7) / 7; } default: return maximums[field]; } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/GregorianCalendar.java/clean/core/src/classpath/java/java/util/GregorianCalendar.java
|
if (!isSet[YEAR] || !isSet[ERA])
|
if (! isSet[YEAR] || ! isSet[ERA])
|
public int getActualMaximum(int field) { switch (field) { case WEEK_OF_YEAR: { if (!areFieldsSet || !isSet[ERA] || !isSet[YEAR]) complete(); // This is wrong for the year that contains the gregorian change. // I.e it gives the weeks in the julian year or in the gregorian // year in that case. int year = fields[ERA] == AD ? fields[YEAR] : 1 - fields[YEAR]; int lastDay = isLeapYear(year) ? 366 : 365; int weekday = getWeekDay(year, lastDay); int week = (lastDay + 6 - (7 + weekday - getFirstDayOfWeek()) % 7) / 7; int minimalDays = getMinimalDaysInFirstWeek(); int firstWeekday = getWeekDay(year, minimalDays); /* * Is there a set of days at the beginning of the year, before the * first day of the week, equal to or greater than the minimum number * of days required in the first week? */ if (minimalDays - (7 + firstWeekday - getFirstDayOfWeek()) % 7 < 1) return week + 1; /* Add week 1: firstWeekday through to firstDayOfWeek */ } case DAY_OF_MONTH: { if (!areFieldsSet || !isSet[MONTH]) complete(); int month = fields[MONTH]; // If you change this, you should also change // SimpleTimeZone.getDaysInMonth(); if (month == FEBRUARY) { if (!isSet[YEAR] || !isSet[ERA]) complete(); int year = fields[ERA] == AD ? fields[YEAR] : 1 - fields[YEAR]; return isLeapYear(year) ? 29 : 28; } else if (month < AUGUST) return 31 - (month & 1); else return 30 + (month & 1); } case DAY_OF_YEAR: { if (!areFieldsSet || !isSet[ERA] || !isSet[YEAR]) complete(); int year = fields[ERA] == AD ? fields[YEAR] : 1 - fields[YEAR]; return isLeapYear(year) ? 366 : 365; } case DAY_OF_WEEK_IN_MONTH: { // This is wrong for the month that contains the gregorian change. int daysInMonth = getActualMaximum(DAY_OF_MONTH); // That's black magic, I know return (daysInMonth - (fields[DAY_OF_MONTH] - 1) % 7 + 6) / 7; } case WEEK_OF_MONTH: { int daysInMonth = getActualMaximum(DAY_OF_MONTH); int weekday = (daysInMonth - fields[DAY_OF_MONTH] + fields[DAY_OF_WEEK] - SUNDAY) % 7 + SUNDAY; return (daysInMonth + 6 - (7 + weekday - getFirstDayOfWeek()) % 7) / 7; } default: return maximums[field]; } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/GregorianCalendar.java/clean/core/src/classpath/java/java/util/GregorianCalendar.java
|
if (!areFieldsSet || !isSet[ERA] || !isSet[YEAR])
|
if (! areFieldsSet || ! isSet[ERA] || ! isSet[YEAR])
|
public int getActualMaximum(int field) { switch (field) { case WEEK_OF_YEAR: { if (!areFieldsSet || !isSet[ERA] || !isSet[YEAR]) complete(); // This is wrong for the year that contains the gregorian change. // I.e it gives the weeks in the julian year or in the gregorian // year in that case. int year = fields[ERA] == AD ? fields[YEAR] : 1 - fields[YEAR]; int lastDay = isLeapYear(year) ? 366 : 365; int weekday = getWeekDay(year, lastDay); int week = (lastDay + 6 - (7 + weekday - getFirstDayOfWeek()) % 7) / 7; int minimalDays = getMinimalDaysInFirstWeek(); int firstWeekday = getWeekDay(year, minimalDays); /* * Is there a set of days at the beginning of the year, before the * first day of the week, equal to or greater than the minimum number * of days required in the first week? */ if (minimalDays - (7 + firstWeekday - getFirstDayOfWeek()) % 7 < 1) return week + 1; /* Add week 1: firstWeekday through to firstDayOfWeek */ } case DAY_OF_MONTH: { if (!areFieldsSet || !isSet[MONTH]) complete(); int month = fields[MONTH]; // If you change this, you should also change // SimpleTimeZone.getDaysInMonth(); if (month == FEBRUARY) { if (!isSet[YEAR] || !isSet[ERA]) complete(); int year = fields[ERA] == AD ? fields[YEAR] : 1 - fields[YEAR]; return isLeapYear(year) ? 29 : 28; } else if (month < AUGUST) return 31 - (month & 1); else return 30 + (month & 1); } case DAY_OF_YEAR: { if (!areFieldsSet || !isSet[ERA] || !isSet[YEAR]) complete(); int year = fields[ERA] == AD ? fields[YEAR] : 1 - fields[YEAR]; return isLeapYear(year) ? 366 : 365; } case DAY_OF_WEEK_IN_MONTH: { // This is wrong for the month that contains the gregorian change. int daysInMonth = getActualMaximum(DAY_OF_MONTH); // That's black magic, I know return (daysInMonth - (fields[DAY_OF_MONTH] - 1) % 7 + 6) / 7; } case WEEK_OF_MONTH: { int daysInMonth = getActualMaximum(DAY_OF_MONTH); int weekday = (daysInMonth - fields[DAY_OF_MONTH] + fields[DAY_OF_WEEK] - SUNDAY) % 7 + SUNDAY; return (daysInMonth + 6 - (7 + weekday - getFirstDayOfWeek()) % 7) / 7; } default: return maximums[field]; } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/GregorianCalendar.java/clean/core/src/classpath/java/java/util/GregorianCalendar.java
|
return (daysInMonth + 6 - (7 + weekday - getFirstDayOfWeek()) % 7) / 7;
|
return (daysInMonth + 6 - (7 + weekday - getFirstDayOfWeek()) % 7) / 7;
|
public int getActualMaximum(int field) { switch (field) { case WEEK_OF_YEAR: { if (!areFieldsSet || !isSet[ERA] || !isSet[YEAR]) complete(); // This is wrong for the year that contains the gregorian change. // I.e it gives the weeks in the julian year or in the gregorian // year in that case. int year = fields[ERA] == AD ? fields[YEAR] : 1 - fields[YEAR]; int lastDay = isLeapYear(year) ? 366 : 365; int weekday = getWeekDay(year, lastDay); int week = (lastDay + 6 - (7 + weekday - getFirstDayOfWeek()) % 7) / 7; int minimalDays = getMinimalDaysInFirstWeek(); int firstWeekday = getWeekDay(year, minimalDays); /* * Is there a set of days at the beginning of the year, before the * first day of the week, equal to or greater than the minimum number * of days required in the first week? */ if (minimalDays - (7 + firstWeekday - getFirstDayOfWeek()) % 7 < 1) return week + 1; /* Add week 1: firstWeekday through to firstDayOfWeek */ } case DAY_OF_MONTH: { if (!areFieldsSet || !isSet[MONTH]) complete(); int month = fields[MONTH]; // If you change this, you should also change // SimpleTimeZone.getDaysInMonth(); if (month == FEBRUARY) { if (!isSet[YEAR] || !isSet[ERA]) complete(); int year = fields[ERA] == AD ? fields[YEAR] : 1 - fields[YEAR]; return isLeapYear(year) ? 29 : 28; } else if (month < AUGUST) return 31 - (month & 1); else return 30 + (month & 1); } case DAY_OF_YEAR: { if (!areFieldsSet || !isSet[ERA] || !isSet[YEAR]) complete(); int year = fields[ERA] == AD ? fields[YEAR] : 1 - fields[YEAR]; return isLeapYear(year) ? 366 : 365; } case DAY_OF_WEEK_IN_MONTH: { // This is wrong for the month that contains the gregorian change. int daysInMonth = getActualMaximum(DAY_OF_MONTH); // That's black magic, I know return (daysInMonth - (fields[DAY_OF_MONTH] - 1) % 7 + 6) / 7; } case WEEK_OF_MONTH: { int daysInMonth = getActualMaximum(DAY_OF_MONTH); int weekday = (daysInMonth - fields[DAY_OF_MONTH] + fields[DAY_OF_WEEK] - SUNDAY) % 7 + SUNDAY; return (daysInMonth + 6 - (7 + weekday - getFirstDayOfWeek()) % 7) / 7; } default: return maximums[field]; } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/GregorianCalendar.java/clean/core/src/classpath/java/java/util/GregorianCalendar.java
|
if (!areFieldsSet || !isSet[ERA] || !isSet[YEAR])
|
if (! areFieldsSet || ! isSet[ERA] || ! isSet[YEAR])
|
public int getActualMinimum(int field) { if (field == WEEK_OF_YEAR) { int min = getMinimalDaysInFirstWeek(); if (min == 0) return 1; if (!areFieldsSet || !isSet[ERA] || !isSet[YEAR]) complete(); int year = fields[ERA] == AD ? fields[YEAR] : 1 - fields[YEAR]; int weekday = getWeekDay(year, min); if ((7 + weekday - getFirstDayOfWeek()) % 7 >= min - 1) return 1; return 0; } return minimums[field]; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/GregorianCalendar.java/clean/core/src/classpath/java/java/util/GregorianCalendar.java
|
private int[] getDayOfYear(int year) { if (isSet[MONTH]) { int dayOfYear; if (fields[MONTH] > FEBRUARY) { // The months after February are regular: // 9 is an offset found by try and error. dayOfYear = (fields[MONTH] * (31 + 30 + 31 + 30 + 31) - 9) / 5; if (isLeapYear(year)) dayOfYear++; } else dayOfYear = 31 * fields[MONTH]; if (isSet[DAY_OF_MONTH]) { return new int[] { dayOfYear + fields[DAY_OF_MONTH], 0}; } if (isSet[WEEK_OF_MONTH] && isSet[DAY_OF_WEEK]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday + // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. 7 * (fields[WEEK_OF_MONTH] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } if (isSet[DAY_OF_WEEK] && isSet[DAY_OF_WEEK_IN_MONTH]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, fields[DAY_OF_WEEK] - weekday + 7 * (fields[DAY_OF_WEEK_IN_MONTH] + (fields[DAY_OF_WEEK] < weekday ? 0 : -1))}; } } // MONTH + something did not succeed. if (isSet[DAY_OF_YEAR]) { return new int[] {0, fields[DAY_OF_YEAR]}; } if (isSet[DAY_OF_WEEK] && isSet[WEEK_OF_YEAR]) { int dayOfYear = getMinimalDaysInFirstWeek(); // the weekday of the day, that begins the first week // in that year is: int weekday = getWeekDay(year, dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. + 7 * (fields[WEEK_OF_YEAR] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } // As last resort return Jan, 1st. return new int[] {1, 0}; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/GregorianCalendar.java/clean/core/src/classpath/java/java/util/GregorianCalendar.java
|
||
{ return new int[] { dayOfYear + fields[DAY_OF_MONTH], 0}; }
|
return new int[] { dayOfYear + fields[DAY_OF_MONTH], 0 };
|
private int[] getDayOfYear(int year) { if (isSet[MONTH]) { int dayOfYear; if (fields[MONTH] > FEBRUARY) { // The months after February are regular: // 9 is an offset found by try and error. dayOfYear = (fields[MONTH] * (31 + 30 + 31 + 30 + 31) - 9) / 5; if (isLeapYear(year)) dayOfYear++; } else dayOfYear = 31 * fields[MONTH]; if (isSet[DAY_OF_MONTH]) { return new int[] { dayOfYear + fields[DAY_OF_MONTH], 0}; } if (isSet[WEEK_OF_MONTH] && isSet[DAY_OF_WEEK]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday + // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. 7 * (fields[WEEK_OF_MONTH] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } if (isSet[DAY_OF_WEEK] && isSet[DAY_OF_WEEK_IN_MONTH]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, fields[DAY_OF_WEEK] - weekday + 7 * (fields[DAY_OF_WEEK_IN_MONTH] + (fields[DAY_OF_WEEK] < weekday ? 0 : -1))}; } } // MONTH + something did not succeed. if (isSet[DAY_OF_YEAR]) { return new int[] {0, fields[DAY_OF_YEAR]}; } if (isSet[DAY_OF_WEEK] && isSet[WEEK_OF_YEAR]) { int dayOfYear = getMinimalDaysInFirstWeek(); // the weekday of the day, that begins the first week // in that year is: int weekday = getWeekDay(year, dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. + 7 * (fields[WEEK_OF_YEAR] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } // As last resort return Jan, 1st. return new int[] {1, 0}; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/GregorianCalendar.java/clean/core/src/classpath/java/java/util/GregorianCalendar.java
|
fields[DAY_OF_WEEK] - weekday +
|
fields[DAY_OF_WEEK] - weekday +
|
private int[] getDayOfYear(int year) { if (isSet[MONTH]) { int dayOfYear; if (fields[MONTH] > FEBRUARY) { // The months after February are regular: // 9 is an offset found by try and error. dayOfYear = (fields[MONTH] * (31 + 30 + 31 + 30 + 31) - 9) / 5; if (isLeapYear(year)) dayOfYear++; } else dayOfYear = 31 * fields[MONTH]; if (isSet[DAY_OF_MONTH]) { return new int[] { dayOfYear + fields[DAY_OF_MONTH], 0}; } if (isSet[WEEK_OF_MONTH] && isSet[DAY_OF_WEEK]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday + // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. 7 * (fields[WEEK_OF_MONTH] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } if (isSet[DAY_OF_WEEK] && isSet[DAY_OF_WEEK_IN_MONTH]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, fields[DAY_OF_WEEK] - weekday + 7 * (fields[DAY_OF_WEEK_IN_MONTH] + (fields[DAY_OF_WEEK] < weekday ? 0 : -1))}; } } // MONTH + something did not succeed. if (isSet[DAY_OF_YEAR]) { return new int[] {0, fields[DAY_OF_YEAR]}; } if (isSet[DAY_OF_WEEK] && isSet[WEEK_OF_YEAR]) { int dayOfYear = getMinimalDaysInFirstWeek(); // the weekday of the day, that begins the first week // in that year is: int weekday = getWeekDay(year, dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. + 7 * (fields[WEEK_OF_YEAR] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } // As last resort return Jan, 1st. return new int[] {1, 0}; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/GregorianCalendar.java/clean/core/src/classpath/java/java/util/GregorianCalendar.java
|
+ (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))};
|
+ (fields[DAY_OF_WEEK] < getFirstDayOfWeek() ? 0 : -1) + (weekday < getFirstDayOfWeek() ? -1 : 0)) };
|
private int[] getDayOfYear(int year) { if (isSet[MONTH]) { int dayOfYear; if (fields[MONTH] > FEBRUARY) { // The months after February are regular: // 9 is an offset found by try and error. dayOfYear = (fields[MONTH] * (31 + 30 + 31 + 30 + 31) - 9) / 5; if (isLeapYear(year)) dayOfYear++; } else dayOfYear = 31 * fields[MONTH]; if (isSet[DAY_OF_MONTH]) { return new int[] { dayOfYear + fields[DAY_OF_MONTH], 0}; } if (isSet[WEEK_OF_MONTH] && isSet[DAY_OF_WEEK]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday + // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. 7 * (fields[WEEK_OF_MONTH] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } if (isSet[DAY_OF_WEEK] && isSet[DAY_OF_WEEK_IN_MONTH]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, fields[DAY_OF_WEEK] - weekday + 7 * (fields[DAY_OF_WEEK_IN_MONTH] + (fields[DAY_OF_WEEK] < weekday ? 0 : -1))}; } } // MONTH + something did not succeed. if (isSet[DAY_OF_YEAR]) { return new int[] {0, fields[DAY_OF_YEAR]}; } if (isSet[DAY_OF_WEEK] && isSet[WEEK_OF_YEAR]) { int dayOfYear = getMinimalDaysInFirstWeek(); // the weekday of the day, that begins the first week // in that year is: int weekday = getWeekDay(year, dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. + 7 * (fields[WEEK_OF_YEAR] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } // As last resort return Jan, 1st. return new int[] {1, 0}; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/GregorianCalendar.java/clean/core/src/classpath/java/java/util/GregorianCalendar.java
|
return new int[] {
|
return new int[] {
|
private int[] getDayOfYear(int year) { if (isSet[MONTH]) { int dayOfYear; if (fields[MONTH] > FEBRUARY) { // The months after February are regular: // 9 is an offset found by try and error. dayOfYear = (fields[MONTH] * (31 + 30 + 31 + 30 + 31) - 9) / 5; if (isLeapYear(year)) dayOfYear++; } else dayOfYear = 31 * fields[MONTH]; if (isSet[DAY_OF_MONTH]) { return new int[] { dayOfYear + fields[DAY_OF_MONTH], 0}; } if (isSet[WEEK_OF_MONTH] && isSet[DAY_OF_WEEK]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday + // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. 7 * (fields[WEEK_OF_MONTH] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } if (isSet[DAY_OF_WEEK] && isSet[DAY_OF_WEEK_IN_MONTH]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, fields[DAY_OF_WEEK] - weekday + 7 * (fields[DAY_OF_WEEK_IN_MONTH] + (fields[DAY_OF_WEEK] < weekday ? 0 : -1))}; } } // MONTH + something did not succeed. if (isSet[DAY_OF_YEAR]) { return new int[] {0, fields[DAY_OF_YEAR]}; } if (isSet[DAY_OF_WEEK] && isSet[WEEK_OF_YEAR]) { int dayOfYear = getMinimalDaysInFirstWeek(); // the weekday of the day, that begins the first week // in that year is: int weekday = getWeekDay(year, dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. + 7 * (fields[WEEK_OF_YEAR] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } // As last resort return Jan, 1st. return new int[] {1, 0}; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/GregorianCalendar.java/clean/core/src/classpath/java/java/util/GregorianCalendar.java
|
fields[DAY_OF_WEEK] - weekday + 7 * (fields[DAY_OF_WEEK_IN_MONTH] + (fields[DAY_OF_WEEK] < weekday ? 0 : -1))};
|
fields[DAY_OF_WEEK] - weekday + 7 * (fields[DAY_OF_WEEK_IN_MONTH] + (fields[DAY_OF_WEEK] < weekday ? 0 : -1)) };
|
private int[] getDayOfYear(int year) { if (isSet[MONTH]) { int dayOfYear; if (fields[MONTH] > FEBRUARY) { // The months after February are regular: // 9 is an offset found by try and error. dayOfYear = (fields[MONTH] * (31 + 30 + 31 + 30 + 31) - 9) / 5; if (isLeapYear(year)) dayOfYear++; } else dayOfYear = 31 * fields[MONTH]; if (isSet[DAY_OF_MONTH]) { return new int[] { dayOfYear + fields[DAY_OF_MONTH], 0}; } if (isSet[WEEK_OF_MONTH] && isSet[DAY_OF_WEEK]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday + // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. 7 * (fields[WEEK_OF_MONTH] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } if (isSet[DAY_OF_WEEK] && isSet[DAY_OF_WEEK_IN_MONTH]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, fields[DAY_OF_WEEK] - weekday + 7 * (fields[DAY_OF_WEEK_IN_MONTH] + (fields[DAY_OF_WEEK] < weekday ? 0 : -1))}; } } // MONTH + something did not succeed. if (isSet[DAY_OF_YEAR]) { return new int[] {0, fields[DAY_OF_YEAR]}; } if (isSet[DAY_OF_WEEK] && isSet[WEEK_OF_YEAR]) { int dayOfYear = getMinimalDaysInFirstWeek(); // the weekday of the day, that begins the first week // in that year is: int weekday = getWeekDay(year, dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. + 7 * (fields[WEEK_OF_YEAR] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } // As last resort return Jan, 1st. return new int[] {1, 0}; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/GregorianCalendar.java/clean/core/src/classpath/java/java/util/GregorianCalendar.java
|
{ return new int[] {0, fields[DAY_OF_YEAR]}; }
|
return new int[] { 0, fields[DAY_OF_YEAR] };
|
private int[] getDayOfYear(int year) { if (isSet[MONTH]) { int dayOfYear; if (fields[MONTH] > FEBRUARY) { // The months after February are regular: // 9 is an offset found by try and error. dayOfYear = (fields[MONTH] * (31 + 30 + 31 + 30 + 31) - 9) / 5; if (isLeapYear(year)) dayOfYear++; } else dayOfYear = 31 * fields[MONTH]; if (isSet[DAY_OF_MONTH]) { return new int[] { dayOfYear + fields[DAY_OF_MONTH], 0}; } if (isSet[WEEK_OF_MONTH] && isSet[DAY_OF_WEEK]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday + // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. 7 * (fields[WEEK_OF_MONTH] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } if (isSet[DAY_OF_WEEK] && isSet[DAY_OF_WEEK_IN_MONTH]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, fields[DAY_OF_WEEK] - weekday + 7 * (fields[DAY_OF_WEEK_IN_MONTH] + (fields[DAY_OF_WEEK] < weekday ? 0 : -1))}; } } // MONTH + something did not succeed. if (isSet[DAY_OF_YEAR]) { return new int[] {0, fields[DAY_OF_YEAR]}; } if (isSet[DAY_OF_WEEK] && isSet[WEEK_OF_YEAR]) { int dayOfYear = getMinimalDaysInFirstWeek(); // the weekday of the day, that begins the first week // in that year is: int weekday = getWeekDay(year, dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. + 7 * (fields[WEEK_OF_YEAR] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } // As last resort return Jan, 1st. return new int[] {1, 0}; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/GregorianCalendar.java/clean/core/src/classpath/java/java/util/GregorianCalendar.java
|
return new int[] {
|
return new int[] {
|
private int[] getDayOfYear(int year) { if (isSet[MONTH]) { int dayOfYear; if (fields[MONTH] > FEBRUARY) { // The months after February are regular: // 9 is an offset found by try and error. dayOfYear = (fields[MONTH] * (31 + 30 + 31 + 30 + 31) - 9) / 5; if (isLeapYear(year)) dayOfYear++; } else dayOfYear = 31 * fields[MONTH]; if (isSet[DAY_OF_MONTH]) { return new int[] { dayOfYear + fields[DAY_OF_MONTH], 0}; } if (isSet[WEEK_OF_MONTH] && isSet[DAY_OF_WEEK]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday + // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. 7 * (fields[WEEK_OF_MONTH] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } if (isSet[DAY_OF_WEEK] && isSet[DAY_OF_WEEK_IN_MONTH]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, fields[DAY_OF_WEEK] - weekday + 7 * (fields[DAY_OF_WEEK_IN_MONTH] + (fields[DAY_OF_WEEK] < weekday ? 0 : -1))}; } } // MONTH + something did not succeed. if (isSet[DAY_OF_YEAR]) { return new int[] {0, fields[DAY_OF_YEAR]}; } if (isSet[DAY_OF_WEEK] && isSet[WEEK_OF_YEAR]) { int dayOfYear = getMinimalDaysInFirstWeek(); // the weekday of the day, that begins the first week // in that year is: int weekday = getWeekDay(year, dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. + 7 * (fields[WEEK_OF_YEAR] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } // As last resort return Jan, 1st. return new int[] {1, 0}; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/GregorianCalendar.java/clean/core/src/classpath/java/java/util/GregorianCalendar.java
|
+ (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))};
|
+ (fields[DAY_OF_WEEK] < getFirstDayOfWeek() ? 0 : -1) + (weekday < getFirstDayOfWeek() ? -1 : 0)) };
|
private int[] getDayOfYear(int year) { if (isSet[MONTH]) { int dayOfYear; if (fields[MONTH] > FEBRUARY) { // The months after February are regular: // 9 is an offset found by try and error. dayOfYear = (fields[MONTH] * (31 + 30 + 31 + 30 + 31) - 9) / 5; if (isLeapYear(year)) dayOfYear++; } else dayOfYear = 31 * fields[MONTH]; if (isSet[DAY_OF_MONTH]) { return new int[] { dayOfYear + fields[DAY_OF_MONTH], 0}; } if (isSet[WEEK_OF_MONTH] && isSet[DAY_OF_WEEK]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday + // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. 7 * (fields[WEEK_OF_MONTH] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } if (isSet[DAY_OF_WEEK] && isSet[DAY_OF_WEEK_IN_MONTH]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, fields[DAY_OF_WEEK] - weekday + 7 * (fields[DAY_OF_WEEK_IN_MONTH] + (fields[DAY_OF_WEEK] < weekday ? 0 : -1))}; } } // MONTH + something did not succeed. if (isSet[DAY_OF_YEAR]) { return new int[] {0, fields[DAY_OF_YEAR]}; } if (isSet[DAY_OF_WEEK] && isSet[WEEK_OF_YEAR]) { int dayOfYear = getMinimalDaysInFirstWeek(); // the weekday of the day, that begins the first week // in that year is: int weekday = getWeekDay(year, dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. + 7 * (fields[WEEK_OF_YEAR] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } // As last resort return Jan, 1st. return new int[] {1, 0}; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/GregorianCalendar.java/clean/core/src/classpath/java/java/util/GregorianCalendar.java
|
return new int[] {1, 0};
|
return new int[] { 1, 0 };
|
private int[] getDayOfYear(int year) { if (isSet[MONTH]) { int dayOfYear; if (fields[MONTH] > FEBRUARY) { // The months after February are regular: // 9 is an offset found by try and error. dayOfYear = (fields[MONTH] * (31 + 30 + 31 + 30 + 31) - 9) / 5; if (isLeapYear(year)) dayOfYear++; } else dayOfYear = 31 * fields[MONTH]; if (isSet[DAY_OF_MONTH]) { return new int[] { dayOfYear + fields[DAY_OF_MONTH], 0}; } if (isSet[WEEK_OF_MONTH] && isSet[DAY_OF_WEEK]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday + // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. 7 * (fields[WEEK_OF_MONTH] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } if (isSet[DAY_OF_WEEK] && isSet[DAY_OF_WEEK_IN_MONTH]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, fields[DAY_OF_WEEK] - weekday + 7 * (fields[DAY_OF_WEEK_IN_MONTH] + (fields[DAY_OF_WEEK] < weekday ? 0 : -1))}; } } // MONTH + something did not succeed. if (isSet[DAY_OF_YEAR]) { return new int[] {0, fields[DAY_OF_YEAR]}; } if (isSet[DAY_OF_WEEK] && isSet[WEEK_OF_YEAR]) { int dayOfYear = getMinimalDaysInFirstWeek(); // the weekday of the day, that begins the first week // in that year is: int weekday = getWeekDay(year, dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. + 7 * (fields[WEEK_OF_YEAR] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } // As last resort return Jan, 1st. return new int[] {1, 0}; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/GregorianCalendar.java/clean/core/src/classpath/java/java/util/GregorianCalendar.java
|
long julianDay = ((year * (365L * 4 + 1)) >> 2) + dayOfYear - ((1970 * (365 * 4 + 1)) / 4 + 1 - 13);
|
long julianDay = ((year * (365L * 4 + 1)) >> 2) + dayOfYear - ((1970 * (365 * 4 + 1)) / 4 + 1 - 13);
|
private long getLinearDay(int year, int dayOfYear, boolean gregorian) { // The 13 is the number of days, that were omitted in the Gregorian // Calender until the epoch. // We shift right by 2 instead of dividing by 4, to get correct // results for negative years (and this is even more efficient). long julianDay = ((year * (365L * 4 + 1)) >> 2) + dayOfYear - ((1970 * (365 * 4 + 1)) / 4 + 1 - 13); if (gregorian) { // subtract the days that are missing in gregorian calendar // with respect to julian calendar. // // Okay, here we rely on the fact that the gregorian // calendar was introduced in the AD era. This doesn't work // with negative years. // // The additional leap year factor accounts for the fact that // a leap day is not seen on Jan 1 of the leap year. int gregOffset = (year / 400) - (year / 100) + 2; if (isLeapYear (year, true) && dayOfYear < 31 + 29) --gregOffset; julianDay += gregOffset; } return julianDay; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/GregorianCalendar.java/clean/core/src/classpath/java/java/util/GregorianCalendar.java
|
if (isLeapYear (year, true) && dayOfYear < 31 + 29)
|
if (isLeapYear(year, true) && dayOfYear < 31 + 29)
|
private long getLinearDay(int year, int dayOfYear, boolean gregorian) { // The 13 is the number of days, that were omitted in the Gregorian // Calender until the epoch. // We shift right by 2 instead of dividing by 4, to get correct // results for negative years (and this is even more efficient). long julianDay = ((year * (365L * 4 + 1)) >> 2) + dayOfYear - ((1970 * (365 * 4 + 1)) / 4 + 1 - 13); if (gregorian) { // subtract the days that are missing in gregorian calendar // with respect to julian calendar. // // Okay, here we rely on the fact that the gregorian // calendar was introduced in the AD era. This doesn't work // with negative years. // // The additional leap year factor accounts for the fact that // a leap day is not seen on Jan 1 of the leap year. int gregOffset = (year / 400) - (year / 100) + 2; if (isLeapYear (year, true) && dayOfYear < 31 + 29) --gregOffset; julianDay += gregOffset; } return julianDay; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/GregorianCalendar.java/clean/core/src/classpath/java/java/util/GregorianCalendar.java
|
int julianDay = ((year * (365 * 4 + 1)) >> 2) + dayOfYear - ((1970 * (365 * 4 + 1)) / 4 + 1 - 13);
|
int julianDay = ((year * (365 * 4 + 1)) >> 2) + dayOfYear - ((1970 * (365 * 4 + 1)) / 4 + 1 - 13);
|
private long getLinearTime(int year, int dayOfYear, int millis) { // The 13 is the number of days, that were omitted in the Gregorian // Calendar until the epoch. // We shift right by 2 instead of dividing by 4, to get correct // results for negative years (and this is even more efficient). int julianDay = ((year * (365 * 4 + 1)) >> 2) + dayOfYear - ((1970 * (365 * 4 + 1)) / 4 + 1 - 13); long time = julianDay * (24 * 60 * 60 * 1000L) + millis; if (time >= gregorianCutover) { // subtract the days that are missing in gregorian calendar // with respect to julian calendar. // // Okay, here we rely on the fact that the gregorian // calendar was introduced in the AD era. This doesn't work // with negative years. // // The additional leap year factor accounts for the fact that // a leap day is not seen on Jan 1 of the leap year. // And on and after the leap day, the leap day has already been // included in dayOfYear. int gregOffset = (year / 400) - (year / 100) + 2; if (isLeapYear (year, true)) --gregOffset; time += gregOffset * (24 * 60 * 60 * 1000L); } return time; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/GregorianCalendar.java/clean/core/src/classpath/java/java/util/GregorianCalendar.java
|
if (isLeapYear (year, true))
|
if (isLeapYear(year, true))
|
private long getLinearTime(int year, int dayOfYear, int millis) { // The 13 is the number of days, that were omitted in the Gregorian // Calendar until the epoch. // We shift right by 2 instead of dividing by 4, to get correct // results for negative years (and this is even more efficient). int julianDay = ((year * (365 * 4 + 1)) >> 2) + dayOfYear - ((1970 * (365 * 4 + 1)) / 4 + 1 - 13); long time = julianDay * (24 * 60 * 60 * 1000L) + millis; if (time >= gregorianCutover) { // subtract the days that are missing in gregorian calendar // with respect to julian calendar. // // Okay, here we rely on the fact that the gregorian // calendar was introduced in the AD era. This doesn't work // with negative years. // // The additional leap year factor accounts for the fact that // a leap day is not seen on Jan 1 of the leap year. // And on and after the leap day, the leap day has already been // included in dayOfYear. int gregOffset = (year / 400) - (year / 100) + 2; if (isLeapYear (year, true)) --gregOffset; time += gregOffset * (24 * 60 * 60 * 1000L); } return time; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/GregorianCalendar.java/clean/core/src/classpath/java/java/util/GregorianCalendar.java
|
int day = (int) (getLinearTime(year, dayOfYear, 0) / (24 * 60 * 60 * 1000L));
|
int day = (int) (getLinearTime(year, dayOfYear, 0) / (24 * 60 * 60 * 1000L));
|
private int getWeekDay(int year, int dayOfYear) { int day = (int) (getLinearTime(year, dayOfYear, 0) / (24 * 60 * 60 * 1000L)); // The epoch was a thursday. int weekday = (day + THURSDAY) % 7; if (weekday <= 0) weekday += 7; return weekday; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/GregorianCalendar.java/clean/core/src/classpath/java/java/util/GregorianCalendar.java
|
int julianDay = (((year-1) * (365*4+1)) >> 2) + (31+29 - (((1970-1) * (365*4+1)) / 4 + 1 - 13));
|
int julianDay = (((year - 1) * (365 * 4 + 1)) >> 2) + (31 + 29 - (((1970 - 1) * (365 * 4 + 1)) / 4 + 1 - 13));
|
public boolean isLeapYear(int year) { if ((year & 3) != 0) // Only years divisible by 4 can be leap years return false; // compute the linear day of the 29. February of that year. // The 13 is the number of days, that were omitted in the Gregorian // Calender until the epoch. int julianDay = (((year-1) * (365*4+1)) >> 2) + (31+29 - (((1970-1) * (365*4+1)) / 4 + 1 - 13)); // If that day is smaller than the gregorianChange the julian // rule applies: This is a leap year since it is divisible by 4. if (julianDay * (24 * 60 * 60 * 1000L) < gregorianCutover) return true; return ((year % 100) != 0 || (year % 400) == 0); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/GregorianCalendar.java/clean/core/src/classpath/java/java/util/GregorianCalendar.java
|
updateLayoutStateNeeded |= modelChanged;
|
public void contentsChanged(ListDataEvent e) { list.revalidate(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/BasicListUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicListUI.java
|
|
updateLayoutStateNeeded |= modelChanged;
|
public void intervalAdded(ListDataEvent e) { list.revalidate(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/BasicListUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicListUI.java
|
|
updateLayoutStateNeeded |= modelChanged;
|
public void intervalRemoved(ListDataEvent e) { list.revalidate(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/BasicListUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicListUI.java
|
|
if (e.getSource() == BasicListUI.this.list)
|
if (e.getPropertyName().equals("model"))
|
public void propertyChange(PropertyChangeEvent e) { if (e.getSource() == BasicListUI.this.list) { if (e.getOldValue() != null && e.getOldValue() instanceof ListModel) ((ListModel) e.getOldValue()).removeListDataListener(BasicListUI.this.listDataListener); if (e.getNewValue() != null && e.getNewValue() instanceof ListModel) ((ListModel) e.getNewValue()).addListDataListener(BasicListUI.this.listDataListener); } // Update the updateLayoutStateNeeded flag. if (e.getPropertyName().equals("model")) updateLayoutStateNeeded |= modelChanged; else if (e.getPropertyName().equals("selectionModel")) updateLayoutStateNeeded |= selectionModelChanged; else if (e.getPropertyName().equals("font")) updateLayoutStateNeeded |= fontChanged; else if (e.getPropertyName().equals("fixedCellWidth")) updateLayoutStateNeeded |= fixedCellWidthChanged; else if (e.getPropertyName().equals("fixedCellHeight")) updateLayoutStateNeeded |= fixedCellHeightChanged; else if (e.getPropertyName().equals("prototypeCellValue")) updateLayoutStateNeeded |= prototypeCellValueChanged; else if (e.getPropertyName().equals("cellRenderer")) updateLayoutStateNeeded |= cellRendererChanged; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/BasicListUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicListUI.java
|
((ListModel) e.getOldValue()).removeListDataListener(BasicListUI.this.listDataListener);
|
{ ListModel oldModel = (ListModel) e.getOldValue(); oldModel.removeListDataListener(listDataListener); } if (e.getNewValue() != null && e.getNewValue() instanceof ListModel) { ListModel newModel = (ListModel) e.getNewValue(); newModel.addListDataListener(BasicListUI.this.listDataListener); }
|
public void propertyChange(PropertyChangeEvent e) { if (e.getSource() == BasicListUI.this.list) { if (e.getOldValue() != null && e.getOldValue() instanceof ListModel) ((ListModel) e.getOldValue()).removeListDataListener(BasicListUI.this.listDataListener); if (e.getNewValue() != null && e.getNewValue() instanceof ListModel) ((ListModel) e.getNewValue()).addListDataListener(BasicListUI.this.listDataListener); } // Update the updateLayoutStateNeeded flag. if (e.getPropertyName().equals("model")) updateLayoutStateNeeded |= modelChanged; else if (e.getPropertyName().equals("selectionModel")) updateLayoutStateNeeded |= selectionModelChanged; else if (e.getPropertyName().equals("font")) updateLayoutStateNeeded |= fontChanged; else if (e.getPropertyName().equals("fixedCellWidth")) updateLayoutStateNeeded |= fixedCellWidthChanged; else if (e.getPropertyName().equals("fixedCellHeight")) updateLayoutStateNeeded |= fixedCellHeightChanged; else if (e.getPropertyName().equals("prototypeCellValue")) updateLayoutStateNeeded |= prototypeCellValueChanged; else if (e.getPropertyName().equals("cellRenderer")) updateLayoutStateNeeded |= cellRendererChanged; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/BasicListUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicListUI.java
|
if (e.getNewValue() != null && e.getNewValue() instanceof ListModel) ((ListModel) e.getNewValue()).addListDataListener(BasicListUI.this.listDataListener);
|
updateLayoutStateNeeded |= modelChanged;
|
public void propertyChange(PropertyChangeEvent e) { if (e.getSource() == BasicListUI.this.list) { if (e.getOldValue() != null && e.getOldValue() instanceof ListModel) ((ListModel) e.getOldValue()).removeListDataListener(BasicListUI.this.listDataListener); if (e.getNewValue() != null && e.getNewValue() instanceof ListModel) ((ListModel) e.getNewValue()).addListDataListener(BasicListUI.this.listDataListener); } // Update the updateLayoutStateNeeded flag. if (e.getPropertyName().equals("model")) updateLayoutStateNeeded |= modelChanged; else if (e.getPropertyName().equals("selectionModel")) updateLayoutStateNeeded |= selectionModelChanged; else if (e.getPropertyName().equals("font")) updateLayoutStateNeeded |= fontChanged; else if (e.getPropertyName().equals("fixedCellWidth")) updateLayoutStateNeeded |= fixedCellWidthChanged; else if (e.getPropertyName().equals("fixedCellHeight")) updateLayoutStateNeeded |= fixedCellHeightChanged; else if (e.getPropertyName().equals("prototypeCellValue")) updateLayoutStateNeeded |= prototypeCellValueChanged; else if (e.getPropertyName().equals("cellRenderer")) updateLayoutStateNeeded |= cellRendererChanged; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/BasicListUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicListUI.java
|
if (e.getPropertyName().equals("model")) updateLayoutStateNeeded |= modelChanged;
|
public void propertyChange(PropertyChangeEvent e) { if (e.getSource() == BasicListUI.this.list) { if (e.getOldValue() != null && e.getOldValue() instanceof ListModel) ((ListModel) e.getOldValue()).removeListDataListener(BasicListUI.this.listDataListener); if (e.getNewValue() != null && e.getNewValue() instanceof ListModel) ((ListModel) e.getNewValue()).addListDataListener(BasicListUI.this.listDataListener); } // Update the updateLayoutStateNeeded flag. if (e.getPropertyName().equals("model")) updateLayoutStateNeeded |= modelChanged; else if (e.getPropertyName().equals("selectionModel")) updateLayoutStateNeeded |= selectionModelChanged; else if (e.getPropertyName().equals("font")) updateLayoutStateNeeded |= fontChanged; else if (e.getPropertyName().equals("fixedCellWidth")) updateLayoutStateNeeded |= fixedCellWidthChanged; else if (e.getPropertyName().equals("fixedCellHeight")) updateLayoutStateNeeded |= fixedCellHeightChanged; else if (e.getPropertyName().equals("prototypeCellValue")) updateLayoutStateNeeded |= prototypeCellValueChanged; else if (e.getPropertyName().equals("cellRenderer")) updateLayoutStateNeeded |= cellRendererChanged; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/BasicListUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicListUI.java
|
|
Rectangle bounds = new Rectangle(loc.x, loc.y, cellWidth,
|
int width = cellWidth; if (l.getLayoutOrientation() == JList.VERTICAL) width = l.getWidth(); Rectangle bounds = new Rectangle(loc.x, loc.y, width,
|
public Rectangle getCellBounds(JList l, int index1, int index2) { maybeUpdateLayoutState(); if (l != list || cellWidth == -1) return null; int minIndex = Math.min(index1, index2); int maxIndex = Math.max(index1, index2); Point loc = indexToLocation(list, minIndex); Rectangle bounds = new Rectangle(loc.x, loc.y, cellWidth, getCellHeight(minIndex)); for (int i = minIndex + 1; i <= maxIndex; i++) { Point hiLoc = indexToLocation(list, i); Rectangle hibounds = new Rectangle(hiLoc.x, hiLoc.y, cellWidth, getCellHeight(i)); bounds = bounds.union(hibounds); } return bounds; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/BasicListUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicListUI.java
|
Rectangle hibounds = new Rectangle(hiLoc.x, hiLoc.y, cellWidth,
|
Rectangle hibounds = new Rectangle(hiLoc.x, hiLoc.y, width,
|
public Rectangle getCellBounds(JList l, int index1, int index2) { maybeUpdateLayoutState(); if (l != list || cellWidth == -1) return null; int minIndex = Math.min(index1, index2); int maxIndex = Math.max(index1, index2); Point loc = indexToLocation(list, minIndex); Rectangle bounds = new Rectangle(loc.x, loc.y, cellWidth, getCellHeight(minIndex)); for (int i = minIndex + 1; i <= maxIndex; i++) { Point hiLoc = indexToLocation(list, i); Rectangle hibounds = new Rectangle(hiLoc.x, hiLoc.y, cellWidth, getCellHeight(i)); bounds = bounds.union(hibounds); } return bounds; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/BasicListUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicListUI.java
|
if (updateLayoutStateNeeded != 0 || !list.isValid())
|
if (updateLayoutStateNeeded != 0)
|
protected void maybeUpdateLayoutState() { if (updateLayoutStateNeeded != 0 || !list.isValid()) { updateLayoutState(); updateLayoutStateNeeded = 0; } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/BasicListUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicListUI.java
|
if (list.getLayoutOrientation() == JList.VERTICAL) cellWidth = Math.max(cellWidth, list.getSize().width);
|
protected void updateLayoutState() { int nrows = list.getModel().getSize(); cellHeight = -1; cellWidth = -1; if (cellHeights == null || cellHeights.length != nrows) cellHeights = new int[nrows]; ListCellRenderer rend = list.getCellRenderer(); // Update the cellHeight(s) fields. int fixedCellHeight = list.getFixedCellHeight(); if (fixedCellHeight > 0) { cellHeight = fixedCellHeight; cellHeights = null; } else { cellHeight = -1; for (int i = 0; i < nrows; ++i) { Component flyweight = rend.getListCellRendererComponent(list, list.getModel().getElementAt(i), i, list.isSelectedIndex(i), list.getSelectionModel().getAnchorSelectionIndex() == i); Dimension dim = flyweight.getPreferredSize(); cellHeights[i] = dim.height; } } // Update the cellWidth field. int fixedCellWidth = list.getFixedCellWidth(); if (fixedCellWidth > 0) cellWidth = fixedCellWidth; else { for (int i = 0; i < nrows; ++i) { Component flyweight = rend.getListCellRendererComponent(list, list.getModel().getElementAt(i), i, list.isSelectedIndex(i), list.getSelectionModel().getAnchorSelectionIndex() == i); Dimension dim = flyweight.getPreferredSize(); cellWidth = Math.max(cellWidth, dim.width); } if (list.getLayoutOrientation() == JList.VERTICAL) cellWidth = Math.max(cellWidth, list.getSize().width); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/BasicListUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicListUI.java
|
|
return new String[] { "org.jnode.vm.x86.compiler", "org.jnode.vm.x86.compiler.stup" };
|
return new String[] { "org.jnode.vm.x86.compiler", "org.jnode.vm.x86.compiler.stub" };
|
public String[] getCompilerPackages() { return new String[] { "org.jnode.vm.x86.compiler", "org.jnode.vm.x86.compiler.stup" }; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/11151dd03cf76529b6f9eca253058672abf1a286/X86StubCompiler.java/buggy/core/src/core/org/jnode/vm/x86/compiler/stub/X86StubCompiler.java
|
log.debug("using firstProvider "+firstProvName);
|
private FontProvider getProvider(Font font) { FontProvider prov = getFirstProvider(); final String firstProvName = prov.getName(); if (prov.provides(font)) { log.debug("using firstProvider "+firstProvName); return prov; } log.debug("getProvider for "+font.getName()+ " ("+providers.size()+" availables)"); for (FontProvider prv : providers.values()) { if(firstProvName.equals(prv.getName())) continue; // skip the first provider log.debug("font="+font+" provider="+prv); if (prv.provides(font)) { log.debug("provider found"); return prv; } } log.debug("font="+font+" NO PROVIDER"); return null; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/f6a9b60ac9b7859439b5c89304cfc431e9354015/DefaultFontManager.java/clean/gui/src/awt/org/jnode/awt/font/def/DefaultFontManager.java
|
|
log.debug("getProvider for "+font.getName()+ " ("+providers.size()+" availables)"); for (FontProvider prv : providers.values()) { if(firstProvName.equals(prv.getName())) continue;
|
for (FontProvider prv : providers.values()) { if(firstProvName.equals(prv.getName())) continue;
|
private FontProvider getProvider(Font font) { FontProvider prov = getFirstProvider(); final String firstProvName = prov.getName(); if (prov.provides(font)) { log.debug("using firstProvider "+firstProvName); return prov; } log.debug("getProvider for "+font.getName()+ " ("+providers.size()+" availables)"); for (FontProvider prv : providers.values()) { if(firstProvName.equals(prv.getName())) continue; // skip the first provider log.debug("font="+font+" provider="+prv); if (prv.provides(font)) { log.debug("provider found"); return prv; } } log.debug("font="+font+" NO PROVIDER"); return null; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/f6a9b60ac9b7859439b5c89304cfc431e9354015/DefaultFontManager.java/clean/gui/src/awt/org/jnode/awt/font/def/DefaultFontManager.java
|
log.debug("font="+font+" provider="+prv);
|
private FontProvider getProvider(Font font) { FontProvider prov = getFirstProvider(); final String firstProvName = prov.getName(); if (prov.provides(font)) { log.debug("using firstProvider "+firstProvName); return prov; } log.debug("getProvider for "+font.getName()+ " ("+providers.size()+" availables)"); for (FontProvider prv : providers.values()) { if(firstProvName.equals(prv.getName())) continue; // skip the first provider log.debug("font="+font+" provider="+prv); if (prv.provides(font)) { log.debug("provider found"); return prv; } } log.debug("font="+font+" NO PROVIDER"); return null; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/f6a9b60ac9b7859439b5c89304cfc431e9354015/DefaultFontManager.java/clean/gui/src/awt/org/jnode/awt/font/def/DefaultFontManager.java
|
|
log.debug("provider found");
|
private FontProvider getProvider(Font font) { FontProvider prov = getFirstProvider(); final String firstProvName = prov.getName(); if (prov.provides(font)) { log.debug("using firstProvider "+firstProvName); return prov; } log.debug("getProvider for "+font.getName()+ " ("+providers.size()+" availables)"); for (FontProvider prv : providers.values()) { if(firstProvName.equals(prv.getName())) continue; // skip the first provider log.debug("font="+font+" provider="+prv); if (prv.provides(font)) { log.debug("provider found"); return prv; } } log.debug("font="+font+" NO PROVIDER"); return null; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/f6a9b60ac9b7859439b5c89304cfc431e9354015/DefaultFontManager.java/clean/gui/src/awt/org/jnode/awt/font/def/DefaultFontManager.java
|
|
lastPaintPosition = new Point(); cachedBlitFrom = new Point(); cachedBlitTo = new Point(); cachedBlitSize = new Dimension(); cachedBlitPaint = new Rectangle();
|
public JViewport() { setOpaque(true); setScrollMode(BLIT_SCROLL_MODE); setLayout(createLayoutManager()); updateUI(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/0bfec329053442bf284a75378b15938abd962e63/JViewport.java/clean/core/src/classpath/javax/javax/swing/JViewport.java
|
|
paintComponent(g);
|
Component view = getView(); if (view == null) return; Point pos = getViewPosition(); Rectangle viewBounds = view.getBounds(); Rectangle portBounds = getBounds(); if (viewBounds.width == 0 || viewBounds.height == 0 || portBounds.width == 0 || portBounds.height == 0) return; switch (getScrollMode()) { case JViewport.BACKINGSTORE_SCROLL_MODE: paintBackingStore(g); break; case JViewport.BLIT_SCROLL_MODE: paintBlit(g); break; case JViewport.SIMPLE_SCROLL_MODE: default: paintSimple(g); break; } damaged = false;
|
public void paint(Graphics g) { paintComponent(g); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/0bfec329053442bf284a75378b15938abd962e63/JViewport.java/clean/core/src/classpath/javax/javax/swing/JViewport.java
|
damaged = true;
|
public void reshape(int x, int y, int w, int h) { boolean changed = (x != getX()) || (y != getY()) || (w != getWidth()) || (h != getHeight()); super.reshape(x, y, w, h); if (changed) fireStateChanged(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/0bfec329053442bf284a75378b15938abd962e63/JViewport.java/clean/core/src/classpath/javax/javax/swing/JViewport.java
|
|
damaged = true;
|
public void revalidate() { fireStateChanged(); super.revalidate(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/0bfec329053442bf284a75378b15938abd962e63/JViewport.java/clean/core/src/classpath/javax/javax/swing/JViewport.java
|
|
repaint();
|
public void setViewPosition(Point p) { Component view = getView(); if (view != null) { Point q = new Point(-p.x, -p.y); view.setLocation(q); fireStateChanged(); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/0bfec329053442bf284a75378b15938abd962e63/JViewport.java/clean/core/src/classpath/javax/javax/swing/JViewport.java
|
|
isViewSizeSet = true;
|
public void setViewSize(Dimension newSize) { viewSize = newSize; Component view = getView(); if (view != null) view.setSize(viewSize); isViewSizeSet = true; fireStateChanged(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/0bfec329053442bf284a75378b15938abd962e63/JViewport.java/clean/core/src/classpath/javax/javax/swing/JViewport.java
|
|
} isViewSizeSet = true; }
|
public void setViewSize(Dimension newSize) { viewSize = newSize; Component view = getView(); if (view != null) view.setSize(viewSize); isViewSizeSet = true; fireStateChanged(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/0bfec329053442bf284a75378b15938abd962e63/JViewport.java/clean/core/src/classpath/javax/javax/swing/JViewport.java
|
|
blockSize=(int)fs.getBlockSize();
|
blockSize=fs.getBlockSize();
|
public INodeTable(Ext2FileSystem fs, int firstBlock) throws IOException { this.fs = fs; this.firstBlock = firstBlock; blockSize=(int)fs.getBlockSize(); blockCount = (int)Math.ceil( (double)(fs.getSuperblock().getINodesPerGroup()*INode.INODE_LENGTH) / (double) blockSize); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/f03619e78366bc28dfe50fc7787472318ca41010/INodeTable.java/clean/fs/src/fs/org/jnode/fs/ext2/INodeTable.java
|
final VmAbstractHeap firstHeap = heapManager.getFirstHeap();
|
final VmAbstractHeap firstHeap = heapManager.getHeapList();
|
final void gc() { // Prepare final VmBootHeap bootHeap = heapManager.getBootHeap(); final VmAbstractHeap firstHeap = heapManager.getFirstHeap(); stats.lastGCTime = System.currentTimeMillis(); final boolean locking = (writeBarrier != null); final boolean verbose = debug; helper.stopThreadsAtSafePoint(); heapManager.setGcActive(true); try { // Mark //helper.stopThreadsAtSafePoint(); //heapManager.setGcActive(true); try { if (verbose) { Unsafe.debug("<mark/>"); } markHeap(bootHeap, firstHeap, locking); } finally { //heapManager.setGcActive(false); //helper.restartThreads(); } // Sweep if (verbose) { Unsafe.debug("<sweep/>"); } sweep(firstHeap); // Cleanup if (verbose) { Unsafe.debug("<cleanup/>"); } cleanup(bootHeap, firstHeap); // Verification if (debug) { if (verbose) { Unsafe.debug("<verify/>"); } verify(bootHeap, firstHeap); } } finally { heapManager.setGcActive(false); heapManager.resetCurrentHeap(); helper.restartThreads(); } // Start the finalization process heapManager.triggerFinalization(); if (verbose) { Unsafe.debug("</gc free="); Unsafe.debug(heapManager.getFreeMemory()); Unsafe.debug("/>"); if (debug) { System.out.println(stats); } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/17c5c434010c98f6a1acae0cf9ca6782f92f1dfc/GCManager.java/clean/core/src/core/org/jnode/vm/memmgr/def/GCManager.java
|
private final void markHeap(VmBootHeap bootHeap, VmAbstractHeap firstHeap, boolean locking) {
|
private final void markHeap(VmBootHeap bootHeap, VmAbstractHeap firstHeap, boolean locking) {
|
private final void markHeap(VmBootHeap bootHeap, VmAbstractHeap firstHeap, boolean locking) { if (writeBarrier != null) { writeBarrier.setActive(true); } final long startTime = VmSystem.currentKernelMillis(); long markedObjects = 0; boolean firstIteration = true; boolean wbChanged = false; do { // Do an iteration reset markStack.reset(); if (writeBarrier != null) { writeBarrier.resetChanged(); } markVisitor.reset(); markVisitor.setRootSet(true); statics.walk(markVisitor, resolver); // Mark every object in the rootset bootHeap.walk(markVisitor, locking, 0, 0); if (!firstIteration) { // If there was an overflow in the last iteration, // we must also walk through the other heap to visit // all grey objects, since we must still mark // their children. markVisitor.setRootSet(false); VmAbstractHeap heap = firstHeap; while ((heap != null) && (!markStack.isOverflow())) { heap.walk(markVisitor, locking, 0, 0); heap = heap.getNext(); } } // Test for an endless loop if ((markVisitor.getMarkedObjects() == 0) && markStack.isOverflow()) { // Oops... an endless loop Unsafe.debug("Endless loop in markHeap.... going to die"); helper.die("GCManager.markHeap"); } // Do some cleanup markedObjects += markVisitor.getMarkedObjects(); firstIteration = false; if (writeBarrier != null) { wbChanged = writeBarrier.isChanged(); } } while (markStack.isOverflow() || wbChanged); final long endTime = VmSystem.currentKernelMillis(); stats.lastMarkDuration = endTime - startTime; stats.lastMarkedObjects = markedObjects; if (writeBarrier != null) { writeBarrier.setActive(false); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/17c5c434010c98f6a1acae0cf9ca6782f92f1dfc/GCManager.java/clean/core/src/core/org/jnode/vm/memmgr/def/GCManager.java
|
final Vm vm = new Vm(arch, new DefaultHeapManager(clsMgr, helper,
|
final Vm vm = new Vm(version, arch, new DefaultHeapManager(clsMgr, helper,
|
private final void doExecute() throws BuildException { debug = (getProject().getProperty("jnode.debug") != null); final long lmJar = jarFile.lastModified(); final long lmKernel = kernelFile.lastModified(); final long lmDest = destFile.lastModified(); final long lmPIL = getPluginListFile().lastModified(); final PluginList piList; final long lmPI; try { log("plugin-list: " + getPluginListFile(), Project.MSG_DEBUG); piList = getPluginList(); lmPI = piList.lastModified(); } catch (PluginException ex) { throw new BuildException(ex); } catch (IOException ex) { throw new BuildException(ex); } if ((lmJar < lmDest) && (lmKernel < lmDest) && (lmPIL < lmDest) && (lmPI < lmDest)) { // No need to do anything, skip return; } if (debugFile != null) { debugFile.delete(); } try { System.getProperties().setProperty(BUILDTIME_PROPERTY, "1"); // Load the plugin descriptors final PluginRegistry piRegistry; piRegistry = new PluginRegistryModel(piList.getPluginList()); //piRegistry = new // PluginRegistryModel(piList.getDescriptorUrlList()); testPluginPrerequisites(piRegistry); /* Now create the processor */ final VmArchitecture arch = getArchitecture(); final NativeStream os = createNativeStream(); clsMgr = new VmSystemClassLoader(classesURL, arch, new BuildObjectResolver(os, this)); blockedObjects.add(clsMgr); blockedObjects.add(clsMgr.getStatics()); blockedObjects.add(clsMgr.getStatics().getTable()); if (debug) { log("Building in DEBUG mode", Project.MSG_WARN); } // Create the VM final HeapHelper helper = new HeapHelperImpl(arch); final Vm vm = new Vm(arch, new DefaultHeapManager(clsMgr, helper, clsMgr.getStatics()), clsMgr.getStatics(), debug); blockedObjects.add(vm); final VmProcessor proc = createProcessor(clsMgr.getStatics()); log("Building for " + proc.getCPUID()); final Label clInitCaller = new Label("$$clInitCaller"); VmType systemClasses[] = VmType.initializeForBootImage(clsMgr); for (int i = 0; i < systemClasses.length; i++) { clsMgr.addLoadedClass(systemClasses[ i].getName(), systemClasses[ i]); } // First copy the native kernel file copyKernel(os); os.setObjectRef(bootHeapStart); // Setup a call to our first java method initImageHeader(os, clInitCaller, vm, piRegistry); // Create the initial stack createInitialStack(os, initialStack, initialStackPtr); /* Now load the classes */ loadClass(VmMethodCode.class); loadClass(Unsafe.class); loadClass(VmSystemClassLoader.class); loadClass(VmType[].class); loadClass(Vm.class); loadClass(VmBootHeap.class); loadClass(VmDefaultHeap.class); loadClass(VmHeapManager.class); loadClass(VmStatics.class); loadClass(vm.getHeapManager().getClass()); loadClass(HeapHelper.class); loadClass(HeapHelperImpl.class); loadSystemClasses(); /* Now emit the processor */ os.getObjectRef(proc); /* Let the compilers load its native symbol offsets */ final NativeCodeCompiler[] cmps = arch.getCompilers(); for (int i = 0; i < cmps.length; i++) { final NativeCodeCompiler cmp = cmps[ i]; cmp.initialize(clsMgr); os.getObjectRef(cmp); } // Load the jarfile as byte-array copyJarFile(os); // Now emit all object images to the actual image emitObjects(os, arch, blockedObjects); // Disallow the loading of new classes clsMgr.setFailOnNewLoad(true); emitObjects(os, arch, blockedObjects); // Emit the classmanager log("Emit vm", Project.MSG_VERBOSE); blockedObjects.remove(vm); emitObjects(os, arch, blockedObjects); // Twice, this is intended! emitObjects(os, arch, blockedObjects); /* Set the bootclasses */ log("prepare bootClassArray", Project.MSG_VERBOSE); final VmType bootClasses[] = clsMgr.prepareAfterBootstrap(); os.getObjectRef(bootClasses); emitObjects(os, arch, blockedObjects); // Twice, this is intended! emitObjects(os, arch, blockedObjects); // Emit the classmanager log("Emit clsMgr", Project.MSG_VERBOSE); // Turn auto-compilation on clsMgr.setCompileRequired(); blockedObjects.remove(clsMgr); emitObjects(os, arch, blockedObjects); // Twice, this is intended! emitObjects(os, arch, blockedObjects); // Emit the classmanager log("Emit statics", Project.MSG_VERBOSE); blockedObjects.remove(clsMgr.getStatics()); emitObjects(os, arch, blockedObjects); // Twice, this is intended! emitObjects(os, arch, blockedObjects); // Emit the remaining objects log("Emit rest; blocked=" + blockedObjects, Project.MSG_VERBOSE); emitObjects(os, arch, null); log("statics table 0x" + NumberUtils.hex(os.getObjectRef( clsMgr.getStatics().getTable()).getOffset()), Project.MSG_VERBOSE); /* Write static initializer code */ emitStaticInitializerCalls(os, bootClasses, clInitCaller); // This is the end of the image X86Stream.ObjectInfo dummyObjectAtEnd = os .startObject(loadClass(VmMethodCode.class)); pageAlign(os); dummyObjectAtEnd.markEnd(); os.setObjectRef(imageEnd); os.setObjectRef(bootHeapEnd); /* Link all native symbols */ linkNativeSymbols(os); // Patch multiboot header patchHeader(os); // Store the image storeImage(os); // Generate the listfile printLabels(os, bootClasses, clsMgr.getStatics()); // Generate debug info for (int i = 0; i < cmps.length; i++) { cmps[ i].dumpStatistics(); } final int bootHeapSize = os.getObjectRef(bootHeapEnd).getOffset() - os.getObjectRef(bootHeapStart).getOffset(); final int bootHeapBitmapSize = (bootHeapSize / ObjectLayout.OBJECT_ALIGN) >> 3; log("Boot heap size " + (bootHeapSize >>> 10) + "K bitmap size " + (bootHeapBitmapSize >>> 10) + "K"); clsMgr.getStatics().dumpStatistics(System.out); logStatistics(os); BytecodeParser.dumpStatistics(); log("Optimized methods : " + totalHighMethods + ", avg size " + (totalHighMethodSize / totalHighMethods) + ", tot size " + totalHighMethodSize); log("Ondemand comp. methods: " + totalLowMethods + ", avg size " + (totalLowMethodSize / totalLowMethods) + ", tot size " + totalLowMethodSize); log("Done."); os.clear(); } catch (Throwable ex) { ex.printStackTrace(); throw new BuildException(ex); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/06ef01b2121b3c49ebf7112f24742fd8617db518/AbstractBootImageBuilder.java/buggy/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java
|
g.drawRect(t.x, t.y, t.width, t.height);
|
g.drawRect(t.x, t.y, t.width - 2, t.height - 2);
|
protected void paintFocus(Graphics g, Rectangle t, Dimension d) { g.setColor(focusColor); g.drawRect(t.x, t.y, t.width, t.height); // FIXME: we seem to be drawing too tight a rectangle here, perhaps there // is some padding to do somewhere??? }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/804045622bd8dd509311bab751f88cfa2f79345a/MetalRadioButtonUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/metal/MetalRadioButtonUI.java
|
if (b.hasFocus() && b.isFocusPainted())
|
if (b.hasFocus() && b.isFocusPainted() && b.isEnabled())
|
public void paint(Graphics g, JComponent c) { AbstractButton b = (AbstractButton) c; Rectangle tr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle vr = new Rectangle(); Font f = c.getFont(); g.setFont(f); Icon currentIcon = null; if (b.isSelected() && b.isEnabled()) currentIcon = b.getSelectedIcon(); else if (!b.isSelected() && b.isEnabled()) currentIcon = b.getIcon(); else if (b.isSelected() && !b.isEnabled()) currentIcon = b.getDisabledSelectedIcon(); else // (!b.isSelected() && !b.isEnabled()) currentIcon = b.getDisabledIcon(); SwingUtilities.calculateInnerArea(b, vr); String text = SwingUtilities.layoutCompoundLabel (c, g.getFontMetrics(f), b.getText(), currentIcon, b.getVerticalAlignment(), b.getHorizontalAlignment(), b.getVerticalTextPosition(), b.getHorizontalTextPosition(), vr, ir, tr, b.getIconTextGap() + defaultTextShiftOffset); if (currentIcon != null) { currentIcon.paintIcon(c, g, ir.x, ir.y); } if (text != null) paintText(g, b, tr, text); // TODO: Figure out what is the size parameter? if (b.hasFocus() && b.isFocusPainted()) paintFocus(g, tr, null); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/804045622bd8dd509311bab751f88cfa2f79345a/BasicRadioButtonUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicRadioButtonUI.java
|
attribOrder.add(0, DATAFORMAT_XML_ATTRIBUTE_NAME);
|
protected void init() { super.init(); classXDFNodeName = "field"; // order matters! these are in *reverse* order of their // occurence in the XDF DTD attribOrder.add(0, NOTELIST_XML_ATTRIBUTE_NAME); attribOrder.add(0, RELATION_XML_ATTRIBUTE_NAME); attribOrder.add(0, UNITS_XML_ATTRIBUTE_NAME); attribOrder.add(0, DATAFORMAT_XML_ATTRIBUTE_NAME); attribOrder.add(0, DISABLEDVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, UNDERFLOWVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, OVERFLOWVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, NOTANUMBERVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, NODATAVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, INFINITENEGATIVEVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, INFINITEVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, GREATERTHANOREQUALVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, GREATERTHANVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, LESSTHANOREQUALVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, LESSTHANVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, CLASS_XML_ATTRIBUTE_NAME); attribOrder.add(0, IDREF_XML_ATTRIBUTE_NAME); attribOrder.add(0, ID_XML_ATTRIBUTE_NAME); attribOrder.add(0, DESCRIPTION_XML_ATTRIBUTE_NAME); attribOrder.add(0, NAME_XML_ATTRIBUTE_NAME); //set up the attribute hashtable key with the default initial value attribHash.put(NOTELIST_XML_ATTRIBUTE_NAME, new Attribute(Collections.synchronizedList(new ArrayList()), Constants.LIST_TYPE)); attribHash.put(RELATION_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.OBJECT_TYPE)); //double check attribHash.put(UNITS_XML_ATTRIBUTE_NAME, new Attribute(new Units(), Constants.OBJECT_TYPE)); attribHash.put(DATAFORMAT_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.OBJECT_TYPE)); attribHash.put(CLASS_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(DISABLEDVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(OVERFLOWVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(UNDERFLOWVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(NOTANUMBERVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(NODATAVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(INFINITENEGATIVEVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(INFINITEVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(GREATERTHANOREQUALVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(GREATERTHANVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(LESSTHANOREQUALVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(LESSTHANVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(IDREF_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(ID_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(DESCRIPTION_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(NAME_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); };
|
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/5ae3eecb7e010b9ebc7ba276f7652828f82d4c4f/Field.java/clean/src/gov/nasa/gsfc/adc/xdf/Field.java
|
|
if (isCoreObjectMethod(methods[j])) { continue; }
|
static ProxyData getProxyData(ProxyType pt) { Map method_set = (Map) ProxySignature.coreMethods.clone(); boolean in_package = false; // true if we encounter non-public interface ProxyData data = new ProxyData(); data.interfaces = pt.interfaces; // if interfaces is too large, we croak later on when the constant // pool overflows int i = data.interfaces.length; while (--i >= 0) { Class inter = data.interfaces[i]; if (! inter.isInterface()) throw new IllegalArgumentException("not an interface: " + inter); try { if (Class.forName(inter.getName(), false, pt.loader) != inter) throw new IllegalArgumentException("not accessible in " + "classloader: " + inter); } catch (ClassNotFoundException e) { throw new IllegalArgumentException("not accessible in " + "classloader: " + inter); } if (! Modifier.isPublic(inter.getModifiers())) if (in_package) { String p = getPackage(inter); if (! data.pack.equals(p)) throw new IllegalArgumentException("non-public interfaces " + "from different " + "packages"); } else { in_package = true; data.pack = getPackage(inter); } for (int j = i-1; j >= 0; j--) if (data.interfaces[j] == inter) throw new IllegalArgumentException("duplicate interface: " + inter); Method[] methods = inter.getMethods(); int j = methods.length; while (--j >= 0) { ProxySignature sig = new ProxySignature(methods[j]); ProxySignature old = (ProxySignature) method_set.put(sig, sig); if (old != null) sig.checkCompatibility(old); } } i = method_set.size(); data.methods = new Method[i]; data.exceptions = new Class[i][]; Iterator itr = method_set.values().iterator(); while (--i >= 0) { ProxySignature sig = (ProxySignature) itr.next(); data.methods[i] = sig.method; data.exceptions[i] = (Class[]) sig.exceptions .toArray(new Class[sig.exceptions.size()]); } return data; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/Proxy.java/clean/core/src/classpath/java/java/lang/reflect/Proxy.java
|
|
public synchronized void read(BlockDeviceAPI device, long offset) throws IOException { byte[] data = new byte[entries.size() * 32]; device.read(offset, data, 0, data.length); read(data);
|
protected synchronized void read() throws IOException { entries.setSize((int)file.getLengthOnDisk() / 32); final byte[] data = new byte[entries.size() * 32]; file.read(0, data, 0, data.length); read(data);
|
public synchronized void read(BlockDeviceAPI device, long offset) throws IOException { byte[] data = new byte[entries.size() * 32]; device.read(offset, data, 0, data.length); //System.out.println("Directory at offset :" + offset); //System.out.println("Length in bytes = " + entries.size() * 32); read(data); resetDirty(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/FatDirectory.java/buggy/fs/src/fs/org/jnode/fs/fat/FatDirectory.java
|
public void addLayoutComponent(String name, Component child) { }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/JSpinner.java/buggy/core/src/classpath/javax/javax/swing/JSpinner.java
|
||
public void commitEdit() throws ParseException
|
public void commitEdit() throws ParseException
|
public void commitEdit() throws ParseException { } /* TODO */
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/JSpinner.java/buggy/core/src/classpath/javax/javax/swing/JSpinner.java
|
} /* TODO */
|
}
|
public void commitEdit() throws ParseException { } /* TODO */
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/JSpinner.java/buggy/core/src/classpath/javax/javax/swing/JSpinner.java
|
} /* TODO */
|
}
|
public void propertyChange(PropertyChangeEvent event) { } /* TODO */
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/JSpinner.java/buggy/core/src/classpath/javax/javax/swing/JSpinner.java
|
public void removeLayoutComponent(Component child) { }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/JSpinner.java/buggy/core/src/classpath/javax/javax/swing/JSpinner.java
|
||
} /* TODO */
|
}
|
public void stateChanged(ChangeEvent event) { } /* TODO */
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/JSpinner.java/buggy/core/src/classpath/javax/javax/swing/JSpinner.java
|
if (tex instanceof SyntaxError) { Help.getInfo(cx).usage();
|
if (tex instanceof SyntaxErrorException) { try { Help.getInfo(cx).usage(); } catch (HelpException ex1) { ex1.printStackTrace(); }
|
public void run() { try { // System.err.println("Registering shell in new thread."); ShellUtils.getShellManager().registerShell(commandShell);//workaround // to // ensure // access // to // the // command // shell // in // this // new // thread? try { AccessController.doPrivileged(new InvokeAction(method, null, args)); } catch (PrivilegedActionException ex) { throw ex.getException(); } if (!isBlocking()) { //somebody already hit ctrl-c. } else { finished = true; // System.err.println("Finished invocation, notifying // blockers."); //done with invoke, stop waiting for a ctrl-c unblock(); } } catch (InvocationTargetException ex) { Throwable tex = ex.getTargetException(); if (tex instanceof SyntaxError) { Help.getInfo(cx).usage(); err.println(tex.getMessage()); unblock(); } else { err.println("Exception in command"); tex.printStackTrace(err); unblock(); } } catch (Exception ex) { err.println("Exception in command"); ex.printStackTrace(err); unblock(); } finished = true; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/ThreadCommandInvoker.java/buggy/shell/src/shell/org/jnode/shell/ThreadCommandInvoker.java
|
convertPointToScreen(pt, source); convertPointFromScreen(pt, destination);
|
convertPointToScreen(pt, source); convertPointFromScreen(pt, destination);
|
public static Point convertPoint(Component source, int x, int y, Component destination) { Point pt = new Point(x, y); if (source == null && destination == null) return pt; if (source == null) source = getRoot(destination); if (destination == null) destination = getRoot(source); if (source.isShowing() && destination.isShowing()) { convertPointToScreen(pt, source); convertPointFromScreen(pt, destination); } return pt; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/SwingUtilities.java/clean/core/src/classpath/javax/javax/swing/SwingUtilities.java
|
bad.minor = Minor.Any;
|
public static ForwardRequest extract(Any any) { try { return ((ForwardRequestHolder) any.extract_Streamable()).value; } catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION(id() + " expected"); bad.initCause(cex); throw bad; } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/44e3ea509d80974dab547c4d1cf8c070d32bac86/ForwardRequestHelper.java/clean/core/src/classpath/org/org/omg/PortableInterceptor/ForwardRequestHelper.java
|
|
Ext2Debugger.debug("Ext2Entry(iNode, name): name="+name+
|
log.debug("Ext2Entry(iNode, name): name="+name+
|
public Ext2Entry(INode iNode, String name, int type) { this.iNode = iNode; this.name = name; this.type = type; this.valid = true; Ext2Debugger.debug("Ext2Entry(iNode, name): name="+name+ (isDirectory()?" is a directory ":"")+ (isFile()?" is a file ":""), 2); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/95169e195210009513efbf3cd307b4f1185f9ce5/Ext2Entry.java/clean/fs/src/fs/org/jnode/fs/ext2/Ext2Entry.java
|
(isFile()?" is a file ":""), 2);
|
(isFile()?" is a file ":""));
|
public Ext2Entry(INode iNode, String name, int type) { this.iNode = iNode; this.name = name; this.type = type; this.valid = true; Ext2Debugger.debug("Ext2Entry(iNode, name): name="+name+ (isDirectory()?" is a directory ":"")+ (isFile()?" is a file ":""), 2); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/95169e195210009513efbf3cd307b4f1185f9ce5/Ext2Entry.java/clean/fs/src/fs/org/jnode/fs/ext2/Ext2Entry.java
|
super();
|
public UIResource() { }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/DefaultListCellRenderer.java/clean/core/src/classpath/javax/javax/swing/DefaultListCellRenderer.java
|
|
protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) { }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/DefaultListCellRenderer.java/clean/core/src/classpath/javax/javax/swing/DefaultListCellRenderer.java
|
||
public void repaint(long tm, int x, int y, int w, int h) { }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/DefaultListCellRenderer.java/clean/core/src/classpath/javax/javax/swing/DefaultListCellRenderer.java
|
||
public void revalidate() { }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/DefaultListCellRenderer.java/clean/core/src/classpath/javax/javax/swing/DefaultListCellRenderer.java
|
||
public void validate() { }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/DefaultListCellRenderer.java/clean/core/src/classpath/javax/javax/swing/DefaultListCellRenderer.java
|
||
hide();
|
setVisible(false);
|
public void doDefaultCloseAction() { fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_CLOSING); switch (getDefaultCloseOperation()) { case HIDE_ON_CLOSE: hide(); break; case DISPOSE_ON_CLOSE: dispose(); break; } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/49ad2f4c3e74f0a8e99b839c938a312898850fa0/JInternalFrame.java/buggy/core/src/classpath/javax/javax/swing/JInternalFrame.java
|
this.rhs = getOperand(rhsIndex); refs = new Operand[] { rhs };
|
refs = new Operand[] { getOperand(rhsIndex) };
|
public VariableRefAssignQuad(int address, IRBasicBlock block, int lhsIndex, int rhsIndex) { super(address, block, lhsIndex); this.rhs = getOperand(rhsIndex); refs = new Operand[] { rhs }; setDeadCode(true); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/568227fef1ae7ced51f104ef1af634c7a6188718/VariableRefAssignQuad.java/clean/core/src/core/org/jnode/vm/compiler/ir/quad/VariableRefAssignQuad.java
|
if (rhs instanceof Variable) { Variable v = (Variable) rhs;
|
if (refs[0] instanceof Variable) { Variable v = (Variable) refs[0];
|
public void doPass2(BootableHashMap liveVariables) { setDeadCode(true); if (rhs instanceof Variable) { Variable v = (Variable) rhs; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/568227fef1ae7ced51f104ef1af634c7a6188718/VariableRefAssignQuad.java/clean/core/src/core/org/jnode/vm/compiler/ir/quad/VariableRefAssignQuad.java
|
return rhs;
|
return refs[0];
|
public Operand getRHS() { return rhs; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/568227fef1ae7ced51f104ef1af634c7a6188718/VariableRefAssignQuad.java/clean/core/src/core/org/jnode/vm/compiler/ir/quad/VariableRefAssignQuad.java
|
return rhs;
|
return refs[0];
|
public Operand propagate(Variable operand) { return rhs; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/568227fef1ae7ced51f104ef1af634c7a6188718/VariableRefAssignQuad.java/clean/core/src/core/org/jnode/vm/compiler/ir/quad/VariableRefAssignQuad.java
|
return getAddress() + ": " + getLHS().toString() + " = " + rhs.toString();
|
return getAddress() + ": " + getLHS().toString() + " = " + refs[0];
|
public String toString() { return getAddress() + ": " + getLHS().toString() + " = " + rhs.toString(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/568227fef1ae7ced51f104ef1af634c7a6188718/VariableRefAssignQuad.java/clean/core/src/core/org/jnode/vm/compiler/ir/quad/VariableRefAssignQuad.java
|
protected boolean gotoField(ScreenField f) {
|
public boolean gotoField(int f) {
|
protected boolean gotoField(ScreenField f) { if (f != null) { goto_XY(f.startPos()); return true; } else { return false; } }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/446c691d87b77c1be3b434626845a4988e42aea7/Screen5250.java/buggy/tn5250j/src/org/tn5250j/framework/tn5250/Screen5250.java
|
if (f != null) {
|
int sizeFields = screenFields.getSize();
|
protected boolean gotoField(ScreenField f) { if (f != null) { goto_XY(f.startPos()); return true; } else { return false; } }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/446c691d87b77c1be3b434626845a4988e42aea7/Screen5250.java/buggy/tn5250j/src/org/tn5250j/framework/tn5250/Screen5250.java
|
goto_XY(f.startPos()); return true; } else {
|
if (f > sizeFields || f <= 0)
|
protected boolean gotoField(ScreenField f) { if (f != null) { goto_XY(f.startPos()); return true; } else { return false; } }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/446c691d87b77c1be3b434626845a4988e42aea7/Screen5250.java/buggy/tn5250j/src/org/tn5250j/framework/tn5250/Screen5250.java
|
return gotoField(screenFields.getCurrentField());
|
protected boolean gotoField(ScreenField f) { if (f != null) { goto_XY(f.startPos()); return true; } else { return false; } }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/446c691d87b77c1be3b434626845a4988e42aea7/Screen5250.java/buggy/tn5250j/src/org/tn5250j/framework/tn5250/Screen5250.java
|
|
bad.minor = Minor.Any;
|
public static WrongPolicy extract(Any any) { try { EmptyExceptionHolder h = (EmptyExceptionHolder) any.extract_Streamable(); return (WrongPolicy) h.value; } catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("WrongPolicy expected"); bad.initCause(cex); throw bad; } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/44e3ea509d80974dab547c4d1cf8c070d32bac86/WrongPolicyHelper.java/clean/core/src/classpath/org/org/omg/PortableServer/POAPackage/WrongPolicyHelper.java
|
|
super();
|
this.textArea = textArea;
|
public SwingTextAreaPeer(TextArea textArea) { super(); switch (textArea.getScrollbarVisibility()) { case TextArea.SCROLLBARS_BOTH: SwingToolkit.add(textArea, new JScrollPane(this, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS)); break; case TextArea.SCROLLBARS_HORIZONTAL_ONLY: SwingToolkit.add(textArea, new JScrollPane(this, ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS)); break; case TextArea.SCROLLBARS_VERTICAL_ONLY: SwingToolkit.add(textArea, new JScrollPane(this, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); break; case TextArea.SCROLLBARS_NONE: SwingToolkit.add(textArea, this); break; } SwingToolkit.copyAwtProperties(textArea, this); setText(textArea.getText()); setRows(textArea.getRows()); setColumns(textArea.getColumns()); setEditable(textArea.isEditable()); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ae9db4fc68ede9647d01b988919ce05ed61bf034/SwingTextAreaPeer.java/clean/gui/src/awt/org/jnode/awt/swingpeers/SwingTextAreaPeer.java
|
return 0.0F;
|
float align; if (axis == X_AXIS) align = 0.0F; else align = super.getAlignment(axis); return align;
|
public float getAlignment(int axis) { // FIXME: This is very likely not 100% correct. Work this out. return 0.0F; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/ParagraphView.java/buggy/core/src/classpath/javax/javax/swing/text/ParagraphView.java
|
return 0.0F;
|
align = super.getAlignment(axis);
|
public float getAlignment(int axis) { if (axis == X_AXIS) return 0.0F; else if (getViewCount() > 0) { float prefHeight = getPreferredSpan(Y_AXIS); float firstRowHeight = getView(0).getPreferredSpan(Y_AXIS); return (firstRowHeight / 2.F) / prefHeight; } else return 0.0F; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/ParagraphView.java/buggy/core/src/classpath/javax/javax/swing/text/ParagraphView.java
|
public float getAlignment(int axis) { if (axis == X_AXIS) return 0.0F; else if (getViewCount() > 0) { float prefHeight = getPreferredSpan(Y_AXIS); float firstRowHeight = getView(0).getPreferredSpan(Y_AXIS); return (firstRowHeight / 2.F) / prefHeight; } else return 0.0F; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/ParagraphView.java/buggy/core/src/classpath/javax/javax/swing/text/ParagraphView.java
|
||
return (firstRowHeight / 2.F) / prefHeight;
|
align = (firstRowHeight / 2.F) / prefHeight;
|
public float getAlignment(int axis) { if (axis == X_AXIS) return 0.0F; else if (getViewCount() > 0) { float prefHeight = getPreferredSpan(Y_AXIS); float firstRowHeight = getView(0).getPreferredSpan(Y_AXIS); return (firstRowHeight / 2.F) / prefHeight; } else return 0.0F; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/ParagraphView.java/buggy/core/src/classpath/javax/javax/swing/text/ParagraphView.java
|
return 0.0F;
|
align = 0.0F; return align;
|
public float getAlignment(int axis) { if (axis == X_AXIS) return 0.0F; else if (getViewCount() > 0) { float prefHeight = getPreferredSpan(Y_AXIS); float firstRowHeight = getView(0).getPreferredSpan(Y_AXIS); return (firstRowHeight / 2.F) / prefHeight; } else return 0.0F; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/ParagraphView.java/buggy/core/src/classpath/javax/javax/swing/text/ParagraphView.java
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.