JDK-7186546 : Months' names are not in proper grammar form
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 7
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_7
  • CPU: x86
  • Submitted: 2012-07-24
  • Updated: 2012-08-02
  • Resolved: 2012-08-02
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b20)
Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Wersja 6.1.7601] x64

EXTRA RELEVANT SYSTEM CONFIGURATION :
System locale is set to Polish

A DESCRIPTION OF THE PROBLEM :
In Polish grammar month in date string should have proper form:
24 lipca 2012

However SimpleDateFormat use base form of month name:
24 lipiec 2012
which  is not proper form according to Polish grammar. Moreover this issue breaks interoperability with systems that use correct form because date string could not be parsed.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Format date using MMMM placeholder (See attached source code for sample)


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
24 lipca 2012
ACTUAL -
24 lipiec 2012

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.text.DateFormatSymbols;
import java.text.SimpleDateFormat;
import java.util.GregorianCalendar;
import java.util.Locale;


public class Program {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		GregorianCalendar date = new GregorianCalendar(2012, 06, 24, 16, 43, 06);
		
		Locale loc = new Locale("pl", "PL", "Traditional");
		
		DateFormatSymbols symbols = new DateFormatSymbols(loc);
		
		SimpleDateFormat format = new SimpleDateFormat("d MMMM yyyy", symbols);
		
		System.out.println(format.format(date.getTime()));
		
	}

}

---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Set month names in proper form using DateFormatSymbols

SUPPORT :
YES

Comments
EVALUATION Duplicate of 7079560.
02-08-2012