-
Enhancement
-
Resolution: Fixed
-
P4
-
11
-
b11
-
generic
-
generic
-
Verified
A DESCRIPTION OF THE PROBLEM :
Long.valueOf(null);
Exception in thread "main" java.lang.NumberFormatException: null
at java.base/java.lang.Long.parseLong(Long.java:655)
at java.base/java.lang.Long.valueOf(Long.java:1144)
at Main.main(Main.java:3)
This error message is a bit hard to decipher without understand that the Exception message IS the value passed in (null). It just looks like there is no message with this Exception. It would be better (and seems to be the current trend) if this method was more cleat in the JavaDocs about 'null' and also that it threw an explicit NPE (Objects#requireNonNull).
Long.valueOf(null);
Exception in thread "main" java.lang.NumberFormatException: null
at java.base/java.lang.Long.parseLong(Long.java:655)
at java.base/java.lang.Long.valueOf(Long.java:1144)
at Main.main(Main.java:3)
This error message is a bit hard to decipher without understand that the Exception message IS the value passed in (null). It just looks like there is no message with this Exception. It would be better (and seems to be the current trend) if this method was more cleat in the JavaDocs about 'null' and also that it threw an explicit NPE (Objects#requireNonNull).
- relates to
-
JDK-8264745 Unify ParseLong Methods to Throw NPE
-
- Closed
-