Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8218903

DateFormat.getDateInstance() returns wrong pattern in locales da and sv

XMLWordPrintable

      ADDITIONAL SYSTEM INFORMATION :
      Works in Java 8 202, broken in Java 11.0.1 and above (including Java 12 build 30)

      A DESCRIPTION OF THE PROBLEM :
      getDateInstance returns wrong pattern. I have only testes da and sv languages.

      REGRESSION : Last worked in version 8u202

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run the program and see the output

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      1.8.0_201
      dd-MM-yy
      yyyy-MM-dd

      1.8.0_202
      dd-MM-yy
      yyyy-MM-dd
      ACTUAL -
      11.0.1
      dd/MM/y
      y-MM-dd

      11.0.2
      dd/MM/y
      y-MM-dd

      12-ea
      dd/MM/y
      y-MM-dd

      ---------- BEGIN SOURCE ----------
      public class DateFormatTest1 {
      public static void main(String[] args) {
      System.out.println(System.getProperty("java.version"));
      System.out.println(((SimpleDateFormat)DateFormat.getDateInstance(DateFormat.SHORT, new Locale("da", "DK"))).toPattern());
      System.out.println(((SimpleDateFormat)DateFormat.getDateInstance(DateFormat.SHORT, new Locale("sv", "SE"))).toPattern());
      }
      }
      ---------- END SOURCE ----------

      FREQUENCY : always


            psonal Pallavi Sonal (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: