-
Bug
-
Resolution: Duplicate
-
P2
-
None
-
1.1.1
-
x86
-
generic, solaris_9
takeshi.asano@Japan 1997-04-01
Parsing string represents time, DateFormat.parse() crashes.
Actually, SimpleDateFormat seems to crash if hh, mm, or ss
in the string is zero.
asano@soda[12178]$ LANG=C java ParseZero < parse_zero.data
str: 05:55:10 oclock AM PST
full: 5:55:10 oclock AM PST
str: 06:10:25 oclock AM PST
full: 6:10:25 oclock AM PST
str: 06:51:15 oclock AM PST
full: 6:51:15 oclock AM PST
str: 06:58:01 oclock AM PST
full: 6:58:01 oclock AM PST
str: 07:58:22 oclock AM PST
full: 7:58:22 oclock AM PST
str: 10:41:33 oclock AM PST
full: 10:41:33 oclock AM PST
str: 12:00:00 oclock AM PST
java.lang.NullPointerException
at java.text.SimpleDateFormat.subParse(Compiled Code)
at java.text.SimpleDateFormat.parse(Compiled Code)
at java.text.DateFormat.parse(Compiled Code)
at ParseZero.main(Compiled Code)
I attached "parse_zero.java" and "parse_zero.data" for reproduction.
- duplicates
-
JDK-4048975 NumberFormat parse throws exceptions on 0
- Closed
- relates to
-
JDK-4040985 SimpleDateFormat generates incorrect dates using formatter
- Closed