[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cp-patches] FYI: Check month range in SimpleTimeZone.checkRule()
From: |
Mark Wielaard |
Subject: |
[cp-patches] FYI: Check month range in SimpleTimeZone.checkRule() |
Date: |
Thu, 17 Feb 2005 23:41:01 +0100 |
Hi,
I am adding the following check back that was apparently accidentally
removed a while back.
2005-02-17 Mark Wielaard <address@hidden>
* java/util/SimpleTimeZone.java (checkRule): Throw
IllegalArgumentException when month out of range.
It makes Mauve a lot happier. +34 PASSes -1 FAIL.
Cheers,
Mark
--- java/util/SimpleTimeZone.java 16 Feb 2005 12:36:21 -0000 1.23
+++ java/util/SimpleTimeZone.java 17 Feb 2005 22:34:10 -0000
@@ -425,6 +425,9 @@
*/
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);
if (dayOfWeek == 0)
{
signature.asc
Description: This is a digitally signed message part
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [cp-patches] FYI: Check month range in SimpleTimeZone.checkRule(),
Mark Wielaard <=