[multiple changes]
2005-01-10 Michael Koch <konqueror@gmx.de> * java/util/SimpleTimeZone.java (checkRule): Throw IllegalArgumentException on invalid month values. * java/util/TimeZone.java (setID): Throw NullPointerException if needed. 2005-01-10 Andrew John Hughes <gnu_andrew@member.fsf.org> * java/util/SimpleTimeZone.java (getOffset): offset end date with daylight savings From-SVN: r93149
This commit is contained in:
parent
2b816e14b7
commit
affe6f69d1
3 changed files with 22 additions and 3 deletions
|
@ -1,3 +1,15 @@
|
||||||
|
2005-01-10 Michael Koch <konqueror@gmx.de>
|
||||||
|
|
||||||
|
* java/util/SimpleTimeZone.java (checkRule):
|
||||||
|
Throw IllegalArgumentException on invalid month values.
|
||||||
|
* java/util/TimeZone.java (setID):
|
||||||
|
Throw NullPointerException if needed.
|
||||||
|
|
||||||
|
2005-01-10 Andrew John Hughes <gnu_andrew@member.fsf.org>
|
||||||
|
|
||||||
|
* java/util/SimpleTimeZone.java (getOffset):
|
||||||
|
offset end date with daylight savings
|
||||||
|
|
||||||
2005-01-10 Ranjit Mathew <rmathew@hotmail.com>
|
2005-01-10 Ranjit Mathew <rmathew@hotmail.com>
|
||||||
|
|
||||||
* testsuite/libjava.compile/PR19277.java: New file for PR java/19277.
|
* testsuite/libjava.compile/PR19277.java: New file for PR java/19277.
|
||||||
|
|
|
@ -70,7 +70,7 @@ public class SimpleTimeZone extends TimeZone
|
||||||
/**
|
/**
|
||||||
* The daylight savings offset. This is a positive offset in
|
* The daylight savings offset. This is a positive offset in
|
||||||
* milliseconds with respect to standard time. Typically this
|
* milliseconds with respect to standard time. Typically this
|
||||||
* is one hour, but for some time zones this may be half an our.
|
* is one hour, but for some time zones this may be half an hour.
|
||||||
* @serial
|
* @serial
|
||||||
* @since JDK1.1.4
|
* @since JDK1.1.4
|
||||||
*/
|
*/
|
||||||
|
@ -430,6 +430,8 @@ public class SimpleTimeZone extends TimeZone
|
||||||
*/
|
*/
|
||||||
private int checkRule(int month, int day, int dayOfWeek)
|
private int checkRule(int month, int day, int dayOfWeek)
|
||||||
{
|
{
|
||||||
|
if (month < 0 || month > 11)
|
||||||
|
throw new IllegalArgumentException("month out of range");
|
||||||
int daysInMonth = getDaysInMonth(month, 1);
|
int daysInMonth = getDaysInMonth(month, 1);
|
||||||
if (dayOfWeek == 0)
|
if (dayOfWeek == 0)
|
||||||
{
|
{
|
||||||
|
@ -589,7 +591,7 @@ public class SimpleTimeZone extends TimeZone
|
||||||
*
|
*
|
||||||
* Note that this API isn't incredibly well specified. It appears that the
|
* Note that this API isn't incredibly well specified. It appears that the
|
||||||
* after flag must override the parameters, since normally, the day and
|
* after flag must override the parameters, since normally, the day and
|
||||||
* dayofweek can select this. I.e., if day < 0 and dayOfWeek < 0, on or
|
* dayofweek can select this. I.e., if day < 0 and dayOfWeek < 0, on or
|
||||||
* before mode is chosen. But if after == true, this implementation
|
* before mode is chosen. But if after == true, this implementation
|
||||||
* overrides the signs of the other arguments. And if dayOfWeek == 0, it
|
* overrides the signs of the other arguments. And if dayOfWeek == 0, it
|
||||||
* falls back to the behavior in the other APIs. I guess this should be
|
* falls back to the behavior in the other APIs. I guess this should be
|
||||||
|
@ -693,7 +695,8 @@ public class SimpleTimeZone extends TimeZone
|
||||||
boolean afterStart = !isBefore(year, month, day, dayOfWeek, millis,
|
boolean afterStart = !isBefore(year, month, day, dayOfWeek, millis,
|
||||||
startMode, startMonth,
|
startMode, startMonth,
|
||||||
startDay, startDayOfWeek, startTime);
|
startDay, startDayOfWeek, startTime);
|
||||||
boolean beforeEnd = isBefore(year, month, day, dayOfWeek, millis,
|
boolean beforeEnd = isBefore(year, month, day, dayOfWeek,
|
||||||
|
millis + dstSavings,
|
||||||
endMode, endMonth,
|
endMode, endMonth,
|
||||||
endDay, endDayOfWeek, endTime);
|
endDay, endDayOfWeek, endTime);
|
||||||
|
|
||||||
|
|
|
@ -989,9 +989,13 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
|
||||||
* Sets the identifier of this time zone. For instance, PST for
|
* Sets the identifier of this time zone. For instance, PST for
|
||||||
* Pacific Standard Time.
|
* Pacific Standard Time.
|
||||||
* @param id the new time zone ID.
|
* @param id the new time zone ID.
|
||||||
|
* @throws NullPointerException if <code>id</code> is <code>null</code>
|
||||||
*/
|
*/
|
||||||
public void setID(String id)
|
public void setID(String id)
|
||||||
{
|
{
|
||||||
|
if (id == null)
|
||||||
|
throw new NullPointerException();
|
||||||
|
|
||||||
this.ID = id;
|
this.ID = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue