-
Bug
-
Resolution: Fixed
-
P4
-
8, 9
-
b08
-
generic
-
generic
-
Verified
FULL PRODUCT VERSION :
A DESCRIPTION OF THE PROBLEM :
At line 778 class TimeZone.java
Method is a private static used from TimeZone.getTimezone(String)
at this point when String is NULL enter to block to perform parseCustomTimeZone but with Null string NullPointer is raise
if ((length = id.length()) < (GMT_ID_LENGTH + 2) ||
id.indexOf(GMT_ID) != 0) {
return null;
}
REPRODUCIBILITY :
This bug can be reproduced always.
When their input is null, the following methods in java.util.TimeZone throw a NullPointerException:
TimeZone.getTimeZone(String ID)
TimeZone.setID(String ID)
TimeZone.inDaylightTime(Date date)
The javadocs need to be updated to make this apparent. In addition, for the non static methods, it needs to be apparent that the methods "may throw" an NPE not "will throw"
due to the possible existence of external sub-classes overriding these methods.
A DESCRIPTION OF THE PROBLEM :
At line 778 class TimeZone.java
Method is a private static used from TimeZone.getTimezone(String)
at this point when String is NULL enter to block to perform parseCustomTimeZone but with Null string NullPointer is raise
if ((length = id.length()) < (GMT_ID_LENGTH + 2) ||
id.indexOf(GMT_ID) != 0) {
return null;
}
REPRODUCIBILITY :
This bug can be reproduced always.
When their input is null, the following methods in java.util.TimeZone throw a NullPointerException:
TimeZone.getTimeZone(String ID)
TimeZone.setID(String ID)
TimeZone.inDaylightTime(Date date)
The javadocs need to be updated to make this apparent. In addition, for the non static methods, it needs to be apparent that the methods "may throw" an NPE not "will throw"
due to the possible existence of external sub-classes overriding these methods.
- csr for
-
JDK-8299830 NPE is not apparent for methods in java.util.TimeZone API docs
-
- Closed
-