You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A DESCRIPTION OF THE PROBLEM :
The documentation for the javax.xml.bind.DatatypeConverter#print(Object) methods (such as printDate, printDateTime and printDecimal) state an IllegalArgumentException is thrown if the input parameter is null. In fact, a NullPointerException is thrown as shown in the Junit sample below:
@Test
public void testJDate() {
this.exception.expect(IllegalArgumentException.class);
javax.xml.bind.DatatypeConverter.printDecimal(null);
}
java.lang.AssertionError:
Expected: an instance of java.lang.IllegalArgumentException
but: <java.lang.NullPointerException> is a java.lang.NullPointerException
Stacktrace was: java.lang.NullPointerException
at javax.xml.bind.DatatypeConverterImpl._printDecimal(DatatypeConverterImpl.java:546)
at javax.xml.bind.DatatypeConverterImpl.printDecimal(DatatypeConverterImpl.java:542)
at javax.xml.bind.DatatypeConverter.printDecimal(DatatypeConverter.java:514)
...
Of course, if it really SHOULD be an IllegalArgumentException, someone might want to open a jre bug report.
There is minimal impact as it is now unclear what should be thrown by a custom converter method.
Previously tracked via: https://bugs.openjdk.java.net/browse/JDK-8152531
A DESCRIPTION OF THE PROBLEM :
The documentation for the javax.xml.bind.DatatypeConverter#print(Object) methods (such as printDate, printDateTime and printDecimal) state an IllegalArgumentException is thrown if the input parameter is null. In fact, a NullPointerException is thrown as shown in the Junit sample below:
java.lang.AssertionError:
Expected: an instance of java.lang.IllegalArgumentException
but: <java.lang.NullPointerException> is a java.lang.NullPointerException
Stacktrace was: java.lang.NullPointerException
at javax.xml.bind.DatatypeConverterImpl._printDecimal(DatatypeConverterImpl.java:546)
at javax.xml.bind.DatatypeConverterImpl.printDecimal(DatatypeConverterImpl.java:542)
at javax.xml.bind.DatatypeConverter.printDecimal(DatatypeConverter.java:514)
...
Of course, if it really SHOULD be an IllegalArgumentException, someone might want to open a jre bug report.
There is minimal impact as it is now unclear what should be thrown by a custom converter method.
URL OF FAULTY DOCUMENTATION :
http://docs.oracle.com/javase/8/docs/api/javax/xml/bind/DatatypeConverter.html
The text was updated successfully, but these errors were encountered: