mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-20 23:36:18 +00:00
8037343: Wrong dateformat for locale es_DO
Reviewed-by: okutsu
This commit is contained in:
parent
9e710c30f7
commit
a8c4f42722
@ -75,8 +75,8 @@ public class FormatData_es_DO extends ParallelListResourceBundle {
|
||||
new String[] {
|
||||
"EEEE d' de 'MMMM' de 'yyyy", // full date pattern
|
||||
"d' de 'MMMM' de 'yyyy", // long date pattern
|
||||
"MM/dd/yyyy", // medium date pattern
|
||||
"MM/dd/yy", // short date pattern
|
||||
"dd/MM/yyyy", // medium date pattern
|
||||
"dd/MM/yy", // short date pattern
|
||||
}
|
||||
},
|
||||
{ "DateTimePatterns",
|
||||
|
||||
71
jdk/test/sun/text/resources/Format/Bug8037343.java
Normal file
71
jdk/test/sun/text/resources/Format/Bug8037343.java
Normal file
@ -0,0 +1,71 @@
|
||||
/*
|
||||
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8037343
|
||||
* @summary updating dateformat for es_DO
|
||||
*/
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Locale;
|
||||
|
||||
public class Bug8037343
|
||||
{
|
||||
|
||||
public static void main(String[] arg)
|
||||
{
|
||||
final Locale esDO = new Locale("es", "DO");
|
||||
final String expectedShort = "31/03/12";
|
||||
final String expectedMedium = "31/03/2012";
|
||||
|
||||
int errors = 0;
|
||||
DateFormat format;
|
||||
String result;
|
||||
|
||||
Calendar cal = Calendar.getInstance(esDO);
|
||||
cal.set(Calendar.DAY_OF_MONTH, 31);
|
||||
cal.set(Calendar.MONTH, Calendar.MARCH);
|
||||
cal.set(Calendar.YEAR, 2012);
|
||||
|
||||
format = DateFormat.getDateInstance(DateFormat.SHORT, esDO);
|
||||
result = format.format(cal.getTime());
|
||||
if (!expectedShort.equals(result)) {
|
||||
System.out.println(String.format("Short Date format for es_DO is not as expected. Expected: [%s] Actual: [%s]", expectedShort, result));
|
||||
errors++;
|
||||
}
|
||||
|
||||
format = DateFormat.getDateInstance(DateFormat.MEDIUM, esDO);
|
||||
result = format.format(cal.getTime());
|
||||
if (!expectedMedium.equals(result)) {
|
||||
System.out.println(String.format("Medium Date format for es_DO is not as expected. Expected: [%s] Actual: [%s]", expectedMedium, result));
|
||||
errors++;
|
||||
}
|
||||
|
||||
if (errors > 0) {
|
||||
throw new RuntimeException();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -483,8 +483,8 @@ FormatData/es_DO/TimePatterns/2=hh:mm:ss a
|
||||
FormatData/es_DO/TimePatterns/3=hh:mm a
|
||||
FormatData/es_DO/DatePatterns/0=EEEE d' de 'MMMM' de 'yyyy
|
||||
FormatData/es_DO/DatePatterns/1=d' de 'MMMM' de 'yyyy
|
||||
FormatData/es_DO/DatePatterns/2=MM/dd/yyyy
|
||||
FormatData/es_DO/DatePatterns/3=MM/dd/yy
|
||||
# FormatData/es_DO/DatePatterns/2=MM/dd/yyyy # Changed: see bug 8037343
|
||||
# FormatData/es_DO/DatePatterns/3=MM/dd/yy # Changed: see bug 8037343
|
||||
FormatData/es_DO/DateTimePatterns/0={1} {0}
|
||||
FormatData/es_DO/NumberElements/0=.
|
||||
FormatData/es_DO/NumberElements/1=,
|
||||
@ -7692,3 +7692,7 @@ FormatData/es_EC/TimePatterns/0=HH:mm:ss zzzz
|
||||
FormatData/es_EC/TimePatterns/1=H:mm:ss z
|
||||
FormatData/es_EC/TimePatterns/2=H:mm:ss
|
||||
FormatData/es_EC/TimePatterns/3=H:mm
|
||||
|
||||
# bug 8037343
|
||||
FormatData/es_DO/DatePatterns/2=dd/MM/yyyy
|
||||
FormatData/es_DO/DatePatterns/3=dd/MM/yy
|
||||
|
||||
@ -36,6 +36,7 @@
|
||||
* 6919624 6998391 7019267 7020960 7025837 7020583 7036905 7066203 7101495
|
||||
* 7003124 7085757 7028073 7171028 7189611 8000983 7195759 8004489 8006509
|
||||
* 7114053 7074882 7040556 8013836 8021121 6192407 6931564 8027695 8017142
|
||||
* 8037343
|
||||
* @summary Verify locale data
|
||||
*
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user