Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
fd0006a0
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看板
提交
fd0006a0
编写于
4月 03, 2019
作者:
N
naoto
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8205432: Replace the placeholder Japanese era name
Reviewed-by: rriggs, chegar
上级
9a3f61f6
变更
27
隐藏空白更改
内联
并排
Showing
27 changed file
with
118 addition
and
93 deletion
+118
-93
make/data/unicodedata/UnicodeData.txt
make/data/unicodedata/UnicodeData.txt
+1
-1
src/share/classes/java/time/chrono/JapaneseEra.java
src/share/classes/java/time/chrono/JapaneseEra.java
+4
-4
src/share/classes/java/util/JapaneseImperialCalendar.java
src/share/classes/java/util/JapaneseImperialCalendar.java
+5
-5
src/share/classes/sun/text/resources/FormatData.java
src/share/classes/sun/text/resources/FormatData.java
+2
-2
src/share/classes/sun/text/resources/JavaTimeSupplementary.java
...are/classes/sun/text/resources/JavaTimeSupplementary.java
+2
-2
src/share/classes/sun/text/resources/ja/FormatData_ja.java
src/share/classes/sun/text/resources/ja/FormatData_ja.java
+1
-1
src/share/classes/sun/text/resources/ja/JavaTimeSupplementary_ja.java
...asses/sun/text/resources/ja/JavaTimeSupplementary_ja.java
+2
-2
src/share/classes/sun/util/calendar/Era.java
src/share/classes/sun/util/calendar/Era.java
+1
-1
src/share/classes/sun/util/cldr/resources/21_0_1/common/main/ja.xml
...classes/sun/util/cldr/resources/21_0_1/common/main/ja.xml
+1
-1
src/share/classes/sun/util/cldr/resources/21_0_1/common/main/root.xml
...asses/sun/util/cldr/resources/21_0_1/common/main/root.xml
+2
-2
src/share/classes/sun/util/locale/provider/CalendarNameProviderImpl.java
...es/sun/util/locale/provider/CalendarNameProviderImpl.java
+2
-2
src/share/lib/calendars.properties
src/share/lib/calendars.properties
+2
-2
test/java/text/Format/DateFormat/WeekDateTest.java
test/java/text/Format/DateFormat/WeekDateTest.java
+2
-2
test/java/time/tck/java/time/chrono/TCKJapaneseChronology.java
...java/time/tck/java/time/chrono/TCKJapaneseChronology.java
+8
-6
test/java/time/tck/java/time/chrono/TCKJapaneseEra.java
test/java/time/tck/java/time/chrono/TCKJapaneseEra.java
+1
-1
test/java/time/test/java/time/chrono/TestJapaneseChronology.java
...va/time/test/java/time/chrono/TestJapaneseChronology.java
+32
-9
test/java/time/test/java/time/chrono/TestUmmAlQuraChronology.java
...a/time/test/java/time/chrono/TestUmmAlQuraChronology.java
+3
-3
test/java/time/test/java/time/format/TestNonIsoFormatter.java
.../java/time/test/java/time/format/TestNonIsoFormatter.java
+1
-1
test/java/util/Calendar/CalendarTestScripts/CalendarAdapter.java
...va/util/Calendar/CalendarTestScripts/CalendarAdapter.java
+2
-2
test/java/util/Calendar/CalendarTestScripts/Symbol.java
test/java/util/Calendar/CalendarTestScripts/Symbol.java
+2
-2
test/java/util/Calendar/CalendarTestScripts/japanese/japanese.cts
...a/util/Calendar/CalendarTestScripts/japanese/japanese.cts
+1
-1
test/java/util/Calendar/CalendarTestScripts/japanese/japanese_add.cts
...il/Calendar/CalendarTestScripts/japanese/japanese_add.cts
+6
-6
test/java/util/Calendar/CalendarTestScripts/japanese/japanese_minmax.cts
...Calendar/CalendarTestScripts/japanese/japanese_minmax.cts
+19
-19
test/java/util/Calendar/CalendarTestScripts/japanese/japanese_roll.cts
...l/Calendar/CalendarTestScripts/japanese/japanese_roll.cts
+8
-8
test/java/util/Calendar/JapaneseEraNameTest.java
test/java/util/Calendar/JapaneseEraNameTest.java
+6
-6
test/java/util/Calendar/JapaneseLenientEraTest.java
test/java/util/Calendar/JapaneseLenientEraTest.java
+1
-1
test/java/util/Calendar/NarrowNamesTest.java
test/java/util/Calendar/NarrowNamesTest.java
+1
-1
未找到文件。
make/data/unicodedata/UnicodeData.txt
浏览文件 @
fd0006a0
...
...
@@ -11408,7 +11408,7 @@
32FC;CIRCLED KATAKANA WI;So;0;L;<circle> 30F0;;;;N;;;;;
32FD;CIRCLED KATAKANA WE;So;0;L;<circle> 30F1;;;;N;;;;;
32FE;CIRCLED KATAKANA WO;So;0;L;<circle> 30F2;;;;N;;;;;
32FF;SQUARE ERA NAME
NEWERA;So;0;L;<square> 5143 53F7;;;;N;SQUARED TWO IDEOGRAPHS ERA NAME NEWER
A;;;;
32FF;SQUARE ERA NAME
REIWA;So;0;L;<square> 4EE4 548C;;;;N;SQUARED TWO IDEOGRAPHS ERA NAME REIW
A;;;;
3300;SQUARE APAATO;So;0;L;<square> 30A2 30D1 30FC 30C8;;;;N;SQUARED APAATO;;;;
3301;SQUARE ARUHUA;So;0;L;<square> 30A2 30EB 30D5 30A1;;;;N;SQUARED ARUHUA;;;;
3302;SQUARE ANPEA;So;0;L;<square> 30A2 30F3 30DA 30A2;;;;N;SQUARED ANPEA;;;;
src/share/classes/java/time/chrono/JapaneseEra.java
浏览文件 @
fd0006a0
...
...
@@ -151,14 +151,14 @@ public final class JapaneseEra
*/
public
static
final
JapaneseEra
HEISEI
=
new
JapaneseEra
(
2
,
LocalDate
.
of
(
1989
,
1
,
8
));
/**
* The singleton instance for the '
NewEra' era (2019-05-01 - current
)
* The singleton instance for the '
Reiwa' era (2019-05-01 -
)
* which has the value 3.
*/
private
static
final
JapaneseEra
NEWER
A
=
new
JapaneseEra
(
3
,
LocalDate
.
of
(
2019
,
5
,
1
));
private
static
final
JapaneseEra
REIW
A
=
new
JapaneseEra
(
3
,
LocalDate
.
of
(
2019
,
5
,
1
));
// The number of predefined JapaneseEra constants.
// There may be a supplemental era defined by the property.
private
static
final
int
N_ERA_CONSTANTS
=
NEWER
A
.
getValue
()
+
ERA_OFFSET
;
private
static
final
int
N_ERA_CONSTANTS
=
REIW
A
.
getValue
()
+
ERA_OFFSET
;
/**
* Serialization version.
...
...
@@ -176,7 +176,7 @@ public final class JapaneseEra
KNOWN_ERAS
[
1
]
=
TAISHO
;
KNOWN_ERAS
[
2
]
=
SHOWA
;
KNOWN_ERAS
[
3
]
=
HEISEI
;
KNOWN_ERAS
[
4
]
=
NEWER
A
;
KNOWN_ERAS
[
4
]
=
REIW
A
;
for
(
int
i
=
N_ERA_CONSTANTS
;
i
<
ERA_CONFIG
.
length
;
i
++)
{
CalendarDate
date
=
ERA_CONFIG
[
i
].
getSinceDate
();
LocalDate
isoDate
=
LocalDate
.
of
(
date
.
getYear
(),
date
.
getMonth
(),
date
.
getDayOfMonth
());
...
...
src/share/classes/java/util/JapaneseImperialCalendar.java
浏览文件 @
fd0006a0
...
...
@@ -50,7 +50,7 @@ import sun.util.calendar.ZoneInfo;
* 2 Taisho 1912-07-30 midnight local time
* 3 Showa 1926-12-25 midnight local time
* 4 Heisei 1989-01-08 midnight local time
* 5
NewEra 2019-05-01 midnight
local time
* 5
Reiwa 2019-05-01T00:00:00
local time
* ------------------------------------------------------
* </tt></pre>
*
...
...
@@ -103,9 +103,9 @@ class JapaneseImperialCalendar extends Calendar {
public
static
final
int
HEISEI
=
4
;
/**
* The ERA constant designating the
NewEr
a era.
* The ERA constant designating the
Reiw
a era.
*/
private
static
final
int
NEWER
A
=
5
;
private
static
final
int
REIW
A
=
5
;
private
static
final
int
EPOCH_OFFSET
=
719163
;
// Fixed date of January 1, 1970 (Gregorian)
private
static
final
int
EPOCH_YEAR
=
1970
;
...
...
@@ -1729,12 +1729,12 @@ class JapaneseImperialCalendar extends Calendar {
}
}
else
if
(
transitionYear
)
{
if
(
jdate
.
getYear
()
==
1
)
{
// As of
NewEr
a (since Meiji) there's no case
// As of
Reiw
a (since Meiji) there's no case
// that there are multiple transitions in a
// year. Historically there was such
// case. There might be such case again in the
// future.
if
(
era
>
NEWER
A
)
{
if
(
era
>
REIW
A
)
{
CalendarDate
pd
=
eras
[
era
-
1
].
getSinceDate
();
if
(
normalizedYear
==
pd
.
getYear
())
{
d
.
setMonth
(
pd
.
getMonth
()).
setDayOfMonth
(
pd
.
getDayOfMonth
());
...
...
src/share/classes/sun/text/resources/FormatData.java
浏览文件 @
fd0006a0
...
...
@@ -106,7 +106,7 @@ public class FormatData extends ParallelListResourceBundle {
"T"
,
"S"
,
"H"
,
"
N"
,
// NewEra
"
R"
,
};
// Japanese imperial calendar era strings
...
...
@@ -116,7 +116,7 @@ public class FormatData extends ParallelListResourceBundle {
"Taisho"
,
"Showa"
,
"Heisei"
,
"
NewEra"
,
// NewEra
"
Reiwa"
,
};
return
new
Object
[][]
{
...
...
src/share/classes/sun/text/resources/JavaTimeSupplementary.java
浏览文件 @
fd0006a0
...
...
@@ -237,7 +237,7 @@ public class JavaTimeSupplementary extends OpenListResourceBundle {
"Taisho"
,
"Showa"
,
"Heisei"
,
"
NewEra"
,
// New Era
"
Reiwa"
,
}
},
{
"java.time.japanese.short.Eras"
,
...
...
@@ -247,7 +247,7 @@ public class JavaTimeSupplementary extends OpenListResourceBundle {
"Taisho"
,
"Showa"
,
"Heisei"
,
"
NewEra"
,
// New Era
"
Reiwa"
,
}
},
{
"java.time.roc.DatePatterns"
,
...
...
src/share/classes/sun/text/resources/ja/FormatData_ja.java
浏览文件 @
fd0006a0
...
...
@@ -91,7 +91,7 @@ public class FormatData_ja extends ParallelListResourceBundle {
"\u5927\u6b63"
,
// Taisho
"\u662d\u548c"
,
// Showa
"\u5e73\u6210"
,
// Heisei
"\u
5143\u53f7"
,
// NewEr
a
"\u
4ee4\u548c"
,
// Reiw
a
};
final
String
[]
rocEras
=
{
"\u6c11\u56fd\u524d"
,
...
...
src/share/classes/sun/text/resources/ja/JavaTimeSupplementary_ja.java
浏览文件 @
fd0006a0
...
...
@@ -198,7 +198,7 @@ public class JavaTimeSupplementary_ja extends OpenListResourceBundle {
"\u5927\u6b63"
,
"\u662d\u548c"
,
"\u5e73\u6210"
,
"\u
5143\u53f7"
,
// NewEra
"\u
4ee4\u548c"
,
}
},
{
"java.time.japanese.short.Eras"
,
...
...
@@ -208,7 +208,7 @@ public class JavaTimeSupplementary_ja extends OpenListResourceBundle {
"\u5927\u6b63"
,
"\u662d\u548c"
,
"\u5e73\u6210"
,
"\u
5143\u53f7"
,
// NewEra
"\u
4ee4\u548c"
,
}
},
{
"java.time.long.Eras"
,
...
...
src/share/classes/sun/util/calendar/Era.java
浏览文件 @
fd0006a0
...
...
@@ -49,7 +49,7 @@ import java.util.TimeZone;
* Taisho 1912-07-30 midnight local time
* Showa 1926-12-26 midnight local time
* Heisei 1989-01-08 midnight local time
*
NewEra 2019-05-01 midnight
local time
*
Reiwa 2019-05-01T00:00:00
local time
* Julian calendar BeforeCommonEra -292275055-05-16T16:47:04.192Z
* CommonEra 0000-12-30 midnight local time
* Taiwanese calendar MinGuo 1911-01-01 midnight local time
...
...
src/share/classes/sun/util/cldr/resources/21_0_1/common/main/ja.xml
浏览文件 @
fd0006a0
...
...
@@ -2410,7 +2410,7 @@
<era
type=
"233"
>
大正
</era>
<era
type=
"234"
>
昭和
</era>
<era
type=
"235"
>
平成
</era>
<era
type=
"236"
>
元号
</era>
<!-- NewEra --
>
<era
type=
"236"
>
令和
</era
>
</eraAbbr>
</eras>
<dateFormats>
...
...
src/share/classes/sun/util/cldr/resources/21_0_1/common/main/root.xml
浏览文件 @
fd0006a0
...
...
@@ -1657,14 +1657,14 @@
<era
type=
"233"
>
Taishō
</era>
<era
type=
"234"
>
Shōwa
</era>
<era
type=
"235"
>
Heisei
</era>
<era
type=
"236"
>
NewEra
</era>
<!-- NewEra --
>
<era
type=
"236"
>
Reiwa
</era
>
</eraAbbr>
<eraNarrow>
<era
type=
"232"
>
M
</era>
<era
type=
"233"
>
T
</era>
<era
type=
"234"
>
S
</era>
<era
type=
"235"
>
H
</era>
<era
type=
"236"
>
N
</era>
<!-- NewEra --
>
<era
type=
"236"
>
R
</era
>
</eraNarrow>
</eras>
<dateFormats>
...
...
src/share/classes/sun/util/locale/provider/CalendarNameProviderImpl.java
浏览文件 @
fd0006a0
...
...
@@ -76,10 +76,10 @@ public class CalendarNameProviderImpl extends CalendarNameProvider implements Av
Era
[]
jeras
=
CalendarSystem
.
forName
(
"japanese"
).
getEras
();
if
(
value
<=
jeras
.
length
)
{
// Localized era name could not be retrieved from this provider.
// This can occur either for
NewEr
a or SupEra.
// This can occur either for
Reiw
a or SupEra.
//
// If it's CLDR provider, try COMPAT first, which is guaranteed to have
// the name for
NewEr
a.
// the name for
Reiw
a.
if
(
type
==
LocaleProviderAdapter
.
Type
.
CLDR
)
{
lr
=
LocaleProviderAdapter
.
forJRE
().
getLocaleResources
(
locale
);
key
=
getResourceKeyFor
(
LocaleProviderAdapter
.
Type
.
JRE
,
...
...
src/share/lib/calendars.properties
浏览文件 @
fd0006a0
...
...
@@ -29,14 +29,14 @@
# Taisho since 1912-07-30 00:00:00 local time (Gregorian)
# Showa since 1926-12-25 00:00:00 local time (Gregorian)
# Heisei since 1989-01-08 00:00:00 local time (Gregorian)
#
NewEra
since 2019-05-01 00:00:00 local time (Gregorian)
#
Reiwa
since 2019-05-01 00:00:00 local time (Gregorian)
calendar.japanese.type
:
LocalGregorianCalendar
calendar.japanese.eras
:
\
name=Meiji,abbr=M,since=-3218832000000;
\
name=Taisho,abbr=T,since=-1812153600000;
\
name=Showa,abbr=S,since=-1357603200000;
\
name=Heisei,abbr=H,since=600220800000;
\
name=
NewEra,abbr=N
,since=1556668800000
name=
Reiwa,abbr=R
,since=1556668800000
#
# Taiwanese calendar
...
...
test/java/text/Format/DateFormat/WeekDateTest.java
浏览文件 @
fd0006a0
...
...
@@ -137,9 +137,9 @@ public class WeekDateTest {
Calendar
jcal
=
Calendar
.
getInstance
(
TimeZone
.
getTimeZone
(
"GMT"
),
new
Locale
(
"ja"
,
"JP"
,
"JP"
));
String
format
=
"2-W01-2"
;
// 2019-12-31 ==
N
1-12-31
String
format
=
"2-W01-2"
;
// 2019-12-31 ==
R
1-12-31
int
expectedYear
=
2019
;
// Check the current era, Heisei or
NewEr
a
// Check the current era, Heisei or
Reiw
a
if
(
System
.
currentTimeMillis
()
<
1556668800000L
)
{
format
=
"21-W01-3"
;
// 2008-12-31 == H20-12-31
expectedYear
=
2008
;
...
...
test/java/time/tck/java/time/chrono/TCKJapaneseChronology.java
浏览文件 @
fd0006a0
...
...
@@ -111,7 +111,9 @@ import org.testng.annotations.Test;
*/
@Test
public
class
TCKJapaneseChronology
{
private
static
final
int
YDIFF_NEWERA
=
2018
;
// Year differences from Gregorian years.
private
static
final
int
YDIFF_REIWA
=
2018
;
private
static
final
int
YDIFF_HEISEI
=
1988
;
private
static
final
int
YDIFF_MEIJI
=
1867
;
private
static
final
int
YDIFF_SHOWA
=
1925
;
...
...
@@ -174,7 +176,7 @@ public class TCKJapaneseChronology {
@DataProvider
(
name
=
"createByEra"
)
Object
[][]
data_createByEra
()
{
return
new
Object
[][]
{
{
JapaneseEra
.
of
(
3
),
2020
-
YDIFF_
NEWERA
,
2
,
29
,
60
,
LocalDate
.
of
(
2020
,
2
,
29
)},
// NEWERA
{
JapaneseEra
.
of
(
3
),
2020
-
YDIFF_
REIWA
,
2
,
29
,
60
,
LocalDate
.
of
(
2020
,
2
,
29
)},
{
JapaneseEra
.
HEISEI
,
1996
-
YDIFF_HEISEI
,
2
,
29
,
60
,
LocalDate
.
of
(
1996
,
2
,
29
)},
{
JapaneseEra
.
HEISEI
,
2000
-
YDIFF_HEISEI
,
2
,
29
,
60
,
LocalDate
.
of
(
2000
,
2
,
29
)},
{
JapaneseEra
.
MEIJI
,
1874
-
YDIFF_MEIJI
,
2
,
28
,
59
,
LocalDate
.
of
(
1874
,
2
,
28
)},
...
...
@@ -367,8 +369,8 @@ public class TCKJapaneseChronology {
@DataProvider
(
name
=
"prolepticYear"
)
Object
[][]
data_prolepticYear
()
{
return
new
Object
[][]
{
{
3
,
JapaneseEra
.
of
(
3
),
1
,
1
+
YDIFF_
NEWERA
,
false
},
// NEWERA
{
3
,
JapaneseEra
.
of
(
3
),
102
,
102
+
YDIFF_
NEWERA
,
true
},
// NEWERA
{
3
,
JapaneseEra
.
of
(
3
),
1
,
1
+
YDIFF_
REIWA
,
false
},
{
3
,
JapaneseEra
.
of
(
3
),
102
,
102
+
YDIFF_
REIWA
,
true
},
{
2
,
JapaneseEra
.
HEISEI
,
1
,
1
+
YDIFF_HEISEI
,
false
},
{
2
,
JapaneseEra
.
HEISEI
,
4
,
4
+
YDIFF_HEISEI
,
true
},
...
...
@@ -553,7 +555,7 @@ public class TCKJapaneseChronology {
{
JapaneseEra
.
TAISHO
,
0
,
"Taisho"
},
{
JapaneseEra
.
SHOWA
,
1
,
"Showa"
},
{
JapaneseEra
.
HEISEI
,
2
,
"Heisei"
},
{
JapaneseEra
.
of
(
3
),
3
,
"
NewEra"
},
// NEWERA
{
JapaneseEra
.
of
(
3
),
3
,
"
Reiwa"
},
};
}
...
...
@@ -689,7 +691,7 @@ public class TCKJapaneseChronology {
{
JapaneseChronology
.
INSTANCE
.
date
(
1989
,
1
,
7
),
"Japanese Showa 64-01-07"
},
{
JapaneseChronology
.
INSTANCE
.
date
(
1989
,
1
,
8
),
"Japanese Heisei 1-01-08"
},
{
JapaneseChronology
.
INSTANCE
.
date
(
2012
,
12
,
6
),
"Japanese Heisei 24-12-06"
},
{
JapaneseChronology
.
INSTANCE
.
date
(
2020
,
1
,
6
),
"Japanese
NewEr
a 2-01-06"
},
{
JapaneseChronology
.
INSTANCE
.
date
(
2020
,
1
,
6
),
"Japanese
Reiw
a 2-01-06"
},
};
}
...
...
test/java/time/tck/java/time/chrono/TCKJapaneseEra.java
浏览文件 @
fd0006a0
...
...
@@ -77,7 +77,7 @@ public class TCKJapaneseEra {
@DataProvider
(
name
=
"JapaneseEras"
)
Object
[][]
data_of_eras
()
{
return
new
Object
[][]
{
{
JapaneseEra
.
of
(
3
),
"
NewEra"
,
3
},
// NEWERA
{
JapaneseEra
.
of
(
3
),
"
Reiwa"
,
3
},
{
JapaneseEra
.
HEISEI
,
"Heisei"
,
2
},
{
JapaneseEra
.
SHOWA
,
"Showa"
,
1
},
{
JapaneseEra
.
TAISHO
,
"Taisho"
,
0
},
...
...
test/java/time/test/java/time/chrono/TestJapaneseChronology.java
浏览文件 @
fd0006a0
...
...
@@ -34,6 +34,7 @@ import java.util.Locale;
import
org.testng.annotations.DataProvider
;
import
org.testng.annotations.Test
;
import
static
org
.
testng
.
Assert
.
assertEquals
;
import
static
org
.
testng
.
Assert
.
assertTrue
;
/**
* Tests for the Japanese chronology
...
...
@@ -59,7 +60,7 @@ public class TestJapaneseChronology {
{
JapaneseEra
.
SHOWA
,
64
,
1
,
7
,
1989
},
{
JapaneseEra
.
HEISEI
,
1
,
1
,
8
,
1989
},
{
JapaneseEra
.
HEISEI
,
31
,
4
,
30
,
2019
},
{
JapaneseEra
.
of
(
3
),
1
,
5
,
1
,
2019
},
// NEWERA
{
JapaneseEra
.
of
(
3
),
1
,
5
,
1
,
2019
},
};
}
...
...
@@ -77,7 +78,7 @@ public class TestJapaneseChronology {
{
JapaneseEra
.
HEISEI
,
1
,
1
,
1
,
8
},
{
JapaneseEra
.
HEISEI
,
2
,
8
,
1
,
8
},
{
JapaneseEra
.
HEISEI
,
31
,
120
,
4
,
30
},
{
JapaneseEra
.
of
(
3
),
1
,
1
,
5
,
1
},
// NEWERA
{
JapaneseEra
.
of
(
3
),
1
,
1
,
5
,
1
},
};
}
...
...
@@ -110,8 +111,8 @@ public class TestJapaneseChronology {
{
JapaneseEra
.
HEISEI
,
1
,
1
,
7
},
{
JapaneseEra
.
HEISEI
,
1
,
2
,
29
},
{
JapaneseEra
.
HEISEI
,
31
,
5
,
1
},
{
JapaneseEra
.
of
(
3
),
1
,
4
,
30
},
// NEWERA
{
JapaneseEra
.
of
(
3
),
Year
.
MAX_VALUE
,
12
,
31
},
// NEWERA
{
JapaneseEra
.
of
(
3
),
1
,
4
,
30
},
{
JapaneseEra
.
of
(
3
),
Year
.
MAX_VALUE
,
12
,
31
},
};
}
...
...
@@ -131,9 +132,9 @@ public class TestJapaneseChronology {
{
JapaneseEra
.
HEISEI
,
-
1
},
{
JapaneseEra
.
HEISEI
,
0
},
{
JapaneseEra
.
HEISEI
,
32
},
{
JapaneseEra
.
of
(
3
),
-
1
},
// NEWERA
{
JapaneseEra
.
of
(
3
),
0
},
// NEWERA
{
JapaneseEra
.
of
(
3
),
Year
.
MAX_VALUE
},
// NEWERA
{
JapaneseEra
.
of
(
3
),
-
1
},
{
JapaneseEra
.
of
(
3
),
0
},
{
JapaneseEra
.
of
(
3
),
Year
.
MAX_VALUE
},
};
}
...
...
@@ -151,8 +152,21 @@ public class TestJapaneseChronology {
{
JapaneseEra
.
HEISEI
,
1
,
360
},
{
JapaneseEra
.
HEISEI
,
2
,
366
},
{
JapaneseEra
.
HEISEI
,
31
,
121
},
{
JapaneseEra
.
of
(
3
),
1
,
246
},
// NEWERA
{
JapaneseEra
.
of
(
3
),
2
,
367
},
// NEWERA
{
JapaneseEra
.
of
(
3
),
1
,
246
},
{
JapaneseEra
.
of
(
3
),
2
,
367
},
};
}
@DataProvider
Object
[][]
eraNameData
()
{
return
new
Object
[][]
{
// Japanese era, name, exception
{
"Meiji"
,
JapaneseEra
.
MEIJI
,
null
},
{
"Taisho"
,
JapaneseEra
.
TAISHO
,
null
},
{
"Showa"
,
JapaneseEra
.
SHOWA
,
null
},
{
"Heisei"
,
JapaneseEra
.
HEISEI
,
null
},
{
"Reiwa"
,
JapaneseEra
.
of
(
3
),
null
},
{
"NewEra"
,
null
,
IllegalArgumentException
.
class
},
};
}
...
...
@@ -204,4 +218,13 @@ public class TestJapaneseChronology {
JapaneseDate
date
=
JAPANESE
.
dateYearDay
(
era
,
yearOfEra
,
dayOfYear
);
System
.
out
.
printf
(
"No DateTimeException with era=%s, year=%d, dayOfYear=%d%n"
,
era
,
yearOfEra
,
dayOfYear
);
}
@Test
(
dataProvider
=
"eraNameData"
)
public
void
test_eraName
(
String
eraName
,
JapaneseEra
era
,
Class
expectedEx
)
{
try
{
assertEquals
(
JapaneseEra
.
valueOf
(
eraName
),
era
);
}
catch
(
Exception
ex
)
{
assertTrue
(
expectedEx
.
isInstance
(
ex
));
}
}
}
test/java/time/test/java/time/chrono/TestUmmAlQuraChronology.java
浏览文件 @
fd0006a0
...
...
@@ -776,9 +776,9 @@ public class TestUmmAlQuraChronology {
{
HijrahDate
.
of
(
1434
,
5
,
1
),
"Japanese Heisei 25-03-13"
},
{
HijrahDate
.
of
(
1436
,
1
,
1
),
"Japanese Heisei 26-10-25"
},
{
HijrahDate
.
of
(
1440
,
8
,
25
),
"Japanese Heisei 31-04-30"
},
{
HijrahDate
.
of
(
1440
,
8
,
26
),
"Japanese
NewEr
a 1-05-01"
},
{
HijrahDate
.
of
(
1500
,
6
,
12
),
"Japanese
NewEr
a 59-05-05"
},
{
HijrahDate
.
of
(
1550
,
3
,
11
),
"Japanese
NewEr
a 107-08-11"
},
{
HijrahDate
.
of
(
1440
,
8
,
26
),
"Japanese
Reiw
a 1-05-01"
},
{
HijrahDate
.
of
(
1500
,
6
,
12
),
"Japanese
Reiw
a 59-05-05"
},
{
HijrahDate
.
of
(
1550
,
3
,
11
),
"Japanese
Reiw
a 107-08-11"
},
};
}
...
...
test/java/time/test/java/time/format/TestNonIsoFormatter.java
浏览文件 @
fd0006a0
...
...
@@ -142,7 +142,7 @@ public class TestNonIsoFormatter {
// Chronology, lenient era/year, strict era/year
{
JAPANESE
,
"Meiji 123"
,
"Heisei 2"
},
{
JAPANESE
,
"Showa 65"
,
"Heisei 2"
},
{
JAPANESE
,
"Heisei 32"
,
"
NewEra 2"
},
// NewEra
{
JAPANESE
,
"Heisei 32"
,
"
Reiwa 2"
},
};
}
...
...
test/java/util/Calendar/CalendarTestScripts/CalendarAdapter.java
浏览文件 @
fd0006a0
/*
* Copyright (c) 2007, 201
8
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 201
9
, 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
...
...
@@ -364,7 +364,7 @@ public class CalendarAdapter extends Calendar {
"Taisho"
,
"Showa"
,
"Heisei"
,
"
NewEr
a"
"
Reiw
a"
};
break
;
}
...
...
test/java/util/Calendar/CalendarTestScripts/Symbol.java
浏览文件 @
fd0006a0
/*
* Copyright (c) 2007, 201
8
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 201
9
, 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
...
...
@@ -322,7 +322,7 @@ public class Symbol {
put
(
"taisho"
,
new
Symbol
(
Type
.
ERA
,
2
));
put
(
"showa"
,
new
Symbol
(
Type
.
ERA
,
3
));
put
(
"heisei"
,
new
Symbol
(
Type
.
ERA
,
4
));
put
(
"
newer
a"
,
new
Symbol
(
Type
.
ERA
,
5
));
put
(
"
reiw
a"
,
new
Symbol
(
Type
.
ERA
,
5
));
}
}
test/java/util/Calendar/CalendarTestScripts/japanese/japanese.cts
浏览文件 @
fd0006a0
...
...
@@ -57,7 +57,7 @@ test Default dates
check millisecond 0
clear all
set era
NewEr
a
set era
Reiw
a
check era Heisei
check datetime 31 Jan 1 0 0 0
check millisecond 0
...
...
test/java/util/Calendar/CalendarTestScripts/japanese/japanese_add.cts
浏览文件 @
fd0006a0
...
...
@@ -16,10 +16,10 @@ set non-lenient
test add ERA
use jcal
clear all
set date
NewEr
a 17 Mar 8
set date
Reiw
a 17 Mar 8
add era 10
# as of
NewEr
a 17 March 8
check era
NewEr
a
# as of
Reiw
a 17 March 8
check era
Reiw
a
add era -100
check era BeforeMeiji
...
...
@@ -342,12 +342,12 @@ test add MONTH
check date BeforeMeiji $minyear May 18
check timeofday 1 47 4 191
set date
NewEr
a 17 Jan 1
set date
Reiw
a 17 Jan 1
get max year
assign $result $max
set date
NewEr
a $max Jul 17
set date
Reiw
a $max Jul 17
add month 1
check date
NewEr
a $max Aug 17
check date
Reiw
a $max Aug 17
# set date Heisei $max Jul 28
# set timeofday 23 59 59 999
# add month 1
...
...
test/java/util/Calendar/CalendarTestScripts/japanese/japanese_minmax.cts
浏览文件 @
fd0006a0
...
...
@@ -14,10 +14,10 @@ new instance tokyocal
test Make sure that the maximum year value doesn't depent on era
use jcal
# Note: the max year value is as of
NewEr
a
# Note: the max year value is as of
Reiw
a
assign 292276976 $max
clear all
set date
NewEr
a 1 May 1
set date
Reiw
a 1 May 1
get millis
check max year $max
assign $max $maxyear
...
...
@@ -39,9 +39,9 @@ test Make sure that the maximum year value doesn't depent on era
test Max of ERA
use jcal
# Assumption:
NewEr
a is the current era
check maximum era
NewEr
a
check leastmax era
NewEr
a
# Assumption:
Reiw
a is the current era
check maximum era
Reiw
a
check leastmax era
Reiw
a
test Actual max MONTH
use jcal
...
...
@@ -78,7 +78,7 @@ test Actual max MONTH
check actualmax month Apr
clear all
set date
NewEr
a 2 Jan 1
set date
Reiw
a 2 Jan 1
set year $maxyear
check actualmax month Aug
get millis
...
...
@@ -133,8 +133,8 @@ test Actual max DAY_OF_YEAR
# time zone dependent
use tokyocal
clear all
set date
NewEr
a $maxyear Jan 1
# the last date of
NewEra is N
292276976.08.17T16:12:55.807+0900
set date
Reiw
a $maxyear Jan 1
# the last date of
Reiwa is R
292276976.08.17T16:12:55.807+0900
check actualmax day_of_year 229 # 31+28+31+30+31+30+31+17
test Actual max WEEK_OF_YEAR
...
...
@@ -165,12 +165,12 @@ test Actual max WEEK_OF_YEAR
clear all
set date Heisei 31 Apr 28
check actualmax week_of_year 17
set date
NewEr
a 1 Aug 9
set date
Reiw
a 1 Aug 9
check actualmax week_of_year 35
use tokyocal
set date
NewEr
a $maxyear Jan 1
# the last date of
NewEra is N
292276976.08.17T16:12:55.807+0900 (Sunday)
set date
Reiw
a $maxyear Jan 1
# the last date of
Reiwa is R
292276976.08.17T16:12:55.807+0900 (Sunday)
# The year is equivalent to 2003 (Gregorian).
check actualmax week_of_year 34
...
...
@@ -197,12 +197,12 @@ test Actual max WEEK_OF_MONTH
clear all
set date Heisei 31 Apr 30
check actualmax week_of_month 5
set date
NewEr
a 1 May 1
set date
Reiw
a 1 May 1
check actualmax week_of_month 5
use tokyocal
set date
NewEr
a $maxyear Jan 1
# the last date of
NewEra is N
292276976.08.17T16:12:55.807+0900 (Sunday)
set date
Reiw
a $maxyear Jan 1
# the last date of
Reiwa is R
292276976.08.17T16:12:55.807+0900 (Sunday)
# The year is equivalent to 2003 (Gregorian).
check actualmax week_of_month 4
...
...
@@ -229,13 +229,13 @@ test Actual max DAY_OF_WEEK_IN_MONTH
clear all
set date Heisei 31 Apr 30
check actualmax week_of_month 5
set date
NewEr
a 1 May 1
set date
Reiw
a 1 May 1
check actualmax week_of_month 5
use tokyocal
clear all
set date
NewEr
a $maxyear Jan 1
# the last date of
NewEra is N
292276976.08.17T16:12:55.807+0900 (Sunday)
set date
Reiw
a $maxyear Jan 1
# the last date of
Reiwa is R
292276976.08.17T16:12:55.807+0900 (Sunday)
# The year is equivalent to 2003 (Gregorian).
check actualmax week_of_month 4
...
...
@@ -269,11 +269,11 @@ test Actual max YEAR
set date Heisei 1 Aug 18
check actualmax year 30
set date
NewEr
a 1 Apr 30
set date
Reiw
a 1 Apr 30
check actualmax year 31
# Date/time beyond the last date in the max year.
set date
NewEr
a 1 Aug 18
set date
Reiw
a 1 Aug 18
check actualmax year 292276975
test Least max YEAR
...
...
test/java/util/Calendar/CalendarTestScripts/japanese/japanese_roll.cts
浏览文件 @
fd0006a0
...
...
@@ -147,13 +147,13 @@ test roll YEAR
roll year -1
check date Heisei 31 Apr 30
set date
NewEr
a 2 Apr 30
set date
Reiw
a 2 Apr 30
get max year
assign $result $hmax
roll year -1
check date
NewEr
a $hmax Apr 30
check date
Reiw
a $hmax Apr 30
roll year 1
check date
NewEr
a 2 Apr 30
check date
Reiw
a 2 Apr 30
test roll MONTH
set date BeforeMeiji 1867 Dec 1
...
...
@@ -276,16 +276,16 @@ test roll MONTH
check date BeforeMeiji $minyear May 18
check timeofday 1 47 4 191
set date
NewEr
a 17 Jan 1
set date
Reiw
a 17 Jan 1
get max year
assign $result $max
set date
NewEr
a $max Jul 28
set date
Reiw
a $max Jul 28
roll month 1
check date
NewEr
a $max Aug 17
set date
NewEr
a $max Jul 28
check date
Reiw
a $max Aug 17
set date
Reiw
a $max Jul 28
set timeofday 23 59 59 999
roll month 1
check date
NewEr
a $max Aug 16
check date
Reiw
a $max Aug 16
check timeofday 23 59 59 999
test roll WEEK_OF_YEAR
...
...
test/java/util/Calendar/JapaneseEraNameTest.java
浏览文件 @
fd0006a0
...
...
@@ -47,12 +47,12 @@ public class JapaneseEraNameTest {
// Since the test fails for below particular data
// on prior 8u versions for all eras, commenting it
// temporarily. Will be fixed as part of JDK-8220020.
// { LONG,
JAPAN, "\u5143\u53f7
" },
{
LONG
,
US
,
"NewEr
a"
},
{
LONG
,
CHINA
,
"NewEr
a"
},
{
SHORT
,
JAPAN
,
"\u5143\u53f7"
},
// NewEra
{
SHORT
,
US
,
"NewEr
a"
},
{
SHORT
,
CHINA
,
"N
"
},
// { LONG,
JAPAN, "\u4ee4\u548c
" },
{
LONG
,
US
,
"Reiw
a"
},
{
LONG
,
CHINA
,
"Reiw
a"
},
{
SHORT
,
JAPAN
,
"\u4ee4\u548c"
},
{
SHORT
,
US
,
"Reiw
a"
},
{
SHORT
,
CHINA
,
"R
"
},
};
public
static
void
main
(
String
[]
args
)
{
...
...
test/java/util/Calendar/JapaneseLenientEraTest.java
浏览文件 @
fd0006a0
...
...
@@ -47,7 +47,7 @@ public class JapaneseLenientEraTest {
// lenient era/year, strict era/year
{
"Meiji 123"
,
"Heisei 2"
},
{
"Showa 65"
,
"Heisei 2"
},
{
"Heisei 32"
,
"
NewEra 2"
},
// NewEra
{
"Heisei 32"
,
"
Reiwa 2"
},
};
}
...
...
test/java/util/Calendar/NarrowNamesTest.java
浏览文件 @
fd0006a0
...
...
@@ -48,7 +48,7 @@ public class NarrowNamesTest {
HOUR_OF_DAY
,
23
);
test
(
JAJPJP
,
DAY_OF_WEEK
,
LocalDateTime
.
now
().
isBefore
(
LocalDateTime
.
of
(
2019
,
5
,
1
,
0
,
0
))
?
"\u65e5"
:
"\u706b"
,
// "Sun" for HEISEI, "Tue" for
NEWER
A
"\u65e5"
:
"\u706b"
,
// "Sun" for HEISEI, "Tue" for
REIW
A
YEAR
,
24
,
MONTH
,
DECEMBER
,
DAY_OF_MONTH
,
23
);
test
(
THTH
,
MONTH
,
NARROW_STANDALONE
,
"\u0e18.\u0e04."
,
YEAR
,
2555
,
MONTH
,
DECEMBER
,
DAY_OF_MONTH
,
5
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录