-
Bug
-
Resolution: Fixed
-
P3
-
8u45, 9
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8142119 | emb-9 | Masayoshi Okutsu | P3 | Resolved | Fixed | team |
JDK-8140916 | 8u91 | Masayoshi Okutsu | P3 | Resolved | Fixed | b01 |
JDK-8138886 | 8u72 | Aleksej Efimov | P3 | Closed | Fixed | b02 |
JDK-8147249 | emb-8u91 | Masayoshi Okutsu | P3 | Resolved | Fixed | b01 |
JDK-8139045 | 7u95 | Masayoshi Okutsu | P3 | Resolved | Fixed | b04 |
FULL PRODUCT VERSION :
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b25)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
DarwinMacBook-Pro-7.local 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64
A DESCRIPTION OF THE PROBLEM :
reporting on behalf a Stack Overflow user:
http://stackoverflow.com/questions/30076349/simpledateformat-parse-returns-errorindex-as-0
a malformed TimeZone will prevent parsing the date, but not set the correct errorIndex in ParsePosition
REGRESSION. Last worked in version 6u43
ADDITIONAL REGRESSION INFORMATION:
claimed to be working in at least jdk1.6.0_38
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
run the attach source code
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
parse position for error should be 21
ACTUAL -
parse position for error is 0, the date was not parsed. Provind for example an invalid month name does produce a correct error position of 3
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public static void main(String[] args) throws Exception {
String date = "13 Jan 2005 21:45:34 ABC";
String format = "dd MMM yyyy HH:mm:ss z";
ParsePosition pp = new ParsePosition(0);
pp.setIndex(0);
SimpleDateFormat sd = new SimpleDateFormat(format, Locale.ENGLISH);
Date d = sd.parse(date, pp);
System.out.println(d);
System.out.println("Error Index " + pp.getErrorIndex());
}
---------- END SOURCE ----------
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b25)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
DarwinMacBook-Pro-7.local 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64
A DESCRIPTION OF THE PROBLEM :
reporting on behalf a Stack Overflow user:
http://stackoverflow.com/questions/30076349/simpledateformat-parse-returns-errorindex-as-0
a malformed TimeZone will prevent parsing the date, but not set the correct errorIndex in ParsePosition
REGRESSION. Last worked in version 6u43
ADDITIONAL REGRESSION INFORMATION:
claimed to be working in at least jdk1.6.0_38
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
run the attach source code
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
parse position for error should be 21
ACTUAL -
parse position for error is 0, the date was not parsed. Provind for example an invalid month name does produce a correct error position of 3
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public static void main(String[] args) throws Exception {
String date = "13 Jan 2005 21:45:34 ABC";
String format = "dd MMM yyyy HH:mm:ss z";
ParsePosition pp = new ParsePosition(0);
pp.setIndex(0);
SimpleDateFormat sd = new SimpleDateFormat(format, Locale.ENGLISH);
Date d = sd.parse(date, pp);
System.out.println(d);
System.out.println("Error Index " + pp.getErrorIndex());
}
---------- END SOURCE ----------
- backported by
-
JDK-8139045 ParsePosition getErrorIndex returns 0 for TimeZone parsing problem
- Resolved
-
JDK-8140916 ParsePosition getErrorIndex returns 0 for TimeZone parsing problem
- Resolved
-
JDK-8142119 ParsePosition getErrorIndex returns 0 for TimeZone parsing problem
- Resolved
-
JDK-8147249 ParsePosition getErrorIndex returns 0 for TimeZone parsing problem
- Resolved
-
JDK-8138886 ParsePosition getErrorIndex returns 0 for TimeZone parsing problem
- Closed