[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cp-patches] FYI: SimpleDateFormat constructor should throw NullPointerE
From: |
Mark Wielaard |
Subject: |
[cp-patches] FYI: SimpleDateFormat constructor should throw NullPointerException on null formatData |
Date: |
Sun, 20 Feb 2005 20:07:18 +0100 |
Hi,
One of the mauve regressions pointed out by trying to merge our
SimpleDateFormat changes was that the SimpleDateFormat constructor
should signal a NullPointerException when the DataFormatSymbols argument
is null. Which makes sense since the while class depends on formatData
not being null.
2005-02-20 Mark Wielaard <address@hidden>
* java/text/SimpleDateFormat.java
(SimpleDateFormat(String, DateFormatSymbols)): Throw
NullPointerException when formatData is null.
One less mauve regression and no new failures.
Committed,
Mark
--- java/text/SimpleDateFormat.java 16 Feb 2005 07:05:33 -0000
1.40
+++ java/text/SimpleDateFormat.java 20 Feb 2005 19:01:45 -0000
@@ -430,7 +430,7 @@
*
* @param pattern the non-localized pattern to use.
* @param formatData the formatting symbols to use.
- * @throws NullPointerException if the pattern is null.
+ * @throws NullPointerException if the pattern or formatData is null.
* @throws IllegalArgumentException if the pattern is invalid.
*/
public SimpleDateFormat(String pattern, DateFormatSymbols formatData)
@@ -439,6 +439,8 @@
calendar = new GregorianCalendar();
computeCenturyStart ();
tokens = new ArrayList();
+ if (formatData == null)
+ throw new NullPointerException("formatData");
this.formatData = formatData;
compileFormat(pattern);
this.pattern = pattern;
signature.asc
Description: This is a digitally signed message part
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [cp-patches] FYI: SimpleDateFormat constructor should throw NullPointerException on null formatData,
Mark Wielaard <=