I added some null checks to DateFormatSymbols setter methods and let them throw an NPE as checked by the mauve tests for this class.
2006-03-16 Roman Kennke <[EMAIL PROTECTED]>
* java/text/DateFormatSymbols.java
(setAmPmStrings): Added null check and throw NPE.
(setEras): Likewise.
(setLocalPatternChars): Likewise.
(setMonths): Likewise.
(setShortMonths): Likewise.
(setShortWeekdays): Likewise.
(setWeekdays): Likewise.
(setZoneStrings): Likewise.
/Roman
--
“Improvement makes straight roads, but the crooked roads, without
Improvement, are roads of Genius.” - William Blake
Index: java/text/DateFormatSymbols.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/text/DateFormatSymbols.java,v
retrieving revision 1.19
diff -u -r1.19 DateFormatSymbols.java
--- java/text/DateFormatSymbols.java 23 Jul 2005 20:25:15 -0000 1.19
+++ java/text/DateFormatSymbols.java 16 Mar 2006 14:11:32 -0000
@@ -292,6 +292,8 @@
*/
public void setAmPmStrings (String[] value)
{
+ if(value==null)
+ throw new NullPointerException();
ampms = value;
}
@@ -305,6 +307,8 @@
*/
public void setEras (String[] labels)
{
+ if(labels==null)
+ throw new NullPointerException();
eras = labels;
}
@@ -343,6 +347,8 @@
*/
public void setLocalPatternChars (String chars)
{
+ if(chars==null)
+ throw new NullPointerException();
localPatternChars = chars;
}
@@ -357,6 +363,8 @@
*/
public void setMonths (String[] labels)
{
+ if(labels==null)
+ throw new NullPointerException();
months = labels;
}
@@ -372,6 +380,8 @@
*/
public void setShortMonths (String[] labels)
{
+ if(labels==null)
+ throw new NullPointerException();
shortMonths = labels;
}
@@ -387,6 +397,8 @@
*/
public void setShortWeekdays (String[] labels)
{
+ if(labels==null)
+ throw new NullPointerException();
shortWeekdays = labels;
}
@@ -401,6 +413,8 @@
*/
public void setWeekdays (String[] labels)
{
+ if(labels==null)
+ throw new NullPointerException();
weekdays = labels;
}
@@ -421,6 +435,8 @@
*/
public void setZoneStrings (String[][] zones)
{
+ if(zones==null)
+ throw new NullPointerException();
zoneStrings = zones;
}
signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil
