Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
9baca700
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
9baca700
编写于
7月 01, 2019
作者:
A
andrew
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8219781: Localized names for Japanese era Reiwa in COMPAT provider
Reviewed-by: naoto, aph, phh
上级
5f48c2c8
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
166 addition
and
0 deletion
+166
-0
src/share/classes/sun/text/resources/ar/FormatData_ar.java
src/share/classes/sun/text/resources/ar/FormatData_ar.java
+2
-0
src/share/classes/sun/text/resources/ar/JavaTimeSupplementary_ar.java
...asses/sun/text/resources/ar/JavaTimeSupplementary_ar.java
+2
-0
src/share/classes/sun/text/resources/hi/JavaTimeSupplementary_hi_IN.java
...es/sun/text/resources/hi/JavaTimeSupplementary_hi_IN.java
+2
-0
src/share/classes/sun/text/resources/ko/FormatData_ko.java
src/share/classes/sun/text/resources/ko/FormatData_ko.java
+1
-0
src/share/classes/sun/text/resources/ko/JavaTimeSupplementary_ko.java
...asses/sun/text/resources/ko/JavaTimeSupplementary_ko.java
+2
-0
src/share/classes/sun/text/resources/ru/JavaTimeSupplementary_ru.java
...asses/sun/text/resources/ru/JavaTimeSupplementary_ru.java
+2
-0
src/share/classes/sun/text/resources/sr/JavaTimeSupplementary_sr.java
...asses/sun/text/resources/sr/JavaTimeSupplementary_sr.java
+2
-0
src/share/classes/sun/text/resources/th/FormatData_th.java
src/share/classes/sun/text/resources/th/FormatData_th.java
+2
-0
src/share/classes/sun/text/resources/th/JavaTimeSupplementary_th.java
...asses/sun/text/resources/th/JavaTimeSupplementary_th.java
+2
-0
src/share/classes/sun/text/resources/zh/FormatData_zh.java
src/share/classes/sun/text/resources/zh/FormatData_zh.java
+1
-0
src/share/classes/sun/text/resources/zh/JavaTimeSupplementary_zh.java
...asses/sun/text/resources/zh/JavaTimeSupplementary_zh.java
+2
-0
src/share/classes/sun/text/resources/zh/JavaTimeSupplementary_zh_TW.java
...es/sun/text/resources/zh/JavaTimeSupplementary_zh_TW.java
+2
-0
test/java/util/Calendar/JapanEraNameCompatTest.java
test/java/util/Calendar/JapanEraNameCompatTest.java
+144
-0
未找到文件。
src/share/classes/sun/text/resources/ar/FormatData_ar.java
浏览文件 @
9baca700
...
...
@@ -212,6 +212,7 @@ public class FormatData_ar extends ParallelListResourceBundle {
"\u062a\u064a\u0634\u0648"
,
"\u0634\u0648\u0648\u0627"
,
"\u0647\u064a\u0633\u064a"
,
"\u0631\u064a\u0648\u0627"
,
}
},
{
"japanese.short.Eras"
,
...
...
@@ -221,6 +222,7 @@ public class FormatData_ar extends ParallelListResourceBundle {
"\u062a\u064a\u0634\u0648"
,
"\u0634\u0648\u0648\u0627"
,
"\u0647\u064a\u0633\u064a"
,
"\u0631\u064a\u0648\u0627"
,
}
},
{
"buddhist.Eras"
,
...
...
src/share/classes/sun/text/resources/ar/JavaTimeSupplementary_ar.java
浏览文件 @
9baca700
...
...
@@ -229,6 +229,7 @@ public class JavaTimeSupplementary_ar extends OpenListResourceBundle {
"\u062a\u064a\u0634\u0648"
,
"\u0634\u0648\u0648\u0627"
,
"\u0647\u064a\u0633\u064a"
,
"\u0631\u064a\u0648\u0627"
,
}
},
{
"java.time.japanese.short.Eras"
,
...
...
@@ -238,6 +239,7 @@ public class JavaTimeSupplementary_ar extends OpenListResourceBundle {
"\u062a\u064a\u0634\u0648"
,
"\u0634\u0648\u0648\u0627"
,
"\u0647\u064a\u0633\u064a"
,
"\u0631\u064a\u0648\u0627"
,
}
},
{
"java.time.long.Eras"
,
...
...
src/share/classes/sun/text/resources/hi/JavaTimeSupplementary_hi_IN.java
浏览文件 @
9baca700
...
...
@@ -145,6 +145,7 @@ public class JavaTimeSupplementary_hi_IN extends OpenListResourceBundle {
"\u0924\u093e\u0908\u0936\u094b"
,
"\u0936\u094b\u0935\u093e"
,
"\u0939\u0947\u0908\u0938\u0947\u0908"
,
"\u0930\u0947\u0907\u0935\u093e"
,
}
},
{
"java.time.japanese.short.Eras"
,
...
...
@@ -154,6 +155,7 @@ public class JavaTimeSupplementary_hi_IN extends OpenListResourceBundle {
"\u0924\u093e\u0908\u0936\u094b"
,
"\u0936\u094b\u0935\u093e"
,
"\u0939\u0947\u0908\u0938\u0947\u0908"
,
"\u0930\u0947\u0907\u0935\u093e"
,
}
},
{
"java.time.short.Eras"
,
...
...
src/share/classes/sun/text/resources/ko/FormatData_ko.java
浏览文件 @
9baca700
...
...
@@ -192,6 +192,7 @@ public class FormatData_ko extends ParallelListResourceBundle {
"\ub2e4\uc774\uc1fc"
,
"\uc1fc\uc640"
,
"\ud5e4\uc774\uc138\uc774"
,
"\ub808\uc774\uc640"
,
}
},
{
"AmPmMarkers"
,
...
...
src/share/classes/sun/text/resources/ko/JavaTimeSupplementary_ko.java
浏览文件 @
9baca700
...
...
@@ -158,6 +158,7 @@ public class JavaTimeSupplementary_ko extends OpenListResourceBundle {
"\ub2e4\uc774\uc1fc"
,
"\uc1fc\uc640"
,
"\ud5e4\uc774\uc138\uc774"
,
"\ub808\uc774\uc640"
,
}
},
{
"java.time.japanese.short.Eras"
,
...
...
@@ -167,6 +168,7 @@ public class JavaTimeSupplementary_ko extends OpenListResourceBundle {
"\ub2e4\uc774\uc1fc"
,
"\uc1fc\uc640"
,
"\ud5e4\uc774\uc138\uc774"
,
"\ub808\uc774\uc640"
,
}
},
{
"java.time.long.Eras"
,
...
...
src/share/classes/sun/text/resources/ru/JavaTimeSupplementary_ru.java
浏览文件 @
9baca700
...
...
@@ -219,6 +219,7 @@ public class JavaTimeSupplementary_ru extends OpenListResourceBundle {
"\u042d\u043f\u043e\u0445\u0430 \u0422\u0430\u0439\u0441\u044c\u043e"
,
"\u0421\u044c\u043e\u0432\u0430"
,
"\u042d\u043f\u043e\u0445\u0430 \u0425\u044d\u0439\u0441\u044d\u0439"
,
"\u0420\u044d\u0439\u0432\u0430"
,
}
},
{
"java.time.japanese.short.Eras"
,
...
...
@@ -228,6 +229,7 @@ public class JavaTimeSupplementary_ru extends OpenListResourceBundle {
"\u042d\u043f\u043e\u0445\u0430 \u0422\u0430\u0439\u0441\u044c\u043e"
,
"\u0421\u044c\u043e\u0432\u0430"
,
"\u042d\u043f\u043e\u0445\u0430 \u0425\u044d\u0439\u0441\u044d\u0439"
,
"\u0420\u044d\u0439\u0432\u0430"
,
}
},
{
"java.time.long.Eras"
,
...
...
src/share/classes/sun/text/resources/sr/JavaTimeSupplementary_sr.java
浏览文件 @
9baca700
...
...
@@ -179,6 +179,7 @@ public class JavaTimeSupplementary_sr extends OpenListResourceBundle {
"\u0422\u0430\u0438\u0448\u043e"
,
"\u0428\u043e\u0432\u0430"
,
"\u0425\u0430\u0438\u0441\u0435\u0438"
,
"\u0420\u0435\u0438\u0432\u0430"
,
}
},
{
"java.time.japanese.short.Eras"
,
...
...
@@ -188,6 +189,7 @@ public class JavaTimeSupplementary_sr extends OpenListResourceBundle {
"\u0422\u0430\u0438\u0448\u043e"
,
"\u0428\u043e\u0432\u0430"
,
"\u0425\u0430\u0438\u0441\u0435\u0438"
,
"\u0420\u0435\u0438\u0432\u0430"
,
}
},
{
"java.time.long.Eras"
,
...
...
src/share/classes/sun/text/resources/th/FormatData_th.java
浏览文件 @
9baca700
...
...
@@ -245,6 +245,7 @@ public class FormatData_th extends ParallelListResourceBundle {
"\u0e17\u0e30\u0e2d\u0e34\u0e42\u0e0a"
,
"\u0e42\u0e0a\u0e27\u0e30"
,
"\u0e40\u0e2e\u0e40\u0e0b"
,
"\u0e40\u0e23\u0e27\u0e30"
,
}
},
{
"japanese.short.Eras"
,
...
...
@@ -254,6 +255,7 @@ public class FormatData_th extends ParallelListResourceBundle {
"\u0e17"
,
"\u0e0a"
,
"\u0e2e"
,
"R"
,
}
},
{
"buddhist.TimePatterns"
,
...
...
src/share/classes/sun/text/resources/th/JavaTimeSupplementary_th.java
浏览文件 @
9baca700
...
...
@@ -199,6 +199,7 @@ public class JavaTimeSupplementary_th extends OpenListResourceBundle {
"\u0e17\u0e30\u0e2d\u0e34\u0e42\u0e0a"
,
"\u0e42\u0e0a\u0e27\u0e30"
,
"\u0e40\u0e2e\u0e40\u0e0b"
,
"\u0e40\u0e23\u0e27\u0e30"
,
}
},
{
"java.time.japanese.short.Eras"
,
...
...
@@ -208,6 +209,7 @@ public class JavaTimeSupplementary_th extends OpenListResourceBundle {
"\u0e17\u0e30\u0e2d\u0e34\u0e42\u0e0a"
,
"\u0e42\u0e0a\u0e27\u0e30"
,
"\u0e40\u0e2e\u0e40\u0e0b"
,
"\u0e40\u0e23\u0e27\u0e30"
,
}
},
{
"java.time.long.Eras"
,
...
...
src/share/classes/sun/text/resources/zh/FormatData_zh.java
浏览文件 @
9baca700
...
...
@@ -282,6 +282,7 @@ public class FormatData_zh extends ParallelListResourceBundle {
"\u5927\u6b63"
,
"\u662d\u548c"
,
"\u5e73\u6210"
,
"\u4ee4\u548c"
,
}
},
{
"TimePatterns"
,
...
...
src/share/classes/sun/text/resources/zh/JavaTimeSupplementary_zh.java
浏览文件 @
9baca700
...
...
@@ -186,6 +186,7 @@ public class JavaTimeSupplementary_zh extends OpenListResourceBundle {
"\u5927\u6b63"
,
"\u662d\u548c"
,
"\u5e73\u6210"
,
"\u4ee4\u548c"
,
}
},
{
"java.time.japanese.short.Eras"
,
...
...
@@ -195,6 +196,7 @@ public class JavaTimeSupplementary_zh extends OpenListResourceBundle {
"\u5927\u6b63"
,
"\u662d\u548c"
,
"\u5e73\u6210"
,
"\u4ee4\u548c"
,
}
},
{
"java.time.roc.DatePatterns"
,
...
...
src/share/classes/sun/text/resources/zh/JavaTimeSupplementary_zh_TW.java
浏览文件 @
9baca700
...
...
@@ -175,6 +175,7 @@ public class JavaTimeSupplementary_zh_TW extends OpenListResourceBundle {
"\u5927\u6b63"
,
"\u662d\u548c"
,
"\u5e73\u6210"
,
"\u4ee4\u548c"
,
}
},
{
"java.time.japanese.short.Eras"
,
...
...
@@ -184,6 +185,7 @@ public class JavaTimeSupplementary_zh_TW extends OpenListResourceBundle {
"\u5927\u6b63"
,
"\u662d\u548c"
,
"\u5e73\u6210"
,
"\u4ee4\u548c"
,
}
},
{
"java.time.roc.DatePatterns"
,
...
...
test/java/util/Calendar/JapanEraNameCompatTest.java
0 → 100644
浏览文件 @
9baca700
/*
* Copyright (c) 2019, 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 8218781
* @summary Test the localized names of Japanese era Reiwa from COMPAT provider.
* @modules jdk.localedata
* @run testng/othervm -Djava.locale.providers=COMPAT JapanEraNameCompatTest
*/
import
static
java
.
util
.
Calendar
.*;
import
static
java
.
util
.
Locale
.*;
import
java.time.LocalDate
;
import
java.time.chrono.JapaneseChronology
;
import
java.time.chrono.JapaneseEra
;
import
java.time.format.DateTimeFormatter
;
import
java.time.format.DateTimeParseException
;
import
java.time.format.TextStyle
;
import
java.util.Calendar
;
import
java.util.Locale
;
import
org.testng.annotations.DataProvider
;
import
org.testng.annotations.Test
;
import
static
org
.
testng
.
Assert
.
assertEquals
;
@Test
public
class
JapanEraNameCompatTest
{
static
final
Calendar
c
=
new
Calendar
.
Builder
()
.
setCalendarType
(
"japanese"
)
.
setFields
(
ERA
,
5
,
YEAR
,
1
,
MONTH
,
MAY
,
DAY_OF_MONTH
,
1
)
.
build
();
static
final
String
EngName
=
"Reiwa"
;
static
final
String
CJName
=
"\u4ee4\u548c"
;
static
final
String
KoreanName
=
"\ub808\uc774\uc640"
;
static
final
String
ArabicName
=
"\u0631\u064a\u0648\u0627"
;
static
final
String
ThaiName
=
"\u0e40\u0e23\u0e27\u0e30"
;
static
final
String
HindiName
=
"\u0930\u0947\u0907\u0935\u093e"
;
static
final
String
RussianName
=
"\u0420\u044d\u0439\u0432\u0430"
;
static
final
String
SerbianName
=
"\u0420\u0435\u0438\u0432\u0430"
;
static
final
String
SerbLatinName
=
"Reiva"
;
@DataProvider
(
name
=
"UtilCalendar"
)
Object
[][]
dataUtilCalendar
()
{
return
new
Object
[][]
{
//locale, long, short
{
JAPAN
,
CJName
,
"R"
},
{
KOREAN
,
KoreanName
,
"R"
},
{
CHINA
,
CJName
,
"R"
},
{
TAIWAN
,
CJName
,
"R"
},
// fallback to zh
{
new
Locale
(
"ar"
),
ArabicName
,
ArabicName
},
{
new
Locale
(
"th"
),
ThaiName
,
"R"
},
// hi_IN fallback to root
{
new
Locale
(
"hi"
,
"IN"
),
EngName
,
"R"
}
};
}
@Test
(
dataProvider
=
"UtilCalendar"
)
public
void
testCalendarEraDisplayName
(
Locale
locale
,
String
longName
,
String
shortName
)
{
assertEquals
(
c
.
getDisplayName
(
ERA
,
LONG
,
locale
),
longName
);
assertEquals
(
c
.
getDisplayName
(
ERA
,
SHORT
,
locale
),
shortName
);
}
@DataProvider
(
name
=
"JavaTime"
)
Object
[][]
dataJavaTime
()
{
return
new
Object
[][]
{
// locale, full, short
{
JAPAN
,
CJName
,
CJName
},
{
KOREAN
,
KoreanName
,
KoreanName
},
{
CHINA
,
CJName
,
CJName
},
{
TAIWAN
,
CJName
,
CJName
},
{
new
Locale
(
"ar"
),
ArabicName
,
ArabicName
},
{
new
Locale
(
"th"
),
ThaiName
,
ThaiName
},
{
new
Locale
(
"hi"
,
"IN"
),
HindiName
,
HindiName
},
{
new
Locale
(
"ru"
),
RussianName
,
RussianName
},
{
new
Locale
(
"sr"
),
SerbianName
,
SerbianName
},
{
Locale
.
forLanguageTag
(
"sr-Latn"
),
SerbLatinName
,
SerbLatinName
},
{
new
Locale
(
"hr"
),
EngName
,
EngName
},
{
new
Locale
(
"in"
),
EngName
,
EngName
},
{
new
Locale
(
"lt"
),
EngName
,
EngName
},
{
new
Locale
(
"nl"
),
EngName
,
EngName
},
{
new
Locale
(
"no"
),
EngName
,
"R"
},
{
new
Locale
(
"sv"
),
EngName
,
EngName
},
// el fallback to root
{
new
Locale
(
"el"
),
EngName
,
EngName
}
};
}
@Test
(
dataProvider
=
"JavaTime"
)
public
void
testChronoJapanEraDisplayName
(
Locale
locale
,
String
fullName
,
String
shortName
)
{
JapaneseEra
era
=
JapaneseEra
.
valueOf
(
"Reiwa"
);
assertEquals
(
era
.
getDisplayName
(
TextStyle
.
FULL
,
locale
),
fullName
);
assertEquals
(
era
.
getDisplayName
(
TextStyle
.
SHORT
,
locale
),
shortName
);
assertEquals
(
era
.
getDisplayName
(
TextStyle
.
NARROW
,
locale
),
"R"
);
}
@Test
public
void
testFormatParseEraName
()
{
LocalDate
date
=
LocalDate
.
of
(
2019
,
5
,
1
);
DateTimeFormatter
formatter
=
DateTimeFormatter
.
ofPattern
(
"yyyy MM dd GGGG"
);
formatter
=
formatter
.
withChronology
(
JapaneseChronology
.
INSTANCE
);
int
num
=
0
;
for
(
Locale
locale
:
Calendar
.
getAvailableLocales
())
{
formatter
=
formatter
.
withLocale
(
locale
);
try
{
LocalDate
.
parse
(
date
.
format
(
formatter
),
formatter
);
}
catch
(
DateTimeParseException
e
)
{
// If an array is defined for Japanese eras in java.time resource,
// but an era entry is missing, format fallback to English name
// while parse throw DateTimeParseException.
num
++;
System
.
out
.
println
(
"Missing java.time resource data for locale: "
+
locale
);
}
}
if
(
num
>
0
)
{
throw
new
RuntimeException
(
"Missing java.time data for "
+
num
+
" locales"
);
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录