JDK-8074791 : Long-form date format incorrect month string for Finnish locale
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.text
  • Affected Version: 8u40
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: os_x
  • CPU: x86
  • Submitted: 2015-03-06
  • Updated: 2016-08-24
  • Resolved: 2015-03-11
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 8 JDK 9
8u60Fixed 9 b55Fixed
Description
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 :
OSX Yosemite 10.10.2

A DESCRIPTION OF THE PROBLEM :
The output of DateFormat is incorrect in the long form for Finnish, in that it adds an extra 'ta' to the end of the month name.

java8 output:
6. maaliskuutata 2015

java7 output:
6. maaliskuuta 2015

According to wiki language rules for finland, month should end in 'ta': http://en.wikipedia.org/wiki/Date_and_time_notation_in_Finland

"In Finnish a period is placed after the day to indicate an ordinal: ���31. toukokuuta 2002���; furthermore, the month is in the partitive case, always marked by -ta."


REGRESSION.  Last worked in version 7u71

ADDITIONAL REGRESSION INFORMATION: 
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Code to reproduce:

package sandbox;

import java.text.DateFormat;
import java.util.Date;
import java.util.Locale;

public class FormatDateFi {

  public static void main(String[] args) {
    System.out.println(
        DateFormat.getDateInstance(DateFormat.LONG, 
            Locale.forLanguageTag("fi")).format(new Date()));
  }
  
}


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
6. maaliskuuta 2015

ACTUAL -
6. maaliskuutata 2015


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
package sandbox;

import java.text.DateFormat;
import java.util.Date;
import java.util.Locale;

public class FormatDateFi {

  public static void main(String[] args) {
    System.out.println(
        DateFormat.getDateInstance(DateFormat.LONG, 
            Locale.forLanguageTag("fi")).format(new Date()));
  }
  
}

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


Comments
When introducing format and stand-alone forms of month names in JDK 8, 'ta' had to be removed from the date patterns.
10-03-2015

Checked this with JDK 7 (7u76, 7u80 ea b05) and JDK 8 (8u31, 8u40, 8u60 ea b04, 9 ea b50) and could reproduce the issue. With JDK 7 (7u76 and 7u80), the correct result is received: >java FormatDateFi 10. maaliskuuta 2015 With JDK 8, the output is: >java FormatDateFi 10. maaliskuutata 2015
10-03-2015