A DESCRIPTION OF THE PROBLEM :
Relates toJDK-4213086
When one of the java.text.DateFormat static methods which take a date or time style parameter are called with an invalid style value (e.g. -1) they throw an IllegalArgumentException. However, none of the methods document that they throw this exception.
Expected:
The following methods and their overloads which take `int` style parameters should have a @throws IllegalArgumentException Javadoc tag
- getDateInstance
- getTimeInstance
- getDateTimeInstance
---------- BEGIN SOURCE ----------
DateFormat.getDateInstance(-1)
DateFormat.getDateInstance(-1, Locale.ENGLISH)
DateFormat.getTimeInstance(-1)
DateFormat.getTimeInstance(-1, Locale.ENGLISH)
DateFormat.getDateTimeInstance(-1, -1)
DateFormat.getDateTimeInstance(-1, -1, Locale.ENGLISH)
---------- END SOURCE ----------
Relates to
When one of the java.text.DateFormat static methods which take a date or time style parameter are called with an invalid style value (e.g. -1) they throw an IllegalArgumentException. However, none of the methods document that they throw this exception.
Expected:
The following methods and their overloads which take `int` style parameters should have a @throws IllegalArgumentException Javadoc tag
- getDateInstance
- getTimeInstance
- getDateTimeInstance
---------- BEGIN SOURCE ----------
DateFormat.getDateInstance(-1)
DateFormat.getDateInstance(-1, Locale.ENGLISH)
DateFormat.getTimeInstance(-1)
DateFormat.getTimeInstance(-1, Locale.ENGLISH)
DateFormat.getDateTimeInstance(-1, -1)
DateFormat.getDateTimeInstance(-1, -1, Locale.ENGLISH)
---------- END SOURCE ----------
- csr for
-
JDK-8319868 DateFormat does not mention IllegalArgumentException for invalid style args
-
- Closed
-
- relates to
-
JDK-4213086 DateFormat getDateTimeInstance(int, int) w/ invalid styles no exception
-
- Resolved
-