JDK-5061189 : Doc: SimpleDateFormat: unspecified behavior for some null parameters
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.text
  • Affected Version: 5.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2004-06-10
  • Updated: 2018-01-11
  • Resolved: 2018-01-11
Related Reports
Duplicate :  
Description

Name: smR10189			Date: 06/10/2004



The JDK 1.5 spec. doesn't specify behavior for some SimpleDateFormat
methods if null value is passed as parameter.
For the following methods the spec. should be clarified:

1) public SimpleDateFormat(String pattern, Locale locale)
To specify: when 'locale' parameter is null

2) public StringBuffer format(Date date,
                           StringBuffer toAppendTo,
                           FieldPosition pos)
To specify: when 'toAppendTo' or 'pos' parameter is null

3) public void set2DigitYearStart(Date startDate)
To specify: when 'startDate' parameter is null

======================================================================

Comments
Duplicates 8169480
11-01-2018

EVALUATION In addition to the methods/constructor of SimpleDateFormat in the description, there are many that don't define behavior of given null args in DateFormat. Some of them don't throw an NPE in methods and do fail later depending on later operations. Hard to define the spec in such cases. It's going to take time to clean up the spec. ###@###.### 2004-06-15
15-06-2004