Relates :
|
|
Relates :
|
|
Relates :
|
A DESCRIPTION OF THE PROBLEM : For the Long class, in one instance of the parseLong method, a NumberFormatException is thrown for a null input value, but in another instance, a NullPointerException is thrown. https://github.com/openjdk/jdk/blob/d0f3cc92bc97aa517d622ac57d22f820fba0684b/src/java.base/share/classes/java/lang/Long.java#L684-L686 https://github.com/openjdk/jdk/blob/d0f3cc92bc97aa517d622ac57d22f820fba0684b/src/java.base/share/classes/java/lang/Long.java#L765 Please unify these methods so that they both throw NPE on a null input value. With JDK-8261290, the message for NumberFormatException was improved to be more clear that this is a null value, not a string of "null" characters (thanks), but the NPE would be preferable here. Please consider unifying all of the Number classes. For example: https://github.com/openjdk/jdk/blob/d0f3cc92bc97aa517d622ac57d22f820fba0684b/src/java.base/share/classes/java/lang/Integer.java#L630
|