JDK-8208487 : Australian locale month names contain spurious dot at the end
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.text
  • Affected Version: 10.0.2
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: x86_64
  • Submitted: 2018-07-30
  • Updated: 2021-02-24
  • Resolved: 2020-09-04
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 13
13Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
ADDITIONAL SYSTEM INFORMATION :
Works on 1.8.0_131, does not work on java 9.0.4 and java 10.0.2. 

A DESCRIPTION OF THE PROBLEM :
Parsing date does not work with Australian locale en_AU. Month contains dot in it. See reproducer. 

REGRESSION : Last worked in version 8u162

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
This only happens with CLDR enabled. If COMPAT is used instead the problem does not happen. 
Under jdk9 
Date d = new SimpleDateFormat("dd MMM yyyy", locale).parse("01 Jan. 2006");
gets parsed correctly but 
 Date d2 = new SimpleDateFormat("dd MMM yyyy", locale).parse("01 Jan 2006");
throws. 
See reproducer. 

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Jan should be parsed as proper month. 
ACTUAL -
Exception is thrown: 
java.text.ParseException: Unparseable date: "01 Jan 2006"
	at java.base/java.text.DateFormat.parse(DateFormat.java:395)
	at LocaleTestExplicitLocale.main(LocaleTestExplicitLocale.java:12)

---------- BEGIN SOURCE ----------
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
class LocaleTestExplicitLocale{
    public static void main(String[] args){
        for (Locale locale: Locale.getAvailableLocales()) {
            if (locale.toString().equals("en_AU")) {
                System.out.println("DisplayName: "+locale.getDisplayName());
                try {
                    Date d = new SimpleDateFormat("dd MMM yyyy", locale).parse("01 Jan. 2006");
                    System.out.println(d);
                    Date d2 = new SimpleDateFormat("dd MMM yyyy", locale).parse("01 Jan 2006");
                    System.out.println(d2);
                    
                } catch (Exception ex) {
                    ex.printStackTrace(System.out);
                }
            }
        }
    }
}
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
-Djava.locale.providers=HOST,SPI,COMPAT,CLDR


FREQUENCY : always



Comments
Cannot reproduce with the JDK 13 or later. Possibly this issue was fixed with the CLDR upgrade to 35.1(JDK-8221432) in JDK13.
03-09-2020

Referring to https://unicode-org.atlassian.net/browse/CLDR-11096, the issue is being reopened in order to fix the issue.
03-09-2020

Please refer : https://www.unicode.org/cldr/charts/29/by_type/date_&_time.gregorian.html#Months_-_abbreviated_-_Formatting For en_AU locale, the abbreviated month names end with dot like : Jan. Feb. etc.
30-07-2018

Additional Information: I do understand that there will be some differences between locales but this one does not make sense. Also if you look at the locale explorer at CLDR Australian months abbreviation do not have dot at the end: http://demo.icu-project.org/icu-bin/locexp?d_=en&_=au
30-07-2018

Please refer : http://www.oracle.com/technetwork/java/javase/9-relnote-issues-3704069.html#JDK-8008577 In JDK 9, the default locale data uses data derived from the Unicode Consortium's Common Locale Data Repository (CLDR). So there are changes with respect to some locales . Refer: http://www.unicode.org/cldr/charts/29/ As stated in workaround, to use the JRE locale with JDK 9 set java.locale.providers to a value with COMPAT ahead of CLDR. : -Djava.locale.providers=COMPAT, CLDR
30-07-2018