-
Bug
-
Resolution: Fixed
-
P4
-
8
-
b05
-
generic
-
generic
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8281526 | 11.0.15 | Goetz Lindenmaier | P4 | Resolved | Fixed | b02 |
A DESCRIPTION OF THE PROBLEM :
Possible JAVA 8 bug while parsing dates using pattern with dot after short month (like dd MMM.yyyy) for several months (not all of them) in russian locale.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Date should be parsed
ACTUAL -
Exception in thread "main" java.text.ParseException: Unparseable date: "28 дек.2018"
at java.text.DateFormat.parse(DateFormat.java:366)
at Main.main(Main.java:12)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
---------- BEGIN SOURCE ----------
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Locale;
public class Main {
public static void main(String[] args) throws ParseException {
Locale locale = new Locale("ru");
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd MMM.yyyy", locale);
Object date = simpleDateFormat.parse("28 дек.2018");
System.out.println(date);
}
}
---------- END SOURCE ----------
Possible JAVA 8 bug while parsing dates using pattern with dot after short month (like dd MMM.yyyy) for several months (not all of them) in russian locale.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Date should be parsed
ACTUAL -
Exception in thread "main" java.text.ParseException: Unparseable date: "28 дек.2018"
at java.text.DateFormat.parse(DateFormat.java:366)
at Main.main(Main.java:12)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
---------- BEGIN SOURCE ----------
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Locale;
public class Main {
public static void main(String[] args) throws ParseException {
Locale locale = new Locale("ru");
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd MMM.yyyy", locale);
Object date = simpleDateFormat.parse("28 дек.2018");
System.out.println(date);
}
}
---------- END SOURCE ----------
- backported by
-
JDK-8281526 ParseException thrown for certain months with russian locale
- Resolved