Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
9694304e
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看板
提交
9694304e
编写于
5月 15, 2013
作者:
V
valeriep
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
0321af12
71006342
变更
183
展开全部
隐藏空白更改
内联
并排
Showing
183 changed file
with
7140 addition
and
2223 deletion
+7140
-2223
make/sun/javazic/tzdata/VERSION
make/sun/javazic/tzdata/VERSION
+1
-1
make/sun/javazic/tzdata/africa
make/sun/javazic/tzdata/africa
+92
-8
make/sun/javazic/tzdata/antarctica
make/sun/javazic/tzdata/antarctica
+3
-45
make/sun/javazic/tzdata/asia
make/sun/javazic/tzdata/asia
+80
-40
make/sun/javazic/tzdata/australasia
make/sun/javazic/tzdata/australasia
+30
-6
make/sun/javazic/tzdata/europe
make/sun/javazic/tzdata/europe
+123
-6
make/sun/javazic/tzdata/northamerica
make/sun/javazic/tzdata/northamerica
+37
-21
make/sun/javazic/tzdata/southamerica
make/sun/javazic/tzdata/southamerica
+43
-27
make/sun/javazic/tzdata/zone.tab
make/sun/javazic/tzdata/zone.tab
+5
-2
make/sun/nio/cs/Makefile
make/sun/nio/cs/Makefile
+1
-9
make/tools/src/build/tools/cldrconverter/CLDRConverter.java
make/tools/src/build/tools/cldrconverter/CLDRConverter.java
+17
-0
makefiles/CreateJars.gmk
makefiles/CreateJars.gmk
+1
-3
src/share/classes/java/lang/ProcessBuilder.java
src/share/classes/java/lang/ProcessBuilder.java
+2
-3
src/share/classes/java/lang/StringBuffer.java
src/share/classes/java/lang/StringBuffer.java
+45
-2
src/share/classes/java/net/HttpURLConnection.java
src/share/classes/java/net/HttpURLConnection.java
+12
-0
src/share/classes/java/net/HttpURLPermission.java
src/share/classes/java/net/HttpURLPermission.java
+406
-0
src/share/classes/java/net/ServerSocket.java
src/share/classes/java/net/ServerSocket.java
+32
-29
src/share/classes/java/net/Socket.java
src/share/classes/java/net/Socket.java
+81
-61
src/share/classes/java/nio/charset/Charset.java
src/share/classes/java/nio/charset/Charset.java
+26
-32
src/share/classes/java/time/Clock.java
src/share/classes/java/time/Clock.java
+16
-6
src/share/classes/java/time/DateTimeException.java
src/share/classes/java/time/DateTimeException.java
+1
-1
src/share/classes/java/time/DayOfWeek.java
src/share/classes/java/time/DayOfWeek.java
+1
-1
src/share/classes/java/time/Duration.java
src/share/classes/java/time/Duration.java
+1
-1
src/share/classes/java/time/Instant.java
src/share/classes/java/time/Instant.java
+52
-39
src/share/classes/java/time/LocalDate.java
src/share/classes/java/time/LocalDate.java
+10
-10
src/share/classes/java/time/LocalDateTime.java
src/share/classes/java/time/LocalDateTime.java
+10
-10
src/share/classes/java/time/LocalTime.java
src/share/classes/java/time/LocalTime.java
+10
-14
src/share/classes/java/time/Month.java
src/share/classes/java/time/Month.java
+1
-1
src/share/classes/java/time/MonthDay.java
src/share/classes/java/time/MonthDay.java
+1
-1
src/share/classes/java/time/OffsetDateTime.java
src/share/classes/java/time/OffsetDateTime.java
+8
-8
src/share/classes/java/time/OffsetTime.java
src/share/classes/java/time/OffsetTime.java
+8
-8
src/share/classes/java/time/Period.java
src/share/classes/java/time/Period.java
+1
-1
src/share/classes/java/time/Ser.java
src/share/classes/java/time/Ser.java
+1
-1
src/share/classes/java/time/Year.java
src/share/classes/java/time/Year.java
+8
-8
src/share/classes/java/time/YearMonth.java
src/share/classes/java/time/YearMonth.java
+8
-8
src/share/classes/java/time/ZoneId.java
src/share/classes/java/time/ZoneId.java
+1
-1
src/share/classes/java/time/ZoneOffset.java
src/share/classes/java/time/ZoneOffset.java
+1
-1
src/share/classes/java/time/ZoneRegion.java
src/share/classes/java/time/ZoneRegion.java
+1
-1
src/share/classes/java/time/ZonedDateTime.java
src/share/classes/java/time/ZonedDateTime.java
+8
-8
src/share/classes/java/time/chrono/ChronoDateImpl.java
src/share/classes/java/time/chrono/ChronoDateImpl.java
+3
-3
src/share/classes/java/time/chrono/ChronoLocalDate.java
src/share/classes/java/time/chrono/ChronoLocalDate.java
+9
-8
src/share/classes/java/time/chrono/ChronoLocalDateTime.java
src/share/classes/java/time/chrono/ChronoLocalDateTime.java
+3
-1
src/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java
...are/classes/java/time/chrono/ChronoLocalDateTimeImpl.java
+3
-3
src/share/classes/java/time/chrono/ChronoZonedDateTime.java
src/share/classes/java/time/chrono/ChronoZonedDateTime.java
+3
-1
src/share/classes/java/time/chrono/ChronoZonedDateTimeImpl.java
...are/classes/java/time/chrono/ChronoZonedDateTimeImpl.java
+3
-3
src/share/classes/java/time/chrono/Chronology.java
src/share/classes/java/time/chrono/Chronology.java
+3
-10
src/share/classes/java/time/chrono/Era.java
src/share/classes/java/time/chrono/Era.java
+1
-1
src/share/classes/java/time/chrono/HijrahChronology.java
src/share/classes/java/time/chrono/HijrahChronology.java
+116
-83
src/share/classes/java/time/chrono/HijrahDate.java
src/share/classes/java/time/chrono/HijrahDate.java
+1
-1
src/share/classes/java/time/chrono/HijrahEra.java
src/share/classes/java/time/chrono/HijrahEra.java
+1
-1
src/share/classes/java/time/chrono/IsoChronology.java
src/share/classes/java/time/chrono/IsoChronology.java
+7
-2
src/share/classes/java/time/chrono/IsoEra.java
src/share/classes/java/time/chrono/IsoEra.java
+1
-1
src/share/classes/java/time/chrono/JapaneseChronology.java
src/share/classes/java/time/chrono/JapaneseChronology.java
+40
-26
src/share/classes/java/time/chrono/JapaneseDate.java
src/share/classes/java/time/chrono/JapaneseDate.java
+20
-1
src/share/classes/java/time/chrono/JapaneseEra.java
src/share/classes/java/time/chrono/JapaneseEra.java
+1
-1
src/share/classes/java/time/chrono/MinguoChronology.java
src/share/classes/java/time/chrono/MinguoChronology.java
+1
-1
src/share/classes/java/time/chrono/MinguoDate.java
src/share/classes/java/time/chrono/MinguoDate.java
+1
-1
src/share/classes/java/time/chrono/MinguoEra.java
src/share/classes/java/time/chrono/MinguoEra.java
+1
-1
src/share/classes/java/time/chrono/Ser.java
src/share/classes/java/time/chrono/Ser.java
+1
-1
src/share/classes/java/time/chrono/ThaiBuddhistChronology.java
...hare/classes/java/time/chrono/ThaiBuddhistChronology.java
+1
-1
src/share/classes/java/time/chrono/ThaiBuddhistDate.java
src/share/classes/java/time/chrono/ThaiBuddhistDate.java
+1
-1
src/share/classes/java/time/chrono/ThaiBuddhistEra.java
src/share/classes/java/time/chrono/ThaiBuddhistEra.java
+1
-1
src/share/classes/java/time/format/DateTimeFormatter.java
src/share/classes/java/time/format/DateTimeFormatter.java
+179
-23
src/share/classes/java/time/format/DateTimeFormatterBuilder.java
...re/classes/java/time/format/DateTimeFormatterBuilder.java
+367
-131
src/share/classes/java/time/format/DateTimeParseContext.java
src/share/classes/java/time/format/DateTimeParseContext.java
+20
-8
src/share/classes/java/time/format/DateTimeParseException.java
...hare/classes/java/time/format/DateTimeParseException.java
+1
-1
src/share/classes/java/time/format/DateTimePrintContext.java
src/share/classes/java/time/format/DateTimePrintContext.java
+7
-7
src/share/classes/java/time/format/DateTimeTextProvider.java
src/share/classes/java/time/format/DateTimeTextProvider.java
+1
-1
src/share/classes/java/time/format/DecimalStyle.java
src/share/classes/java/time/format/DecimalStyle.java
+41
-34
src/share/classes/java/time/format/FormatStyle.java
src/share/classes/java/time/format/FormatStyle.java
+1
-1
src/share/classes/java/time/format/Parsed.java
src/share/classes/java/time/format/Parsed.java
+132
-36
src/share/classes/java/time/format/ResolverStyle.java
src/share/classes/java/time/format/ResolverStyle.java
+5
-5
src/share/classes/java/time/format/SignStyle.java
src/share/classes/java/time/format/SignStyle.java
+1
-1
src/share/classes/java/time/format/TextStyle.java
src/share/classes/java/time/format/TextStyle.java
+1
-1
src/share/classes/java/time/format/package-info.java
src/share/classes/java/time/format/package-info.java
+1
-1
src/share/classes/java/time/temporal/ChronoField.java
src/share/classes/java/time/temporal/ChronoField.java
+76
-1
src/share/classes/java/time/temporal/ChronoUnit.java
src/share/classes/java/time/temporal/ChronoUnit.java
+1
-1
src/share/classes/java/time/temporal/IsoFields.java
src/share/classes/java/time/temporal/IsoFields.java
+1
-1
src/share/classes/java/time/temporal/JulianFields.java
src/share/classes/java/time/temporal/JulianFields.java
+1
-1
src/share/classes/java/time/temporal/Temporal.java
src/share/classes/java/time/temporal/Temporal.java
+16
-24
src/share/classes/java/time/temporal/TemporalAccessor.java
src/share/classes/java/time/temporal/TemporalAccessor.java
+6
-6
src/share/classes/java/time/temporal/TemporalAdjuster.java
src/share/classes/java/time/temporal/TemporalAdjuster.java
+4
-4
src/share/classes/java/time/temporal/TemporalAmount.java
src/share/classes/java/time/temporal/TemporalAmount.java
+5
-5
src/share/classes/java/time/temporal/TemporalField.java
src/share/classes/java/time/temporal/TemporalField.java
+1
-1
src/share/classes/java/time/temporal/TemporalQuery.java
src/share/classes/java/time/temporal/TemporalQuery.java
+2
-2
src/share/classes/java/time/temporal/TemporalUnit.java
src/share/classes/java/time/temporal/TemporalUnit.java
+8
-10
src/share/classes/java/time/temporal/UnsupportedTemporalTypeException.java
.../java/time/temporal/UnsupportedTemporalTypeException.java
+1
-1
src/share/classes/java/time/temporal/ValueRange.java
src/share/classes/java/time/temporal/ValueRange.java
+1
-1
src/share/classes/java/time/temporal/WeekFields.java
src/share/classes/java/time/temporal/WeekFields.java
+30
-34
src/share/classes/java/time/zone/Ser.java
src/share/classes/java/time/zone/Ser.java
+1
-1
src/share/classes/java/time/zone/ZoneOffsetTransition.java
src/share/classes/java/time/zone/ZoneOffsetTransition.java
+1
-1
src/share/classes/java/time/zone/ZoneOffsetTransitionRule.java
...hare/classes/java/time/zone/ZoneOffsetTransitionRule.java
+1
-1
src/share/classes/java/time/zone/ZoneRules.java
src/share/classes/java/time/zone/ZoneRules.java
+1
-1
src/share/classes/java/time/zone/ZoneRulesException.java
src/share/classes/java/time/zone/ZoneRulesException.java
+1
-1
src/share/classes/java/time/zone/ZoneRulesProvider.java
src/share/classes/java/time/zone/ZoneRulesProvider.java
+1
-1
src/share/classes/java/util/Base64.java
src/share/classes/java/util/Base64.java
+8
-2
src/share/classes/java/util/JapaneseImperialCalendar.java
src/share/classes/java/util/JapaneseImperialCalendar.java
+7
-4
src/share/classes/java/util/Objects.java
src/share/classes/java/util/Objects.java
+29
-1
src/share/classes/sun/net/www/MessageHeader.java
src/share/classes/sun/net/www/MessageHeader.java
+12
-6
src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java
.../classes/sun/net/www/protocol/http/HttpURLConnection.java
+205
-9
src/share/classes/sun/nio/cs/ext/ISO2022_JP_2.java
src/share/classes/sun/nio/cs/ext/ISO2022_JP_2.java
+8
-8
src/share/classes/sun/nio/cs/ext/META-INF/services/java.nio.charset.spi.CharsetProvider
...xt/META-INF/services/java.nio.charset.spi.CharsetProvider
+0
-2
src/share/classes/sun/nio/cs/ext/MSISO2022JP.java
src/share/classes/sun/nio/cs/ext/MSISO2022JP.java
+8
-7
src/share/classes/sun/util/calendar/LocalGregorianCalendar.java
...are/classes/sun/util/calendar/LocalGregorianCalendar.java
+8
-8
src/share/classes/sun/util/calendar/ZoneInfoFile.java
src/share/classes/sun/util/calendar/ZoneInfoFile.java
+6
-1
src/share/classes/sun/util/resources/TimeZoneNames.java
src/share/classes/sun/util/resources/TimeZoneNames.java
+9
-2
src/share/classes/sun/util/resources/de/TimeZoneNames_de.java
...share/classes/sun/util/resources/de/TimeZoneNames_de.java
+6
-2
src/share/classes/sun/util/resources/es/TimeZoneNames_es.java
...share/classes/sun/util/resources/es/TimeZoneNames_es.java
+6
-2
src/share/classes/sun/util/resources/fr/TimeZoneNames_fr.java
...share/classes/sun/util/resources/fr/TimeZoneNames_fr.java
+6
-2
src/share/classes/sun/util/resources/it/TimeZoneNames_it.java
...share/classes/sun/util/resources/it/TimeZoneNames_it.java
+6
-2
src/share/classes/sun/util/resources/ja/TimeZoneNames_ja.java
...share/classes/sun/util/resources/ja/TimeZoneNames_ja.java
+6
-2
src/share/classes/sun/util/resources/ko/TimeZoneNames_ko.java
...share/classes/sun/util/resources/ko/TimeZoneNames_ko.java
+6
-2
src/share/classes/sun/util/resources/pt/TimeZoneNames_pt_BR.java
...re/classes/sun/util/resources/pt/TimeZoneNames_pt_BR.java
+6
-2
src/share/classes/sun/util/resources/sv/TimeZoneNames_sv.java
...share/classes/sun/util/resources/sv/TimeZoneNames_sv.java
+6
-2
src/share/classes/sun/util/resources/zh/TimeZoneNames_zh_CN.java
...re/classes/sun/util/resources/zh/TimeZoneNames_zh_CN.java
+6
-2
src/share/classes/sun/util/resources/zh/TimeZoneNames_zh_TW.java
...re/classes/sun/util/resources/zh/TimeZoneNames_zh_TW.java
+6
-2
src/share/sample/scripting/scriptpad/src/com/sun/sample/scriptpad/Main.java
...cripting/scriptpad/src/com/sun/sample/scriptpad/Main.java
+2
-2
src/share/sample/scripting/scriptpad/src/resources/Main.js
src/share/sample/scripting/scriptpad/src/resources/Main.js
+1
-3
src/share/sample/scripting/scriptpad/src/resources/conc.js
src/share/sample/scripting/scriptpad/src/resources/conc.js
+92
-33
src/share/sample/scripting/scriptpad/src/resources/gui.js
src/share/sample/scripting/scriptpad/src/resources/gui.js
+37
-29
src/share/sample/scripting/scriptpad/src/resources/mm.js
src/share/sample/scripting/scriptpad/src/resources/mm.js
+16
-20
src/share/sample/scripting/scriptpad/src/resources/scriptpad.js
...are/sample/scripting/scriptpad/src/resources/scriptpad.js
+512
-510
src/share/sample/scripting/scriptpad/src/scripts/browse.js
src/share/sample/scripting/scriptpad/src/scripts/browse.js
+17
-21
src/share/sample/scripting/scriptpad/src/scripts/insertfile.js
...hare/sample/scripting/scriptpad/src/scripts/insertfile.js
+7
-4
src/share/sample/scripting/scriptpad/src/scripts/linewrap.js
src/share/sample/scripting/scriptpad/src/scripts/linewrap.js
+5
-9
src/share/sample/scripting/scriptpad/src/scripts/mail.js
src/share/sample/scripting/scriptpad/src/scripts/mail.js
+15
-18
src/share/sample/scripting/scriptpad/src/scripts/memmonitor.js
...hare/sample/scripting/scriptpad/src/scripts/memmonitor.js
+9
-8
src/share/sample/scripting/scriptpad/src/scripts/memory.js
src/share/sample/scripting/scriptpad/src/scripts/memory.js
+5
-7
src/share/sample/scripting/scriptpad/src/scripts/memory.sh
src/share/sample/scripting/scriptpad/src/scripts/memory.sh
+0
-4
src/share/sample/scripting/scriptpad/src/scripts/textcolor.js
...share/sample/scripting/scriptpad/src/scripts/textcolor.js
+2
-3
src/windows/classes/java/lang/ProcessImpl.java
src/windows/classes/java/lang/ProcessImpl.java
+130
-42
test/java/lang/Runtime/exec/ExecCommand.java
test/java/lang/Runtime/exec/ExecCommand.java
+163
-0
test/java/lang/StringBuffer/ToStringCache.java
test/java/lang/StringBuffer/ToStringCache.java
+289
-0
test/java/net/HttpURLPermission/HttpURLPermissionTest.java
test/java/net/HttpURLPermission/HttpURLPermissionTest.java
+203
-0
test/java/net/HttpURLPermission/URLTest.java
test/java/net/HttpURLPermission/URLTest.java
+240
-0
test/java/net/HttpURLPermission/policy.1
test/java/net/HttpURLPermission/policy.1
+48
-0
test/java/net/HttpURLPermission/policy.2
test/java/net/HttpURLPermission/policy.2
+46
-0
test/java/net/HttpURLPermission/policy.3
test/java/net/HttpURLPermission/policy.3
+48
-0
test/java/time/tck/java/time/TCKInstant.java
test/java/time/tck/java/time/TCKInstant.java
+40
-34
test/java/time/tck/java/time/TCKLocalTime.java
test/java/time/tck/java/time/TCKLocalTime.java
+1
-17
test/java/time/tck/java/time/TCKOffsetTime.java
test/java/time/tck/java/time/TCKOffsetTime.java
+57
-0
test/java/time/tck/java/time/TCKYear.java
test/java/time/tck/java/time/TCKYear.java
+127
-0
test/java/time/tck/java/time/TCKYearMonth.java
test/java/time/tck/java/time/TCKYearMonth.java
+202
-0
test/java/time/tck/java/time/TCKZoneOffset.java
test/java/time/tck/java/time/TCKZoneOffset.java
+41
-0
test/java/time/tck/java/time/chrono/TCKChronology.java
test/java/time/tck/java/time/chrono/TCKChronology.java
+9
-24
test/java/time/tck/java/time/chrono/TCKChronologySerialization.java
...time/tck/java/time/chrono/TCKChronologySerialization.java
+0
-1
test/java/time/tck/java/time/chrono/TCKHijrahChronology.java
test/java/time/tck/java/time/chrono/TCKHijrahChronology.java
+28
-1
test/java/time/tck/java/time/chrono/TCKJapaneseChronology.java
...java/time/tck/java/time/chrono/TCKJapaneseChronology.java
+33
-2
test/java/time/tck/java/time/chrono/TCKThaiBuddhistChronology.java
.../time/tck/java/time/chrono/TCKThaiBuddhistChronology.java
+32
-0
test/java/time/tck/java/time/format/TCKDateTimeFormatter.java
.../java/time/tck/java/time/format/TCKDateTimeFormatter.java
+43
-41
test/java/time/tck/java/time/format/TCKDateTimeFormatters.java
...java/time/tck/java/time/format/TCKDateTimeFormatters.java
+56
-0
test/java/time/tck/java/time/format/TCKDateTimeParseResolver.java
...a/time/tck/java/time/format/TCKDateTimeParseResolver.java
+353
-0
test/java/time/tck/java/time/format/TCKDecimalStyle.java
test/java/time/tck/java/time/format/TCKDecimalStyle.java
+28
-27
test/java/time/tck/java/time/format/TCKInstantPrinterParser.java
...va/time/tck/java/time/format/TCKInstantPrinterParser.java
+286
-0
test/java/time/tck/java/time/format/TCKTextStyle.java
test/java/time/tck/java/time/format/TCKTextStyle.java
+1
-1
test/java/time/tck/java/time/temporal/TCKWeekFields.java
test/java/time/tck/java/time/temporal/TCKWeekFields.java
+22
-7
test/java/time/test/java/time/chrono/TestChronologyPerf.java
test/java/time/test/java/time/chrono/TestChronologyPerf.java
+15
-1
test/java/time/test/java/time/chrono/TestExampleCode.java
test/java/time/test/java/time/chrono/TestExampleCode.java
+5
-6
test/java/time/test/java/time/chrono/TestJapaneseChronology.java
...va/time/test/java/time/chrono/TestJapaneseChronology.java
+202
-0
test/java/time/test/java/time/format/AbstractTestPrinterParser.java
...time/test/java/time/format/AbstractTestPrinterParser.java
+11
-11
test/java/time/test/java/time/format/TestDateTimeFormatter.java
...ava/time/test/java/time/format/TestDateTimeFormatter.java
+2
-2
test/java/time/test/java/time/format/TestDateTimeFormatterBuilder.java
...e/test/java/time/format/TestDateTimeFormatterBuilder.java
+116
-5
test/java/time/test/java/time/format/TestDecimalStyle.java
test/java/time/test/java/time/format/TestDecimalStyle.java
+7
-7
test/java/time/test/java/time/format/TestFractionPrinterParser.java
...time/test/java/time/format/TestFractionPrinterParser.java
+1
-1
test/java/time/test/java/time/format/TestNonIsoFormatter.java
.../java/time/test/java/time/format/TestNonIsoFormatter.java
+3
-3
test/java/time/test/java/time/format/TestNumberParser.java
test/java/time/test/java/time/format/TestNumberParser.java
+35
-35
test/java/time/test/java/time/format/TestReducedParser.java
test/java/time/test/java/time/format/TestReducedParser.java
+194
-30
test/java/time/test/java/time/format/TestReducedPrinter.java
test/java/time/test/java/time/format/TestReducedPrinter.java
+105
-58
test/java/time/test/java/time/format/TestZoneTextPrinterParser.java
...time/test/java/time/format/TestZoneTextPrinterParser.java
+4
-4
test/java/util/Base64/TestBase64.java
test/java/util/Base64/TestBase64.java
+9
-0
test/java/util/Locale/LocaleProviders.java
test/java/util/Locale/LocaleProviders.java
+50
-10
test/java/util/Locale/LocaleProviders.sh
test/java/util/Locale/LocaleProviders.sh
+1
-1
test/java/util/Objects/BasicObjectsTest.java
test/java/util/Objects/BasicObjectsTest.java
+35
-29
test/sun/util/calendar/zi/Rule.java
test/sun/util/calendar/zi/Rule.java
+2
-1
test/sun/util/calendar/zi/tzdata/VERSION
test/sun/util/calendar/zi/tzdata/VERSION
+1
-1
test/sun/util/calendar/zi/tzdata/africa
test/sun/util/calendar/zi/tzdata/africa
+92
-8
test/sun/util/calendar/zi/tzdata/antarctica
test/sun/util/calendar/zi/tzdata/antarctica
+3
-45
test/sun/util/calendar/zi/tzdata/asia
test/sun/util/calendar/zi/tzdata/asia
+80
-40
test/sun/util/calendar/zi/tzdata/australasia
test/sun/util/calendar/zi/tzdata/australasia
+30
-6
test/sun/util/calendar/zi/tzdata/europe
test/sun/util/calendar/zi/tzdata/europe
+123
-6
test/sun/util/calendar/zi/tzdata/northamerica
test/sun/util/calendar/zi/tzdata/northamerica
+37
-21
test/sun/util/calendar/zi/tzdata/southamerica
test/sun/util/calendar/zi/tzdata/southamerica
+43
-27
test/sun/util/calendar/zi/tzdata/zone.tab
test/sun/util/calendar/zi/tzdata/zone.tab
+5
-2
未找到文件。
make/sun/javazic/tzdata/VERSION
浏览文件 @
9694304e
...
...
@@ -21,4 +21,4 @@
# or visit www.oracle.com if you need additional information or have any
# questions.
#
tzdata201
2i
tzdata201
3c
make/sun/javazic/tzdata/africa
浏览文件 @
9694304e
...
...
@@ -27,9 +27,9 @@
# This data is by no means authoritative; if you think you know better,
# go ahead and edit the file (and please send any changes to
# tz@
elsie.nci.nih.gov
for general use in the future).
# tz@
iana.org
for general use in the future).
# From Paul Eggert (20
06-03-22
):
# From Paul Eggert (20
13-02-21
):
#
# A good source for time zone historical data outside the U.S. is
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
...
...
@@ -48,6 +48,10 @@
# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which
# I found in the UCLA library.
#
# For data circa 1899, a common source is:
# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
# <http://www.jstor.org/stable/1774359>.
#
# A reliable and entertaining source about time zones is
# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
#
...
...
@@ -139,8 +143,12 @@ Zone Africa/Porto-Novo 0:10:28 - LMT 1912
1:00 - WAT
# Botswana
# From Paul Eggert (2013-02-21):
# Milne says they were regulated by the Cape Town Signal in 1899;
# assume they switched to 2:00 when Cape Town did.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Gaborone 1:43:40 - LMT 1885
1:30 - SAST 1903 Mar
2:00 - CAT 1943 Sep 19 2:00
2:00 1:00 CAST 1944 Mar 19 2:00
2:00 - CAT
...
...
@@ -212,6 +220,11 @@ Zone Africa/Djibouti 2:52:36 - LMT 1911 Jul
# Egypt
# Milne says Cairo used 2:05:08.9, the local mean time of the Abbasizeh
# observatory; round to nearest. Milne also says that the official time for
# Egypt was mean noon at the Great Pyramid, 2:04:30.5, but apparently this
# did not apply to Cairo, Alexandria, or Port Said.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Egypt 1940 only - Jul 15 0:00 1:00 S
Rule Egypt 1940 only - Oct 1 0:00 0 -
...
...
@@ -352,7 +365,7 @@ Rule Egypt 2010 only - Sep 10 0:00 1:00 S
Rule Egypt 2010 only - Sep lastThu 23:00s 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Cairo 2:05:0
0
- LMT 1900 Oct
Zone Africa/Cairo 2:05:0
9
- LMT 1900 Oct
2:00 Egypt EE%sT
# Equatorial Guinea
...
...
@@ -447,6 +460,20 @@ Zone Africa/Monrovia -0:43:08 - LMT 1882
# Libya
# From Even Scharning (2012-11-10):
# Libya set their time one hour back at 02:00 on Saturday November 10.
# http://www.libyaherald.com/2012/11/04/clocks-to-go-back-an-hour-on-saturday/
# Here is an official source [in Arabic]: http://ls.ly/fb6Yc
#
# Steffen Thorsen forwarded a translation (2012-11-10) in
# http://mm.icann.org/pipermail/tz/2012-November/018451.html
#
# From Tim Parenti (2012-11-11):
# Treat the 2012-11-10 change as a zone change from UTC+2 to UTC+1.
# The DST rules planned for 2013 and onward roughly mirror those of Europe
# (either two days before them or five days after them, so as to fall on
# lastFri instead of lastSun).
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Libya 1951 only - Oct 14 2:00 1:00 S
Rule Libya 1952 only - Jan 1 0:00 0 -
...
...
@@ -461,17 +488,21 @@ Rule Libya 1986 only - Apr 4 0:00 1:00 S
Rule Libya 1986 only - Oct 3 0:00 0 -
Rule Libya 1987 1989 - Apr 1 0:00 1:00 S
Rule Libya 1987 1989 - Oct 1 0:00 0 -
Rule Libya 1997 only - Apr 4 0:00 1:00 S
Rule Libya 1997 only - Oct 4 0:00 0 -
Rule Libya 2013 max - Mar lastFri 1:00 1:00 S
Rule Libya 2013 max - Oct lastFri 2:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Tripoli 0:52:44 - LMT 1920
1:00 Libya CE%sT 1959
2:00 - EET 1982
1:00 Libya CE%sT 1990 May 4
# The
following
entries are from Shanks & Pottenger;
# The
1996 and 1997
entries are from Shanks & Pottenger;
# the IATA SSIM data contain some obvious errors.
2:00 - EET 1996 Sep 30
1:00
- CET 1997 Apr
4
1:00 1:00 CEST 1997 Oct 4
2:00 - EE
T
1:00
Libya CE%sT 1997 Oct
4
2:00 - EET 2012 Nov 10 2:00
1:00 Libya CE%s
T
# Madagascar
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
...
...
@@ -838,6 +869,41 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou
# 3:00 am Friday, July 20, 2012 and will again be advanced by 60 minutes
# August 20, 2012 from 2:00 am.
# From Paul Eggert (2013-03-06):
# Morocco's daylight-saving transitions due to Ramadan seem to be
# announced a bit in advance. On 2012-07-11 the Moroccan government
# announced that year's Ramadan daylight-saving transitions would be
# 2012-07-20 and 2012-08-20; see
# <http://www.mmsp.gov.ma/fr/actualites.aspx?id=288>.
#
# To estimate what the Moroccan government will do in future years,
# transition dates for 2013 through 2021 were determined by running
# the following program under GNU Emacs 24.3:
#
# (let ((islamic-year 1434))
# (while (< islamic-year 1444)
# (let ((a
# (calendar-gregorian-from-absolute
# (calendar-islamic-to-absolute (list 9 1 islamic-year))))
# (b
# (calendar-gregorian-from-absolute
# (calendar-islamic-to-absolute (list 10 1 islamic-year)))))
# (insert
# (format
# (concat "Rule\tMorocco\t%d\tonly\t-\t%s\t %2d\t 3:00\t0\t-\n"
# "Rule\tMorocco\t%d\tonly\t-\t%s\t %2d\t 2:00\t1:00\tS\n")
# (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a))
# (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b)))))
# (setq islamic-year (+ 1 islamic-year))))
#
# with the results hand-edited for 2020-2022, when the normal spring-forward
# date falls during the estimated Ramadan.
#
# From 2023 through 2038 Ramadan is not predicted to overlap with
# daylight saving time. Starting in 2039 there will be overlap again,
# but 32-bit time_t values roll around in 2038 so for now do not worry
# about dates after 2038.
# RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Morocco 1939 only - Sep 12 0:00 1:00 S
...
...
@@ -863,10 +929,28 @@ Rule Morocco 2010 only - May 2 0:00 1:00 S
Rule Morocco 2010 only - Aug 8 0:00 0 -
Rule Morocco 2011 only - Apr 3 0:00 1:00 S
Rule Morocco 2011 only - Jul 31 0 0 -
Rule Morocco 2012
max
- Apr lastSun 2:00 1:00 S
Rule Morocco 2012
2019
- Apr lastSun 2:00 1:00 S
Rule Morocco 2012 max - Sep lastSun 3:00 0 -
Rule Morocco 2012 only - Jul 20 3:00 0 -
Rule Morocco 2012 only - Aug 20 2:00 1:00 S
Rule Morocco 2013 only - Jul 9 3:00 0 -
Rule Morocco 2013 only - Aug 8 2:00 1:00 S
Rule Morocco 2014 only - Jun 29 3:00 0 -
Rule Morocco 2014 only - Jul 29 2:00 1:00 S
Rule Morocco 2015 only - Jun 18 3:00 0 -
Rule Morocco 2015 only - Jul 18 2:00 1:00 S
Rule Morocco 2016 only - Jun 7 3:00 0 -
Rule Morocco 2016 only - Jul 7 2:00 1:00 S
Rule Morocco 2017 only - May 27 3:00 0 -
Rule Morocco 2017 only - Jun 26 2:00 1:00 S
Rule Morocco 2018 only - May 16 3:00 0 -
Rule Morocco 2018 only - Jun 15 2:00 1:00 S
Rule Morocco 2019 only - May 6 3:00 0 -
Rule Morocco 2019 only - Jun 5 2:00 1:00 S
Rule Morocco 2020 only - May 24 2:00 1:00 S
Rule Morocco 2021 only - May 13 2:00 1:00 S
Rule Morocco 2022 only - May 3 2:00 1:00 S
Rule Morocco 2023 max - Apr lastSun 2:00 1:00 S
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26
...
...
make/sun/javazic/tzdata/antarctica
浏览文件 @
9694304e
...
...
@@ -73,38 +73,8 @@ Rule ChileAQ 2009 only - Mar Sun>=9 3:00u 0 -
Rule ChileAQ 2010 only - Apr Sun>=1 3:00u 0 -
Rule ChileAQ 2011 only - May Sun>=2 3:00u 0 -
Rule ChileAQ 2011 only - Aug Sun>=16 4:00u 1:00 S
Rule ChileAQ 2012 only - Apr Sun>=23 3:00u 0 -
Rule ChileAQ 2012 only - Sep Sun>=2 4:00u 1:00 S
Rule ChileAQ 2013 max - Mar Sun>=9 3:00u 0 -
Rule ChileAQ 2013 max - Oct Sun>=9 4:00u 1:00 S
# These rules are stolen from the `australasia' file.
Rule AusAQ 1917 only - Jan 1 0:01 1:00 -
Rule AusAQ 1917 only - Mar 25 2:00 0 -
Rule AusAQ 1942 only - Jan 1 2:00 1:00 -
Rule AusAQ 1942 only - Mar 29 2:00 0 -
Rule AusAQ 1942 only - Sep 27 2:00 1:00 -
Rule AusAQ 1943 1944 - Mar lastSun 2:00 0 -
Rule AusAQ 1943 only - Oct 3 2:00 1:00 -
Rule ATAQ 1967 only - Oct Sun>=1 2:00s 1:00 -
Rule ATAQ 1968 only - Mar lastSun 2:00s 0 -
Rule ATAQ 1968 1985 - Oct lastSun 2:00s 1:00 -
Rule ATAQ 1969 1971 - Mar Sun>=8 2:00s 0 -
Rule ATAQ 1972 only - Feb lastSun 2:00s 0 -
Rule ATAQ 1973 1981 - Mar Sun>=1 2:00s 0 -
Rule ATAQ 1982 1983 - Mar lastSun 2:00s 0 -
Rule ATAQ 1984 1986 - Mar Sun>=1 2:00s 0 -
Rule ATAQ 1986 only - Oct Sun>=15 2:00s 1:00 -
Rule ATAQ 1987 1990 - Mar Sun>=15 2:00s 0 -
Rule ATAQ 1987 only - Oct Sun>=22 2:00s 1:00 -
Rule ATAQ 1988 1990 - Oct lastSun 2:00s 1:00 -
Rule ATAQ 1991 1999 - Oct Sun>=1 2:00s 1:00 -
Rule ATAQ 1991 2005 - Mar lastSun 2:00s 0 -
Rule ATAQ 2000 only - Aug lastSun 2:00s 1:00 -
Rule ATAQ 2001 max - Oct Sun>=1 2:00s 1:00 -
Rule ATAQ 2006 only - Apr Sun>=1 2:00s 0 -
Rule ATAQ 2007 only - Mar lastSun 2:00s 0 -
Rule ATAQ 2008 max - Apr Sun>=1 2:00s 0 -
Rule ChileAQ 2012 max - Apr Sun>=23 3:00u 0 -
Rule ChileAQ 2012 max - Sep Sun>=2 4:00u 1:00 S
# Argentina - year-round bases
# Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05
...
...
@@ -147,10 +117,7 @@ Rule ATAQ 2008 max - Apr Sun>=1 2:00s 0 -
# </a>
# From Steffen Thorsen (2010-03-10):
# We got these changes from the Australian Antarctic Division:
# - Macquarie Island will stay on UTC+11 for winter and therefore not
# switch back from daylight savings time when other parts of Australia do
# on 4 April.
# We got these changes from the Australian Antarctic Division: ...
#
# - Casey station reverted to its normal time of UTC+8 on 5 March 2010.
# The change to UTC+11 is being considered as a regular summer thing but
...
...
@@ -161,9 +128,6 @@ Rule ATAQ 2008 max - Apr Sun>=1 2:00s 0 -
#
# - Mawson station stays on UTC+5.
#
# In addition to the Rule changes for Casey/Davis, it means that Macquarie
# will no longer be like Hobart and will have to have its own Zone created.
#
# Background:
# <a href="http://www.timeanddate.com/news/time/antartica-time-changes-2010.html">
# http://www.timeanddate.com/news/time/antartica-time-changes-2010.html
...
...
@@ -190,12 +154,6 @@ Zone Antarctica/Mawson 0 - zzz 1954 Feb 13
6:00 - MAWT 2009 Oct 18 2:00
# Mawson Time
5:00 - MAWT
Zone Antarctica/Macquarie 0 - zzz 1911
10:00 - EST 1916 Oct 1 2:00
10:00 1:00 EST 1917 Feb
10:00 AusAQ EST 1967
10:00 ATAQ EST 2010 Apr 4 3:00
11:00 - MIST # Macquarie Island Time
# References:
# <a href="http://www.antdiv.gov.au/aad/exop/sfo/casey/casey_aws.html">
# Casey Weather (1998-02-26)
...
...
make/sun/javazic/tzdata/asia
浏览文件 @
9694304e
...
...
@@ -27,9 +27,9 @@
# This data is by no means authoritative; if you think you know better,
# go ahead and edit the file (and please send any changes to
# tz@
elsie.nci.nih.gov
for general use in the future).
# tz@
iana.org
for general use in the future).
# From Paul Eggert (20
06-03-22
):
# From Paul Eggert (20
13-02-21
):
#
# A good source for time zone historical data outside the U.S. is
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
...
...
@@ -48,6 +48,10 @@
# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which
# I found in the UCLA library.
#
# For data circa 1899, a common source is:
# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
# <http://www.jstor.org/stable/1774359>.
#
# A reliable and entertaining source about time zones is
# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
#
...
...
@@ -302,9 +306,12 @@ Zone Asia/Brunei 7:39:40 - LMT 1926 Mar # Bandar Seri Begawan
8:00 - BNT
# Burma / Myanmar
# Milne says 6:24:40 was the meridian of the time ball observatory at Rangoon.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Rangoon 6:24:40 - LMT 1880 # or Yangon
6:24:
36
- RMT 1920 # Rangoon Mean Time?
6:24:
40
- RMT 1920 # Rangoon Mean Time?
6:30 - BURT 1942 May # Burma Time
9:00 - JST 1945 May 3
6:30 - MMT # Myanmar Time
...
...
@@ -407,7 +414,8 @@ Zone Asia/Harbin 8:26:44 - LMT 1928 # or Haerbin
8:00 PRC C%sT
# Zhongyuan Time ("Central plain Time")
# most of China
Zone Asia/Shanghai 8:05:52 - LMT 1928
# Milne gives 8:05:56.7; round to nearest.
Zone Asia/Shanghai 8:05:57 - LMT 1928
8:00 Shang C%sT 1949
8:00 PRC C%sT
# Long-shu Time (probably due to Long and Shu being two names of that area)
...
...
@@ -504,6 +512,10 @@ Zone Asia/Kashgar 5:03:56 - LMT 1928 # or Kashi or Kaxgar
8:00 PRC C%sT
# Hong Kong (Xianggang)
# Milne gives 7:36:41.7; round this.
# From Lee Yiu Chung (2009-10-24):
# I found there are some mistakes for the...DST rule for Hong
# Kong. [According] to the DST record from Hong Kong Observatory (actually,
...
...
@@ -570,7 +582,6 @@ Zone Asia/Kashgar 5:03:56 - LMT 1928 # or Kashi or Kaxgar
# The Japanese surrender of Hong Kong was signed 1945-09-15.
# For lack of anything better, use start of those days as the transition times.
# Hong Kong (Xianggang)
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule HK 1941 only - Apr 1 3:30 1:00 S
Rule HK 1941 only - Sep 30 3:30 0 -
...
...
@@ -592,7 +603,7 @@ Rule HK 1973 only - Dec 30 3:30 1:00 S
Rule HK 1979 only - May Sun>=8 3:30 1:00 S
Rule HK 1979 only - Oct Sun>=16 3:30 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Hong_Kong 7:36:
36
- LMT 1904 Oct 30
Zone Asia/Hong_Kong 7:36:
42
- LMT 1904 Oct 30
8:00 HK HK%sT 1941 Dec 25
9:00 - JST 1945 Sep 15
8:00 HK HK%sT
...
...
@@ -669,6 +680,9 @@ Zone Asia/Macau 7:34:20 - LMT 1912
###############################################################################
# Cyprus
#
# Milne says the Eastern Telegraph Company used 2:14:00. Stick with LMT.
#
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Cyprus 1975 only - Apr 13 0:00 1:00 S
Rule Cyprus 1975 only - Oct 12 0:00 0 -
...
...
@@ -1222,7 +1236,6 @@ Rule Zion 2012 only - Mar Fri>=26 2:00 1:00 D
Rule Zion 2012 only - Sep 23 2:00 0 S
# From Ephraim Silverberg (2012-10-18):
# Yesterday, the Interior Ministry Committee, after more than a year
# past, approved sending the proposed June 2011 changes to the Time
# Decree Law back to the Knesset for second and third (final) votes
...
...
@@ -1235,6 +1248,10 @@ Rule Zion 2012 only - Sep 23 2:00 0 S
# later (i.e. at 02:00 the first Monday after October 2).
# [Rosh Hashana holidays are factored in until 2100.]
# From Ephraim Silverberg (2012-11-05):
# The Knesset passed today (in second and final readings) the amendment to the
# Time Decree Law making the changes ... law.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Zion 2013 max - Mar Fri>=23 2:00 1:00 D
Rule Zion 2013 2026 - Oct Sun>=2 2:00 0 S
...
...
@@ -1824,8 +1841,11 @@ Zone Asia/Kathmandu 5:41:16 - LMT 1920
5:45 - NPT # Nepal Time
# Oman
# Milne says 3:54:24 was the meridian of the Muscat Tidal Observatory.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Muscat 3:54:2
0
- LMT 1920
Zone Asia/Muscat 3:54:2
4
- LMT 1920
4:00 - GST
# Pakistan
...
...
@@ -2072,8 +2092,7 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
# occurred before our cutoff date of 1970.
# However, as we get more information, we may need to add entries
# for parts of the West Bank as they transitioned from Israel's rules
# to Palestine's rules. If you have more info about this, please
# send it to tz@elsie.nci.nih.gov for incorporation into future editions.
# to Palestine's rules.
# From IINS News Service - Israel - 1998-03-23 10:38:07 Israel time,
# forwarded by Ephraim Silverberg:
...
...
@@ -2295,11 +2314,20 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
# http://www.timeanddate.com/news/time/gaza-west-bank-dst-2012.html
# </a>
# From Arthur David Olson (2012-03-27):
# The timeanddate article for 2012 says that "the end date has not yet been
# announced" and that "Last year, both...paused daylight saving time during...
# Ramadan. It is not yet known [for] 2012."
# For now, assume both switch back on the last Friday in September. XXX
# From Steffen Thorsen (2013-03-26):
# The following news sources tells that Palestine will "start daylight saving
# time from midnight on Friday, March 29, 2013" (translated).
# [These are in Arabic and are for Gaza and for Ramallah, respectively.]
# http://www.samanews.com/index.php?act=Show&id=154120
# http://safa.ps/details/news/99844/%D8%B1%D8%A7%D9%85-%D8%A7%D9%84%D9%84%D9%87-%D8%A8%D8%AF%D8%A1-%D8%A7%D9%84%D8%AA%D9%88%D9%82%D9%8A%D8%AA-%D8%A7%D9%84%D8%B5%D9%8A%D9%81%D9%8A-29-%D8%A7%D9%84%D8%AC%D8%A7%D8%B1%D9%8A.html
# From Paul Eggert (2013-04-15):
# For future dates, guess the last Thursday in March at 24:00 through
# the first Friday on or after September 21 at 01:00. This is consistent with
# the predictions in today's editions of the following URLs,
# which are for Gaza and Hebron respectively:
# http://www.timeanddate.com/worldclock/timezone.html?n=702
# http://www.timeanddate.com/worldclock/timezone.html?n=2364
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule EgyptAsia 1957 only - May 10 0:00 1:00 S
...
...
@@ -2313,19 +2341,20 @@ Rule Palestine 1999 2005 - Apr Fri>=15 0:00 1:00 S
Rule Palestine 1999 2003 - Oct Fri>=15 0:00 0 -
Rule Palestine 2004 only - Oct 1 1:00 0 -
Rule Palestine 2005 only - Oct 4 2:00 0 -
Rule Palestine 2006 200
8
- Apr 1 0:00 1:00 S
Rule Palestine 2006 200
7
- Apr 1 0:00 1:00 S
Rule Palestine 2006 only - Sep 22 0:00 0 -
Rule Palestine 2007 only - Sep Thu>=8 2:00 0 -
Rule Palestine 2008
only - Aug lastFri 0:00 0 -
Rule Palestine 200
9 only - Mar lastFri 0:00 1:00 S
Rule Palestine 2009 only - Sep Fri>=1
2
:00 0 -
Rule Palestine 2010 only - Mar
lastSat 0:01
1:00 S
Rule Palestine 2008
2009 - Mar lastFri 0:00 1:00 S
Rule Palestine 200
8 only - Sep 1 0:00 0 -
Rule Palestine 2009 only - Sep Fri>=1
1
:00 0 -
Rule Palestine 2010 only - Mar
26 0:00
1:00 S
Rule Palestine 2010 only - Aug 11 0:00 0 -
# From Arthur David Olson (2011-09-20):
# 2011 transitions per http://www.timeanddate.com as of 2011-09-20.
# From Paul Eggert (2012-10-12):
# 2012 transitions per http://www.timeanddate.com as of 2012-10-12.
Rule Palestine 2011 only - Apr 1 0:01 1:00 S
Rule Palestine 2011 only - Aug 1 0:00 0 -
Rule Palestine 2011 only - Aug 30 0:00 1:00 S
Rule Palestine 2011 only - Sep 30 0:00 0 -
Rule Palestine 2012 max - Mar lastThu 24:00 1:00 S
Rule Palestine 2012 max - Sep Fri>=21 1:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Gaza 2:17:52 - LMT 1900 Oct
...
...
@@ -2333,26 +2362,20 @@ Zone Asia/Gaza 2:17:52 - LMT 1900 Oct
2:00 EgyptAsia EE%sT 1967 Jun 5
2:00 Zion I%sT 1996
2:00 Jordan EE%sT 1999
2:00 Palestine EE%sT 2011 Apr 2 12:01
2:00 1:00 EEST 2011 Aug 1
2:00 - EET 2012 Mar 30
2:00 1:00 EEST 2012 Sep 21 1:00
2:00 - EET
2:00 Palestine EE%sT 2008 Aug 29 0:00
2:00 - EET 2008 Sep
2:00 Palestine EE%sT 2010
2:00 - EET 2010 Mar 27 0:01
2:00 Palestine EE%sT 2011 Aug 1
2:00 - EET 2012
2:00 Palestine EE%sT
Zone Asia/Hebron 2:20:23 - LMT 1900 Oct
2:00 Zion EET 1948 May 15
2:00 EgyptAsia EE%sT 1967 Jun 5
2:00 Zion I%sT 1996
2:00 Jordan EE%sT 1999
2:00 Palestine EE%sT 2008 Aug
2:00 1:00 EEST 2008 Sep
2:00 Palestine EE%sT 2011 Apr 1 12:01
2:00 1:00 EEST 2011 Aug 1
2:00 - EET 2011 Aug 30
2:00 1:00 EEST 2011 Sep 30 3:00
2:00 - EET 2012 Mar 30
2:00 1:00 EEST 2012 Sep 21 1:00
2:00 - EET
2:00 Palestine EE%sT
# Paracel Is
# no information
...
...
@@ -2421,6 +2444,13 @@ Zone Asia/Singapore 6:55:25 - LMT 1901 Jan 1
# no information
# Sri Lanka
# From Paul Eggert (2013-02-21):
# Milne says "Madras mean time use from May 1, 1898. Prior to this Colombo
# mean time, 5h. 4m. 21.9s. F., was used." But 5:04:21.9 differs considerably
# from Colombo's meridian 5:19:24, so for now ignore Milne and stick with
# Shanks and Pottenger.
# From Paul Eggert (1996-09-03):
# "Sri Lanka advances clock by an hour to avoid blackout"
# (www.virtual-pc.com/lankaweb/news/items/240596-2.html, 1996-05-24,
...
...
@@ -2720,6 +2750,12 @@ Zone Asia/Tashkent 4:37:12 - LMT 1924 May 2
# Vietnam
# From Paul Eggert (2013-02-21):
# Milne gives 7:16:56 for the meridian of Saigon in 1899, as being
# used in Lower Laos, Cambodia, and Annam. But this is quite a ways
# from Saigon's location. For now, ignore this and stick with Shanks
# and Pottenger.
# From Arthur David Olson (2008-03-18):
# The English-language name of Vietnam's most populous city is "Ho Chi Min City";
# we use Ho_Chi_Minh below to avoid a name of more than 14 characters.
...
...
@@ -2733,6 +2769,10 @@ Zone Asia/Ho_Chi_Minh 7:06:40 - LMT 1906 Jun 9
7:00 - ICT
# Yemen
# Milne says 2:59:54 was the meridian of the saluting battery at Aden,
# and that Yemen was at 1:55:56, the meridian of the Hagia Sophia.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Aden
3:00:48
- LMT 1950
Zone Asia/Aden
2:59:54
- LMT 1950
3:00 - AST
make/sun/javazic/tzdata/australasia
浏览文件 @
9694304e
...
...
@@ -241,9 +241,26 @@ Zone Australia/Lord_Howe 10:36:20 - LMT 1895 Feb
# no times are set
#
# Macquarie
# permanent occupation (scientific station) since 1948;
# sealing and penguin oil station operated 1888/1917
# like Australia/Hobart
# Permanent occupation (scientific station) 1911-1915 and since 25 March 1948;
# sealing and penguin oil station operated Nov 1899 to Apr 1919. See the
# Tasmania Parks & Wildlife Service history of sealing at Macquarie Island
# <http://www.parks.tas.gov.au/index.aspx?base=1828>
# <http://www.parks.tas.gov.au/index.aspx?base=1831>.
# Guess that it was like Australia/Hobart while inhabited before 2010.
#
# From Steffen Thorsen (2010-03-10):
# We got these changes from the Australian Antarctic Division:
# - Macquarie Island will stay on UTC+11 for winter and therefore not
# switch back from daylight savings time when other parts of Australia do
# on 4 April.
Zone Antarctica/Macquarie 0 - zzz 1899 Nov
10:00 - EST 1916 Oct 1 2:00
10:00 1:00 EST 1917 Feb
10:00 Aus EST 1919 Apr
0 - zzz 1948 Mar 25
10:00 Aus EST 1967
10:00 AT EST 2010 Apr 4 3:00
11:00 - MIST # Macquarie I Standard Time
# Christmas
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
...
...
@@ -269,6 +286,9 @@ Zone Indian/Cocos 6:27:40 - LMT 1900
6:30 - CCT # Cocos Islands Time
# Fiji
# Milne gives 11:55:44 for Suva.
# From Alexander Krivenyshev (2009-11-10):
# According to Fiji Broadcasting Corporation, Fiji plans to re-introduce DST
# from November 29th 2009 to April 25th 2010.
...
...
@@ -362,7 +382,7 @@ Rule Fiji 2010 max - Oct Sun>=18 2:00 1:00 S
Rule Fiji 2011 only - Mar Sun>=1 3:00 0 -
Rule Fiji 2012 max - Jan Sun>=18 3:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Pacific/Fiji 11:5
3:40
- LMT 1915 Oct 26 # Suva
Zone Pacific/Fiji 11:5
5:44
- LMT 1915 Oct 26 # Suva
12:00 Fiji FJ%sT # Fiji Time
# French Polynesia
...
...
@@ -803,9 +823,9 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# This data is by no means authoritative; if you think you know better,
# go ahead and edit the file (and please send any changes to
# tz@
elsie.nci.nih.gov
for general use in the future).
# tz@
iana.org
for general use in the future).
# From Paul Eggert (20
06-03-22
):
# From Paul Eggert (20
13-02-21
):
# A good source for time zone historical data outside the U.S. is
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
# San Diego: ACS Publications, Inc. (2003).
...
...
@@ -823,6 +843,10 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which
# I found in the UCLA library.
#
# For data circa 1899, a common source is:
# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
# <http://www.jstor.org/stable/1774359>.
#
# A reliable and entertaining source about time zones is
# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
#
...
...
make/sun/javazic/tzdata/europe
浏览文件 @
9694304e
...
...
@@ -27,7 +27,7 @@
# This data is by no means authoritative; if you think you know better,
# go ahead and edit the file (and please send any changes to
# tz@
elsie.nci.nih.gov
for general use in the future).
# tz@
iana.org
for general use in the future).
# From Paul Eggert (2006-03-22):
# A good source for time zone historical data outside the U.S. is
...
...
@@ -53,6 +53,12 @@
# William Willett, The Waste of Daylight, 19th edition
# </a> (1914-03)
#
# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
# <http://www.jstor.org/stable/1774359>. He writes:
# "It is requested that corrections and additions to these tables
# may be sent to Mr. John Milne, Royal Geographical Society,
# Savile Row, London." Nowadays please email them to tz@iana.org.
#
# Brazil's Departamento Servico da Hora (DSH),
# <a href="http://pcdsh01.on.br/HISTHV.htm">
# History of Summer Time
...
...
@@ -689,6 +695,8 @@ Zone Europe/Andorra 0:06:04 - LMT 1901
# Austria
# Milne says Vienna time was 1:05:21.
# From Paul Eggert (2006-03-22): Shanks & Pottenger give 1918-06-16 and
# 1945-11-18, but the Austrian Federal Office of Metrology and
# Surveying (BEV) gives 1918-09-16 and for Vienna gives the "alleged"
...
...
@@ -706,7 +714,7 @@ Rule Austria 1948 only - Apr 18 2:00s 1:00 S
Rule Austria 1980 only - Apr 6 0:00 1:00 S
Rule Austria 1980 only - Sep 28 0:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Europe/Vienna 1:05:2
0
- LMT 1893 Apr
Zone Europe/Vienna 1:05:2
1
- LMT 1893 Apr
1:00 C-Eur CE%sT 1920
1:00 Austria CE%sT 1940 Apr 1 2:00s
1:00 C-Eur CE%sT 1945 Apr 2 2:00s
...
...
@@ -1262,6 +1270,21 @@ Zone Europe/Berlin 0:53:28 - LMT 1893 Apr
1:00 Germany CE%sT 1980
1:00 EU CE%sT
# From Tobias Conradi (2011-09-12):
# Busingen <http://www.buesingen.de>, surrounded by the Swiss canton
# Schaffhausen, did not start observing DST in 1980 as the rest of DE
# (West Germany at that time) and DD (East Germany at that time) did.
# DD merged into DE, the area is currently covered by code DE in ISO 3166-1,
# which in turn is covered by the zone Europe/Berlin.
#
# Source for the time in Busingen 1980:
# http://www.srf.ch/player/video?id=c012c029-03b7-4c2b-9164-aa5902cd58d3
# From Arthur David Olson (2012-03-03):
# Busingen and Zurich have shared clocks since 1970.
Link Europe/Zurich Europe/Busingen
# Georgia
# Please see the "asia" file for Asia/Tbilisi.
# Herodotus (Histories, IV.45) says Georgia north of the Phasis (now Rioni)
...
...
@@ -2066,6 +2089,70 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct
# Russia
# From Alexander Krivenyshev (2011-09-15):
# Based on last Russian Government Decree # 725 on August 31, 2011
# (Government document
# <a href="http://www.government.ru/gov/results/16355/print/">
# http://www.government.ru/gov/results/16355/print/
# </a>
# in Russian)
# there are few corrections have to be made for some Russian time zones...
# All updated Russian Time Zones were placed in table and translated to English
# by WorldTimeZone.com at the link below:
# <a href="http://www.worldtimezone.com/dst_news/dst_news_russia36.htm">
# http://www.worldtimezone.com/dst_news/dst_news_russia36.htm
# </a>
# From Sanjeev Gupta (2011-09-27):
# Scans of [Decree #23 of January 8, 1992] are available at:
# <a href="http://government.consultant.ru/page.aspx?1223966">
# http://government.consultant.ru/page.aspx?1223966
# They are in Cyrillic letters (presumably Russian).
# From Arthur David Olson (2012-05-09):
# Regarding the instant when clocks in time-zone-shifting parts of Russia
# changed in September 2011:
#
# One source is
# < a href="http://government.ru/gov/results/16355/>
# http://government.ru/gov/results/16355/
# </a>
# which, according to translate.google.com, begins "Decree of August 31,
# 2011 No 725" and contains no other dates or "effective date" information.
#
# Another source is
# <a href="http://www.rg.ru/2011/09/06/chas-zona-dok.html">
# http://www.rg.ru/2011/09/06/chas-zona-dok.html
# </a>
# which, according to translate.google.com, begins "Resolution of the
# Government of the Russian Federation on August 31, 2011 N 725" and also
# contains "Date first official publication: September 6, 2011 Posted on:
# in the 'RG' - Federal Issue number 5573 September 6, 2011" but which
# does not contain any "effective date" information.
#
# Another source is
# <a href="http://en.wikipedia.org/wiki/Oymyakonsky_District#cite_note-RuTime-7">
# http://en.wikipedia.org/wiki/Oymyakonsky_District#cite_note-RuTime-7
# </a>
# which, in note 8, contains "Resolution #725 of August 31, 2011...
# Effective as of after 7 days following the day of the official publication"
# but which does not contain any reference to September 6, 2011.
#
# The Wikipedia article refers to
# <a href="http://base.consultant.ru/cons/cgi/online.cgi?req=doc;base=LAW;n=118896">
# http://base.consultant.ru/cons/cgi/online.cgi?req=doc;base=LAW;n=118896
# </a>
# which seems to copy the text of the government.ru page.
#
# Tobias Conradi combines Wikipedia's
# "as of after 7 days following the day of the official publication"
# with www.rg.ru's "Date of first official publication: September 6, 2011" to get
# September 13, 2011 as the cutover date (unusually, a Tuesday, as Tobias Conradi notes).
#
# None of the sources indicates a time of day for changing clocks.
#
# Go with 2011-09-13 0:00s.
# From Paul Eggert (2006-03-22):
# Except for Moscow after 1919-07-01, I invented the time zone abbreviations.
# Moscow time zone abbreviations after 1919-07-01, and Moscow rules after 1991,
...
...
@@ -2293,14 +2380,32 @@ Zone Asia/Yakutsk 8:38:40 - LMT 1919 Dec 15
# [parts of] Respublika Sakha (Yakutiya).
# From Oscar van Vlijmen (2009-11-29):
# The Sakha districts are: Bulunskij, Verkhoyanskij, Tomponskij, Ust'-Majskij,
# Ust'-Yanskij.
# The Sakha districts are: Bulunskij, Verkhoyanskij, ... Ust'-Yanskij.
Zone Asia/Vladivostok 8:47:44 - LMT 1922 Nov 15
9:00 - VLAT 1930 Jun 21 # Vladivostok Time
10:00 Russia VLA%sT 1991 Mar 31 2:00s
9:00 Russia VLA%sST 1992 Jan 19 2:00s
10:00 Russia VLA%sT 2011 Mar 27 2:00s
11:00 - VLAT
# From Arthur David Olson (2012-05-09):
# Tomponskij and Ust'-Majskij switched from Vladivostok time to Yakutsk time
# in 2011.
#
# From Paul Eggert (2012-11-25):
# Shanks and Pottenger (2003) has Khandyga on Yakutsk time.
# Make a wild guess that it switched to Vladivostok time in 2004.
# This transition is no doubt wrong, but we have no better info.
#
Zone Asia/Khandyga 9:02:13 - LMT 1919 Dec 15
8:00 - YAKT 1930 Jun 21 # Yakutsk Time
9:00 Russia YAK%sT 1991 Mar 31 2:00s
8:00 Russia YAK%sT 1992 Jan 19 2:00s
9:00 Russia YAK%sT 2004
10:00 Russia VLA%sT 2011 Mar 27 2:00s
11:00 - VLAT 2011 Sep 13 0:00s # Decree 725?
10:00 - YAKT
#
# Sakhalinskaya oblast'.
# The Zone name should be Yuzhno-Sakhalinsk, but that's too long.
...
...
@@ -2319,14 +2424,26 @@ Zone Asia/Sakhalin 9:30:48 - LMT 1905 Aug 23
# From Oscar van Vlijmen (2009-11-29):
# The Sakha districts are: Abyjskij, Allaikhovskij, Verkhhhnekolymskij, Momskij,
# Nizhnekolymskij,
Ojmyakonskij,
Srednekolymskij.
# Nizhnekolymskij,
...
Srednekolymskij.
Zone Asia/Magadan 10:03:12 - LMT 1924 May 2
10:00 - MAGT 1930 Jun 21 # Magadan Time
11:00 Russia MAG%sT 1991 Mar 31 2:00s
10:00 Russia MAG%sT 1992 Jan 19 2:00s
11:00 Russia MAG%sT 2011 Mar 27 2:00s
12:00 - MAGT
#
# From Arthur David Olson (2012-05-09):
# Ojmyakonskij and the Kuril Islands switched from
# Magadan time to Vladivostok time in 2011.
Zone Asia/Ust-Nera 9:32:54 - LMT 1919 Dec 15
8:00 - YAKT 1930 Jun 21 # Yakutsk Time
9:00 Russia YAKT 1981 Apr 1
11:00 Russia MAG%sT 1991 Mar 31 2:00s
10:00 Russia MAG%sT 1992 Jan 19 2:00s
11:00 Russia MAG%sT 2011 Mar 27 2:00s
12:00 - MAGT 2011 Sep 13 0:00s # Decree 725?
11:00 - VLAT
# From Oscar van Vlijmen (2001-08-25): [This region consists of]
# Kamchatskaya oblast', Koryakskij avtonomnyj okrug.
#
...
...
make/sun/javazic/tzdata/northamerica
浏览文件 @
9694304e
...
...
@@ -29,7 +29,7 @@
# This data is by no means authoritative; if you think you know better,
# go ahead and edit the file (and please send any changes to
# tz@
elsie.nci.nih.gov
for general use in the future).
# tz@
iana.org
for general use in the future).
# From Paul Eggert (1999-03-22):
# A reliable and entertaining source about time zones is
...
...
@@ -1042,6 +1042,9 @@ Zone America/Menominee -5:50:27 - LMT 1885 Sep 18 12:00
# William Willett, The Waste of Daylight, 19th edition
# </a> (1914-03)
#
# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
# <http://www.jstor.org/stable/1774359>.
#
# See the `europe' file for Greenland.
# Canada
...
...
@@ -2577,6 +2580,8 @@ Zone America/Antigua -4:07:12 - LMT 1912 Mar 2
# Bahamas
#
# For 1899 Milne gives -5:09:29.5; round that.
#
# From Sue Williams (2006-12-07):
# The Bahamas announced about a month ago that they plan to change their DST
# rules to sync with the U.S. starting in 2007....
...
...
@@ -2586,11 +2591,14 @@ Zone America/Antigua -4:07:12 - LMT 1912 Mar 2
Rule Bahamas 1964 1975 - Oct lastSun 2:00 0 S
Rule Bahamas 1964 1975 - Apr lastSun 2:00 1:00 D
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Nassau -5:09:
24
- LMT 1912 Mar 2
Zone America/Nassau -5:09:
30
- LMT 1912 Mar 2
-5:00 Bahamas E%sT 1976
-5:00 US E%sT
# Barbados
# For 1899 Milne gives -3:58:29.2; round that.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Barb 1977 only - Jun 12 2:00 1:00 D
Rule Barb 1977 1978 - Oct Sun>=1 2:00 0 S
...
...
@@ -2598,8 +2606,8 @@ Rule Barb 1978 1980 - Apr Sun>=15 2:00 1:00 D
Rule Barb 1979 only - Sep 30 2:00 0 S
Rule Barb 1980 only - Sep 25 2:00 0 S
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Barbados -3:58:2
8
- LMT 1924 # Bridgetown
-3:58:2
8
- BMT 1932 # Bridgetown Mean Time
Zone America/Barbados -3:58:2
9
- LMT 1924 # Bridgetown
-3:58:2
9
- BMT 1932 # Bridgetown Mean Time
-4:00 Barb A%sT
# Belize
...
...
@@ -2617,6 +2625,9 @@ Zone America/Belize -5:52:48 - LMT 1912 Apr
# Bermuda
# For 1899 Milne gives -4:19:18.3 as the meridian of the clock tower,
# Bermuda dockyard, Ireland I; round that.
# From Dan Jones, reporting in The Royal Gazette (2006-06-26):
# Next year, however, clocks in the US will go forward on the second Sunday
...
...
@@ -2626,7 +2637,7 @@ Zone America/Belize -5:52:48 - LMT 1912 Apr
# http://www.theroyalgazette.com/apps/pbcs.dll/article?AID=/20060529/NEWS/105290135
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Atlantic/Bermuda -4:19:
04
- LMT 1930 Jan 1 2:00 # Hamilton
Zone Atlantic/Bermuda -4:19:
18
- LMT 1930 Jan 1 2:00 # Hamilton
-4:00 - AST 1974 Apr 28 2:00
-4:00 Bahamas A%sT 1976
-4:00 US A%sT
...
...
@@ -2638,6 +2649,9 @@ Zone America/Cayman -5:25:32 - LMT 1890 # Georgetown
-5:00 - EST
# Costa Rica
# Milne gives -5:36:13.3 as San Jose mean time; round to nearest.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule CR 1979 1980 - Feb lastSun 0:00 1:00 D
Rule CR 1979 1980 - Jun Sun>=1 0:00 0 S
...
...
@@ -2648,14 +2662,19 @@ Rule CR 1991 only - Jul 1 0:00 0 S
Rule CR 1992 only - Mar 15 0:00 0 S
# There are too many San Joses elsewhere, so we'll use `Costa Rica'.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Costa_Rica -5:36:
20
- LMT 1890 # San Jose
-5:36:
20
- SJMT 1921 Jan 15 # San Jose Mean Time
Zone America/Costa_Rica -5:36:
13
- LMT 1890 # San Jose
-5:36:
13
- SJMT 1921 Jan 15 # San Jose Mean Time
-6:00 CR C%sT
# Coco
# no information; probably like America/Costa_Rica
# Cuba
# From Paul Eggert (2013-02-21):
# Milne gives -5:28:50.45 for the observatory at Havana, -5:29:23.57
# for the port, and -5:30 for meteorological observations.
# For now, stick with Shanks & Pottenger.
# From Arthur David Olson (1999-03-29):
# The 1999-03-28 exhibition baseball game held in Havana, Cuba, between
# the Cuban National Team and the Baltimore Orioles was carried live on
...
...
@@ -3004,24 +3023,21 @@ Zone America/Guatemala -6:02:04 - LMT 1918 Oct 5
# apparently using the same start and end date as USA/Canada.
# So this means they have already changed their time.
#
# (Sources in French):
# <a href="http://www.alterpresse.org/spip.php?article12510">
# http://www.alterpresse.org/spip.php?article12510
# </a>
# <a href="http://radiovision2000haiti.net/home/?p=13253">
# http://radiovision2000haiti.net/home/?p=13253
# </a>
#
# Our coverage:
# <a href="http://www.timeanddate.com/news/time/haiti-dst-2012.html">
# http://www.timeanddate.com/news/time/haiti-dst-2012.html
# </a>
# From Arthur David Olson (2012-03-11):
# The alterpresse.org source seems to show a US-style leap from 2:00 a.m. to
# 3:00 a.m. rather than the traditional Haitian jump at midnight.
# Assume a US-style fall back as well XXX.
# Do not yet assume that the change carries forward past 2012 XXX.
# Assume a US-style fall back as well.
# From Steffen Thorsen (2013-03-10):
# It appears that Haiti is observing DST this year as well, same rules
# as US/Canada. They did it last year as well, and it looks like they
# are going to observe DST every year now...
#
# http://radiovision2000haiti.net/public/haiti-avis-changement-dheure-dimanche/
# http://www.canalplushaiti.net/?p=6714
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Haiti 1983 only - May 8 0:00 1:00 D
...
...
@@ -3033,8 +3049,8 @@ Rule Haiti 1988 1997 - Apr Sun>=1 1:00s 1:00 D
Rule Haiti 1988 1997 - Oct lastSun 1:00s 0 S
Rule Haiti 2005 2006 - Apr Sun>=1 0:00 1:00 D
Rule Haiti 2005 2006 - Oct lastSun 0:00 0 S
Rule Haiti 2012
only
- Mar Sun>=8 2:00 1:00 D
Rule Haiti 2012
only
- Nov Sun>=1 2:00 0 S
Rule Haiti 2012
max
- Mar Sun>=8 2:00 1:00 D
Rule Haiti 2012
max
- Nov Sun>=1 2:00 0 S
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Port-au-Prince -4:49:20 - LMT 1890
-4:49 - PPMT 1917 Jan 24 12:00 # P-a-P MT
...
...
make/sun/javazic/tzdata/southamerica
浏览文件 @
9694304e
...
...
@@ -27,13 +27,17 @@
# This data is by no means authoritative; if you think you know better,
# go ahead and edit the file (and please send any changes to
# tz@
elsie.nci.nih.gov
for general use in the future).
# tz@
iana.org
for general use in the future).
# From Paul Eggert (2006-03-22):
# A good source for time zone historical data outside the U.S. is
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
# San Diego: ACS Publications, Inc. (2003).
#
# For data circa 1899, a common source is:
# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
# <http://www.jstor.org/stable/1774359>.
#
# Gwillim Law writes that a good source
# for recent time zone data is the International Air Transport
# Association's Standard Schedules Information Manual (IATA SSIM),
...
...
@@ -404,21 +408,11 @@ Rule Arg 2008 only - Oct Sun>=15 0:00 1:00 S
# <a/>
# is the official page for the Province Government).
#
# There's also a note in only one of the major national papers (La Nación) at
# <a href="http://www.lanacion.com.ar/nota.asp?nota_id=1107912">
# There's also a note in only one of the major national papers ...
# http://www.lanacion.com.ar/nota.asp?nota_id=1107912
# </a>
#
# The press release says:
# (...) anunció que el próximo domingo a las 00:00 los puntanos deberán
# atrasar una hora sus relojes.
#
# A partir de entonces, San Luis establecerá el huso horario propio de
# la Provincia. De esta manera, durante el periodo del calendario anual
# 2009, el cambio horario quedará comprendido entre las 00:00 del tercer
# domingo de marzo y las 24:00 del segundo sábado de octubre.
# Quick&dirty translation
# (...) announced that next Sunday, at 00:00, Puntanos (the San Luis
# The press release says [quick and dirty translation]:
# ... announced that next Sunday, at 00:00, Puntanos (the San Luis
# inhabitants) will have to turn back one hour their clocks
#
# Since then, San Luis will establish its own Province timezone. Thus,
...
...
@@ -480,6 +474,9 @@ Rule Arg 2008 only - Oct Sun>=15 0:00 1:00 S
# rules...San Luis is still using "Western ARgentina Time" and it got
# stuck on Summer daylight savings time even though the summer is over.
# From Paul Eggert (2013-02-21):
# Milne says Cordoba time was -4:16:48.2. Round to the nearest second.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
#
# Buenos Aires (BA), Capital Federal (CF),
...
...
@@ -835,9 +832,9 @@ Zone America/La_Paz -4:32:36 - LMT 1890
# From Guilherme Bernardes Rodrigues (2011-10-07):
# There is news in the media, however there is still no decree about it.
# I just send a e-mail to Zulmira Brand
ã
o at
# I just send a e-mail to Zulmira Brand
a
o at
# <a href="http://pcdsh01.on.br/">http://pcdsh01.on.br/</a> the
# oficial agency about time in Brazil, and she confirmed that the old rule is
# of
f
icial agency about time in Brazil, and she confirmed that the old rule is
# still in force.
# From Guilherme Bernardes Rodrigues (2011-10-14)
...
...
@@ -1266,9 +1263,13 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914
# b. Saturday, September 1, 2012, clocks should go forward 60 minutes; that is,
# at 23:59:59, instead of passing to 0:00, the time should be adjusted to be
# 01:00 on September 2.
#
# Note that...this is yet another "temporary" change that will be reevaluated
# AGAIN in 2013.
# From Steffen Thorsen (2013-02-15):
# According to several news sources, Chile has extended DST this year,
# they will end DST later and start DST earlier than planned. They
# hope to save energy. The new end date is 2013-04-28 00:00 and new
# start date is 2013-09-08 00:00....
# http://www.gob.cl/informa/2013/02/15/gobierno-anuncia-fechas-de-cambio-de-hora-para-el-ano-2013.htm
# NOTE: ChileAQ rules for Antarctic bases are stored separately in the
# 'antarctica' file.
...
...
@@ -1311,10 +1312,8 @@ Rule Chile 2009 only - Mar Sun>=9 3:00u 0 -
Rule Chile 2010 only - Apr Sun>=1 3:00u 0 -
Rule Chile 2011 only - May Sun>=2 3:00u 0 -
Rule Chile 2011 only - Aug Sun>=16 4:00u 1:00 S
Rule Chile 2012 only - Apr Sun>=23 3:00u 0 -
Rule Chile 2012 only - Sep Sun>=2 4:00u 1:00 S
Rule Chile 2013 max - Mar Sun>=9 3:00u 0 -
Rule Chile 2013 max - Oct Sun>=9 4:00u 1:00 S
Rule Chile 2012 max - Apr Sun>=23 3:00u 0 -
Rule Chile 2012 max - Sep Sun>=2 4:00u 1:00 S
# IATA SSIM anomalies: (1992-02) says 1992-03-14;
# (1996-09) says 1998-03-08. Ignore these.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
...
...
@@ -1336,17 +1335,23 @@ Zone Pacific/Easter -7:17:44 - LMT 1890
# San Felix, and Antarctic bases, are like America/Santiago.
# Colombia
# Milne gives 4:56:16.4 for Bogota time in 1899; round to nearest. He writes,
# "A variation of fifteen minutes in the public clocks of Bogota is not rare."
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule CO 1992 only - May 3 0:00 1:00 S
Rule CO 1993 only - Apr 4 0:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Bogota -4:56:
20
- LMT 1884 Mar 13
-4:56:
20
- BMT 1914 Nov 23 # Bogota Mean Time
Zone America/Bogota -4:56:
16
- LMT 1884 Mar 13
-4:56:
16
- BMT 1914 Nov 23 # Bogota Mean Time
-5:00 CO CO%sT # Colombia Time
# Malpelo, Providencia, San Andres
# no information; probably like America/Bogota
# Curacao
# Milne gives 4:35:46.9 for Curacao mean time; round to nearest.
#
# From Paul Eggert (2006-03-22):
# Shanks & Pottenger say that The Bottom and Philipsburg have been at
...
...
@@ -1363,7 +1368,7 @@ Zone America/Bogota -4:56:20 - LMT 1884 Mar 13
# though, as far as we know.
#
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Curacao -4:35:4
4
- LMT 1912 Feb 12 # Willemstad
Zone America/Curacao -4:35:4
7
- LMT 1912 Feb 12 # Willemstad
-4:30 - ANT 1965 # Netherlands Antilles Time
-4:00 - AST
...
...
@@ -1377,6 +1382,8 @@ Link America/Curacao America/Kralendijk # Bonaire, Sint Estatius and Saba
# Ecuador
#
# Milne says the Sentral and South American Telegraph Company used -5:24:15.
#
# From Paul Eggert (2007-03-04):
# Apparently Ecuador had a failed experiment with DST in 1992.
# <http://midena.gov.ec/content/view/1261/208/> (2007-02-27) and
...
...
@@ -1582,7 +1589,16 @@ Rule Para 2005 2009 - Mar Sun>=8 0:00 0 -
# forward 60 minutes, in all the territory of the Paraguayan Republic.
# ...
Rule Para 2010 max - Oct Sun>=1 0:00 1:00 S
Rule Para 2010 max - Apr Sun>=8 0:00 0 -
Rule Para 2010 2012 - Apr Sun>=8 0:00 0 -
#
# From Steffen Thorsen (2013-03-07):
# Paraguay will end DST on 2013-03-24 00:00....
# http://www.ande.gov.py/interna.php?id=1075
#
# From Carlos Raul Perasso (2013-03-15):
# The change in Paraguay is now final. Decree number 10780
# http://www.presidencia.gov.py/uploads/pdf/presidencia-3b86ff4b691c79d4f5927ca964922ec74772ce857c02ca054a52a37b49afc7fb.pdf
Rule Para 2013 max - Mar Sun>=22 0:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Asuncion -3:50:40 - LMT 1890
...
...
make/sun/javazic/tzdata/zone.tab
浏览文件 @
9694304e
...
...
@@ -65,7 +65,6 @@ AQ -6617+11031 Antarctica/Casey Casey Station, Bailey Peninsula
AQ -7824+10654 Antarctica/Vostok Vostok Station, Lake Vostok
AQ -6640+14001 Antarctica/DumontDUrville Dumont-d'Urville Station, Terre Adelie
AQ -690022+0393524 Antarctica/Syowa Syowa Station, E Ongul I
AQ -5430+15857 Antarctica/Macquarie Macquarie Island Station, Macquarie Island
AR -3436-05827 America/Argentina/Buenos_Aires Buenos Aires (BA, CF)
AR -3124-06411 America/Argentina/Cordoba most locations (CB, CC, CN, ER, FM, MN, SE, SF)
AR -2447-06525 America/Argentina/Salta (SA, LP, NQ, RN)
...
...
@@ -81,6 +80,7 @@ AR -5448-06818 America/Argentina/Ushuaia Tierra del Fuego (TF)
AS -1416-17042 Pacific/Pago_Pago
AT +4813+01620 Europe/Vienna
AU -3133+15905 Australia/Lord_Howe Lord Howe Island
AU -5430+15857 Antarctica/Macquarie Macquarie Island
AU -4253+14719 Australia/Hobart Tasmania - most locations
AU -3956+14352 Australia/Currie Tasmania - King Island
AU -3749+14458 Australia/Melbourne Victoria
...
...
@@ -182,7 +182,8 @@ CW +1211-06900 America/Curacao
CX -1025+10543 Indian/Christmas
CY +3510+03322 Asia/Nicosia
CZ +5005+01426 Europe/Prague
DE +5230+01322 Europe/Berlin
DE +5230+01322 Europe/Berlin most locations
DE +4742+00841 Europe/Busingen Busingen
DJ +1136+04309 Africa/Djibouti
DK +5540+01235 Europe/Copenhagen
DM +1518-06124 America/Dominica
...
...
@@ -364,8 +365,10 @@ RU +5345+08707 Asia/Novokuznetsk Moscow+03 - Novokuznetsk
RU +5601+09250 Asia/Krasnoyarsk Moscow+04 - Yenisei River
RU +5216+10420 Asia/Irkutsk Moscow+05 - Lake Baikal
RU +6200+12940 Asia/Yakutsk Moscow+06 - Lena River
RU +623923+1353314 Asia/Khandyga Moscow+06 - Tomponsky, Ust-Maysky
RU +4310+13156 Asia/Vladivostok Moscow+07 - Amur River
RU +4658+14242 Asia/Sakhalin Moscow+07 - Sakhalin Island
RU +643337+1431336 Asia/Ust-Nera Moscow+07 - Oymyakonsky
RU +5934+15048 Asia/Magadan Moscow+08 - Magadan
RU +5301+15839 Asia/Kamchatka Moscow+08 - Kamchatka
RU +6445+17729 Asia/Anadyr Moscow+08 - Bering Sea
...
...
make/sun/nio/cs/Makefile
浏览文件 @
9694304e
...
...
@@ -87,9 +87,6 @@ build: $(FILES_genout_extcs) $(CHARSETS_JAR)
#
# Extra rules to build character converters.
SERVICE_DESCRIPTION
=
java.nio.charset.spi.CharsetProvider
SERVICE_DESCRIPTION_PATH
=
META-INF/services/
$(SERVICE_DESCRIPTION)
GENCSDATASRC
=
$(BUILDDIR)
/tools/CharsetMapping
GENCSSRCDIR
=
$(BUILDDIR)
/tools/src/build/tools/charsetmapping
GENCSEXT
=
$(GENSRCDIR)
/sun/nio/cs/ext
...
...
@@ -118,10 +115,6 @@ $(FILES_genout_extcs): \
$(GENCSSRCDIR)
/HKSCS.java
$(BOOT_JAVA_CMD)
-jar
$(CHARSETMAPPING_JARFILE)
$(GENCSDATASRC)
$(GENCSEXT)
dbcs
$(CLASSDESTDIR)/$(SERVICE_DESCRIPTION_PATH)
:
\
$(SHARE_SRC)/classes/sun/nio/cs/ext/$(SERVICE_DESCRIPTION_PATH)
$
(
install-file
)
# no compression unless requested
ifndef
COMPRESS_JARS
CREATE_JAR_OPTS_NOMANIFEST
=
cf0
...
...
@@ -129,10 +122,9 @@ else
CREATE_JAR_OPTS_NOMANIFEST
=
cf
endif
$(CHARSETS_JAR)
:
$(FILES_class) $(
CLASSDESTDIR)/$(SERVICE_DESCRIPTION_PATH) $(
FILES_DAT)
$(CHARSETS_JAR)
:
$(FILES_class) $(FILES_DAT)
$(BOOT_JAR_CMD)
$(CREATE_JAR_OPTS_NOMANIFEST)
$(CHARSETS_JAR)
\
-C
$(CLASSDESTDIR)
sun
\
-C
$(CLASSDESTDIR)
$(SERVICE_DESCRIPTION_PATH)
\
$(BOOT_JAR_JFLAGS)
@
$
(
java-vm-cleanup
)
...
...
make/tools/src/build/tools/cldrconverter/CLDRConverter.java
浏览文件 @
9694304e
...
...
@@ -34,6 +34,8 @@ import java.nio.file.Path;
import
java.util.*
;
import
javax.xml.parsers.SAXParser
;
import
javax.xml.parsers.SAXParserFactory
;
import
org.xml.sax.SAXNotRecognizedException
;
import
org.xml.sax.SAXNotSupportedException
;
/**
...
...
@@ -234,6 +236,17 @@ public class CLDRConverter {
}
}
/**
* Configure the parser to allow access to DTDs on the file system.
*/
private
static
void
enableFileAccess
(
SAXParser
parser
)
throws
SAXNotSupportedException
{
try
{
parser
.
setProperty
(
"http://javax.xml.XMLConstants/property/accessExternalDTD"
,
"file"
);
}
catch
(
SAXNotRecognizedException
ignore
)
{
// property requires >= JAXP 1.5
}
}
private
static
List
<
Bundle
>
readBundleList
()
throws
Exception
{
ResourceBundle
.
Control
defCon
=
ResourceBundle
.
Control
.
getControl
(
ResourceBundle
.
Control
.
FORMAT_DEFAULT
);
List
<
Bundle
>
retList
=
new
ArrayList
<>();
...
...
@@ -279,6 +292,7 @@ public class CLDRConverter {
SAXParserFactory
factory
=
SAXParserFactory
.
newInstance
();
factory
.
setValidating
(
true
);
SAXParser
parser
=
factory
.
newSAXParser
();
enableFileAccess
(
parser
);
LDMLParseHandler
handler
=
new
LDMLParseHandler
(
id
);
File
file
=
new
File
(
SOURCE_FILE_DIR
+
File
.
separator
+
id
+
".xml"
);
if
(!
file
.
exists
())
{
...
...
@@ -314,6 +328,7 @@ public class CLDRConverter {
SAXParserFactory
factorySuppl
=
SAXParserFactory
.
newInstance
();
factorySuppl
.
setValidating
(
true
);
SAXParser
parserSuppl
=
factorySuppl
.
newSAXParser
();
enableFileAccess
(
parserSuppl
);
handlerSuppl
=
new
SupplementDataParseHandler
();
File
fileSupply
=
new
File
(
SPPL_SOURCE_FILE
);
parserSuppl
.
parse
(
fileSupply
,
handlerSuppl
);
...
...
@@ -322,6 +337,7 @@ public class CLDRConverter {
SAXParserFactory
numberingParser
=
SAXParserFactory
.
newInstance
();
numberingParser
.
setValidating
(
true
);
SAXParser
parserNumbering
=
numberingParser
.
newSAXParser
();
enableFileAccess
(
parserNumbering
);
handlerNumbering
=
new
NumberingSystemsParseHandler
();
File
fileNumbering
=
new
File
(
NUMBERING_SOURCE_FILE
);
parserNumbering
.
parse
(
fileNumbering
,
handlerNumbering
);
...
...
@@ -330,6 +346,7 @@ public class CLDRConverter {
SAXParserFactory
metazonesParser
=
SAXParserFactory
.
newInstance
();
metazonesParser
.
setValidating
(
true
);
SAXParser
parserMetaZones
=
metazonesParser
.
newSAXParser
();
enableFileAccess
(
parserMetaZones
);
handlerMetaZones
=
new
MetaZonesParseHandler
();
File
fileMetaZones
=
new
File
(
METAZONES_SOURCE_FILE
);
parserNumbering
.
parse
(
fileMetaZones
,
handlerMetaZones
);
...
...
makefiles/CreateJars.gmk
浏览文件 @
9694304e
...
...
@@ -201,7 +201,6 @@ RT_JAR_EXCLUDES += \
META-INF/services/com.sun.jdi.connect.spi.TransportService \
META-INF/services/com.sun.tools.attach.spi.AttachProvider \
META-INF/services/com.sun.tools.xjc.Plugin \
META-INF/services/java.nio.charset.spi.CharsetProvider \
META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor \
org/relaxng/datatype \
sun/awt/HKSCS.class \
...
...
@@ -428,8 +427,7 @@ $(eval $(call SetupArchive,BUILD_CHARSETS_JAR,,\
SUFFIXES:=.class .dat,\
INCLUDES:=sun/nio/cs/ext,\
EXTRA_FILES := sun/awt/HKSCS.class \
$(CHARSETS_EXTRA_FILES) \
META-INF/services/java.nio.charset.spi.CharsetProvider, \
$(CHARSETS_EXTRA_FILES), \
JAR:=$(IMAGES_OUTPUTDIR)/lib/charsets.jar, \
SKIP_METAINF := true, \
CHECK_COMPRESS_JAR:=true))
...
...
src/share/classes/java/lang/ProcessBuilder.java
浏览文件 @
9694304e
...
...
@@ -29,7 +29,6 @@ import java.io.File;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.OutputStream
;
import
java.io.FileOutputStream
;
import
java.security.AccessControlException
;
import
java.util.Arrays
;
import
java.util.ArrayList
;
...
...
@@ -1024,10 +1023,10 @@ public final class ProcessBuilder
dir
,
redirects
,
redirectErrorStream
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
|
IllegalArgumentException
e
)
{
String
exceptionInfo
=
": "
+
e
.
getMessage
();
Throwable
cause
=
e
;
if
(
security
!=
null
)
{
if
(
(
e
instanceof
IOException
)
&&
security
!=
null
)
{
// Can not disclose the fail reason for read-protected files.
try
{
security
.
checkRead
(
prog
);
...
...
src/share/classes/java/lang/StringBuffer.java
浏览文件 @
9694304e
/*
* Copyright (c) 1994, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 201
3
, 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
...
...
@@ -25,6 +25,7 @@
package
java.lang
;
import
java.util.Arrays
;
/**
* A thread-safe, mutable sequence of characters.
...
...
@@ -98,6 +99,12 @@ package java.lang;
implements
java
.
io
.
Serializable
,
CharSequence
{
/**
* A cache of the last value returned by toString. Cleared
* whenever the StringBuffer is modified.
*/
private
transient
char
[]
toStringCache
;
/** use serialVersionUID from JDK 1.0.2 for interoperability */
static
final
long
serialVersionUID
=
3388685877147921107L
;
...
...
@@ -183,6 +190,7 @@ package java.lang;
*/
@Override
public
synchronized
void
setLength
(
int
newLength
)
{
toStringCache
=
null
;
super
.
setLength
(
newLength
);
}
...
...
@@ -247,17 +255,20 @@ package java.lang;
public
synchronized
void
setCharAt
(
int
index
,
char
ch
)
{
if
((
index
<
0
)
||
(
index
>=
count
))
throw
new
StringIndexOutOfBoundsException
(
index
);
toStringCache
=
null
;
value
[
index
]
=
ch
;
}
@Override
public
synchronized
StringBuffer
append
(
Object
obj
)
{
toStringCache
=
null
;
super
.
append
(
String
.
valueOf
(
obj
));
return
this
;
}
@Override
public
synchronized
StringBuffer
append
(
String
str
)
{
toStringCache
=
null
;
super
.
append
(
str
);
return
this
;
}
...
...
@@ -287,6 +298,7 @@ package java.lang;
* @since 1.4
*/
public
synchronized
StringBuffer
append
(
StringBuffer
sb
)
{
toStringCache
=
null
;
super
.
append
(
sb
);
return
this
;
}
...
...
@@ -296,6 +308,7 @@ package java.lang;
*/
@Override
synchronized
StringBuffer
append
(
AbstractStringBuilder
asb
)
{
toStringCache
=
null
;
super
.
append
(
asb
);
return
this
;
}
...
...
@@ -325,6 +338,7 @@ package java.lang;
public
StringBuffer
append
(
CharSequence
s
)
{
// Note, synchronization achieved via invocations of other StringBuffer methods after
// narrowing of s to specific type
// Ditto for toStringCache clearing
super
.
append
(
s
);
return
this
;
}
...
...
@@ -336,12 +350,14 @@ package java.lang;
@Override
public
synchronized
StringBuffer
append
(
CharSequence
s
,
int
start
,
int
end
)
{
toStringCache
=
null
;
super
.
append
(
s
,
start
,
end
);
return
this
;
}
@Override
public
synchronized
StringBuffer
append
(
char
[]
str
)
{
toStringCache
=
null
;
super
.
append
(
str
);
return
this
;
}
...
...
@@ -351,24 +367,28 @@ package java.lang;
*/
@Override
public
synchronized
StringBuffer
append
(
char
[]
str
,
int
offset
,
int
len
)
{
toStringCache
=
null
;
super
.
append
(
str
,
offset
,
len
);
return
this
;
}
@Override
public
synchronized
StringBuffer
append
(
boolean
b
)
{
toStringCache
=
null
;
super
.
append
(
b
);
return
this
;
}
@Override
public
synchronized
StringBuffer
append
(
char
c
)
{
toStringCache
=
null
;
super
.
append
(
c
);
return
this
;
}
@Override
public
synchronized
StringBuffer
append
(
int
i
)
{
toStringCache
=
null
;
super
.
append
(
i
);
return
this
;
}
...
...
@@ -378,24 +398,28 @@ package java.lang;
*/
@Override
public
synchronized
StringBuffer
appendCodePoint
(
int
codePoint
)
{
toStringCache
=
null
;
super
.
appendCodePoint
(
codePoint
);
return
this
;
}
@Override
public
synchronized
StringBuffer
append
(
long
lng
)
{
toStringCache
=
null
;
super
.
append
(
lng
);
return
this
;
}
@Override
public
synchronized
StringBuffer
append
(
float
f
)
{
toStringCache
=
null
;
super
.
append
(
f
);
return
this
;
}
@Override
public
synchronized
StringBuffer
append
(
double
d
)
{
toStringCache
=
null
;
super
.
append
(
d
);
return
this
;
}
...
...
@@ -406,6 +430,7 @@ package java.lang;
*/
@Override
public
synchronized
StringBuffer
delete
(
int
start
,
int
end
)
{
toStringCache
=
null
;
super
.
delete
(
start
,
end
);
return
this
;
}
...
...
@@ -416,6 +441,7 @@ package java.lang;
*/
@Override
public
synchronized
StringBuffer
deleteCharAt
(
int
index
)
{
toStringCache
=
null
;
super
.
deleteCharAt
(
index
);
return
this
;
}
...
...
@@ -426,6 +452,7 @@ package java.lang;
*/
@Override
public
synchronized
StringBuffer
replace
(
int
start
,
int
end
,
String
str
)
{
toStringCache
=
null
;
super
.
replace
(
start
,
end
,
str
);
return
this
;
}
...
...
@@ -465,6 +492,7 @@ package java.lang;
public
synchronized
StringBuffer
insert
(
int
index
,
char
[]
str
,
int
offset
,
int
len
)
{
toStringCache
=
null
;
super
.
insert
(
index
,
str
,
offset
,
len
);
return
this
;
}
...
...
@@ -474,6 +502,7 @@ package java.lang;
*/
@Override
public
synchronized
StringBuffer
insert
(
int
offset
,
Object
obj
)
{
toStringCache
=
null
;
super
.
insert
(
offset
,
String
.
valueOf
(
obj
));
return
this
;
}
...
...
@@ -483,6 +512,7 @@ package java.lang;
*/
@Override
public
synchronized
StringBuffer
insert
(
int
offset
,
String
str
)
{
toStringCache
=
null
;
super
.
insert
(
offset
,
str
);
return
this
;
}
...
...
@@ -492,6 +522,7 @@ package java.lang;
*/
@Override
public
synchronized
StringBuffer
insert
(
int
offset
,
char
[]
str
)
{
toStringCache
=
null
;
super
.
insert
(
offset
,
str
);
return
this
;
}
...
...
@@ -504,6 +535,7 @@ package java.lang;
public
StringBuffer
insert
(
int
dstOffset
,
CharSequence
s
)
{
// Note, synchronization achieved via invocations of other StringBuffer methods
// after narrowing of s to specific type
// Ditto for toStringCache clearing
super
.
insert
(
dstOffset
,
s
);
return
this
;
}
...
...
@@ -516,6 +548,7 @@ package java.lang;
public
synchronized
StringBuffer
insert
(
int
dstOffset
,
CharSequence
s
,
int
start
,
int
end
)
{
toStringCache
=
null
;
super
.
insert
(
dstOffset
,
s
,
start
,
end
);
return
this
;
}
...
...
@@ -527,6 +560,7 @@ package java.lang;
public
StringBuffer
insert
(
int
offset
,
boolean
b
)
{
// Note, synchronization achieved via invocation of StringBuffer insert(int, String)
// after conversion of b to String by super class method
// Ditto for toStringCache clearing
super
.
insert
(
offset
,
b
);
return
this
;
}
...
...
@@ -536,6 +570,7 @@ package java.lang;
*/
@Override
public
synchronized
StringBuffer
insert
(
int
offset
,
char
c
)
{
toStringCache
=
null
;
super
.
insert
(
offset
,
c
);
return
this
;
}
...
...
@@ -547,6 +582,7 @@ package java.lang;
public
StringBuffer
insert
(
int
offset
,
int
i
)
{
// Note, synchronization achieved via invocation of StringBuffer insert(int, String)
// after conversion of i to String by super class method
// Ditto for toStringCache clearing
super
.
insert
(
offset
,
i
);
return
this
;
}
...
...
@@ -558,6 +594,7 @@ package java.lang;
public
StringBuffer
insert
(
int
offset
,
long
l
)
{
// Note, synchronization achieved via invocation of StringBuffer insert(int, String)
// after conversion of l to String by super class method
// Ditto for toStringCache clearing
super
.
insert
(
offset
,
l
);
return
this
;
}
...
...
@@ -569,6 +606,7 @@ package java.lang;
public
StringBuffer
insert
(
int
offset
,
float
f
)
{
// Note, synchronization achieved via invocation of StringBuffer insert(int, String)
// after conversion of f to String by super class method
// Ditto for toStringCache clearing
super
.
insert
(
offset
,
f
);
return
this
;
}
...
...
@@ -580,6 +618,7 @@ package java.lang;
public
StringBuffer
insert
(
int
offset
,
double
d
)
{
// Note, synchronization achieved via invocation of StringBuffer insert(int, String)
// after conversion of d to String by super class method
// Ditto for toStringCache clearing
super
.
insert
(
offset
,
d
);
return
this
;
}
...
...
@@ -623,13 +662,17 @@ package java.lang;
*/
@Override
public
synchronized
StringBuffer
reverse
()
{
toStringCache
=
null
;
super
.
reverse
();
return
this
;
}
@Override
public
synchronized
String
toString
()
{
return
new
String
(
value
,
0
,
count
);
if
(
toStringCache
==
null
)
{
toStringCache
=
Arrays
.
copyOfRange
(
value
,
0
,
count
);
}
return
new
String
(
toStringCache
,
true
);
}
/**
...
...
src/share/classes/java/net/HttpURLConnection.java
浏览文件 @
9694304e
...
...
@@ -50,6 +50,18 @@ import java.util.Date;
* <a href="doc-files/net-properties.html#Proxies">Proxy settings</a> as well as
* <a href="doc-files/net-properties.html#MiscHTTP"> various other settings</a>.
* </P>
* <p>
* <b>Security permissions</b>
* <p>
* If a security manager is installed, and if a method is called which results in an
* attempt to open a connection, the caller must possess either:-
* <ul><li>a "connect" {@link SocketPermission} to the host/port combination of the
* destination URL or</li>
* <li>a {@link HttpURLPermission} that permits this request.</li>
* </ul><p>
* If automatic redirection is enabled, and this request is redirected to another
* destination, then the caller must also have permission to connect to the
* redirected host/URL.
*
* @see java.net.HttpURLConnection#disconnect()
* @since JDK1.1
...
...
src/share/classes/java/net/HttpURLPermission.java
0 → 100644
浏览文件 @
9694304e
/*
* Copyright (c) 2013, 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* 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.
*/
package
java.net
;
import
java.io.ObjectInputStream
;
import
java.io.IOException
;
import
java.util.List
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.security.Permission
;
/**
* Represents permission to access a resource or set of resources defined by a
* given http or https url, and for a given set of user-settable request methods
* and request headers. The <i>name</i> of the permission is the url string.
* The <i>actions</i> string is a concatenation of the request methods and headers.
* The range of method and header names is not restricted by this class.
* <p><b>The url</b><p>
* The url string is also used to instantiate a {@link URI} object which is
* used for comparison with other HttpURLPermission instances. Therefore, any
* references in this specification to url, mean this URI object.
* The path component of the url comprises a sequence of path segments, separated
* by '/' characters. The path is specified in a similar way to the path
* in {@link java.io.FilePermission}. There are three different ways
* as the following examples show:
* <table border>
* <tr><th>Example url</th><th>Description</th></tr>
* <tr><td style="white-space:nowrap;">http://www.oracle.com/a/b/c.html</td>
* <td>A url which identifies a specific (single) resource</td>
* </tr>
* <tr><td>http://www.oracle.com/a/b/*</td>
* <td>The '*' character refers to all resources in the same "directory" - in
* other words all resources with the same number of path components, and
* which only differ in the final path component, represented by the '*'.
* </td>
* </tr>
* <tr><td>http://www.oracle.com/a/b/-</li>
* <td>The '-' character refers to all resources recursively below the
* preceding path (eg. http://www.oracle.com/a/b/c/d/e.html matches this
* example).
* </td>
* </tr>
* </table>
* <p>
* The '*' and '-' may only be specified in the final segment of a path and must be
* the only character in that segment. Any query or fragment components of the
* url are ignored when constructing HttpURLPermissions.
* <p>
* As a special case, urls of the form, "http:*" or "https:*" are accepted to
* mean any url of the given scheme.
* <p><b>The actions string</b><p>
* The actions string of a HttpURLPermission is a concatenation of the <i>method list</i>
* and the <i>request headers list</i>. These are lists of the permitted HTTP request
* methods and permitted request headers of the permission (respectively). The two lists
* are separated by a colon ':' character and elements of each list are comma separated.
* Some examples are:
* <pre>
* "POST,GET,DELETE"
* "GET:X-Foo-Request,X-Bar-Request"
* "POST,GET:Header1,Header2"
* </pre>
* The first example specifies the methods: POST, GET and DELETE, but no request headers.
* The second example specifies one request method and two headers. The third
* example specifies two request methods, and two headers.
* <p>
* The colon separator need not be present if the request headers list is empty.
* No white-space is permitted in the actions string. The action strings supplied to
* the HttpURLPermission constructors are case-insensitive and are normalized by converting
* method names to upper-case and header names to the form defines in RFC2616 (lower case
* with initial letter of each word capitalized). Either list can contain a wild-card '*'
* character which signifies all request methods or headers respectively.
* <p>
* Note. Depending on the context of use, some request methods and headers may be permitted
* at all times, and others may not be permitted at any time. For example, the
* HTTP protocol handler might disallow certain headers such as Content-Length
* from being set by application code, regardless of whether the security policy
* in force, permits it.
*
* @since 1.8
*/
public
final
class
HttpURLPermission
extends
Permission
{
private
static
final
long
serialVersionUID
=
-
2702463814894478682L
;
private
transient
URI
uri
;
private
transient
List
<
String
>
methods
;
private
transient
List
<
String
>
requestHeaders
;
// serialized field
private
String
actions
;
/**
* Creates a new HttpURLPermission from a url string and which permits the given
* request methods and user-settable request headers.
* The name of the permission is its url string. Only the scheme, authority
* and path components of the url are used. Any fragment or query
* components are ignored. The permissions action string is as specified above.
*
* @param url the url string
*
* @param actions the actions string
*
* @throws IllegalArgumentException if url does not result in a valid {@link URI},
* its scheme is not http or https, or if actions contains white-space.
*/
public
HttpURLPermission
(
String
url
,
String
actions
)
{
super
(
url
);
init
(
actions
);
}
private
void
init
(
String
actions
)
{
URI
uri
=
parseURI
(
getName
());
int
colon
=
actions
.
indexOf
(
':'
);
if
(
actions
.
lastIndexOf
(
':'
)
!=
colon
)
{
throw
new
IllegalArgumentException
(
"invalid actions string"
);
}
String
methods
,
headers
;
if
(
colon
==
-
1
)
{
methods
=
actions
;
headers
=
""
;
}
else
{
methods
=
actions
.
substring
(
0
,
colon
);
headers
=
actions
.
substring
(
colon
+
1
);
}
List
<
String
>
l
=
normalizeMethods
(
methods
);
Collections
.
sort
(
l
);
this
.
methods
=
Collections
.
unmodifiableList
(
l
);
l
=
normalizeHeaders
(
headers
);
Collections
.
sort
(
l
);
this
.
requestHeaders
=
Collections
.
unmodifiableList
(
l
);
this
.
actions
=
actions
();
this
.
uri
=
uri
;
}
/**
* Creates a HttpURLPermission with the given url string and unrestricted
* methods and request headers by invoking the two argument
* constructor as follows: HttpURLPermission(url, "*:*")
*
* @throws IllegalArgumentException if url does not result in a valid {@link URI}
*/
public
HttpURLPermission
(
String
url
)
{
this
(
url
,
"*:*"
);
}
/**
* Returns the normalized method list and request
* header list, in the form:
* <pre>
* "method-names : header-names"
* </pre>
* <p>
* where method-names is the list of methods separated by commas
* and header-names is the list of permitted headers separated by commas.
* There is no white space in the returned String. If header-names is empty
* then the colon separator will not be present.
*/
public
String
getActions
()
{
return
actions
;
}
/**
* Checks if this HttpURLPermission implies the given permission.
* Specifically, the following checks are done as if in the
* following sequence:
* <p><ul>
* <li>if 'p' is not an instance of HttpURLPermission return false</li>
* <li>if any of p's methods are not in this's method list, and if
* this's method list is not equal to "*", then return false.</li>
* <li>if any of p's headers are not in this's request header list, and if
* this's request header list is not equal to "*", then return false.</li>
* <li>if this's url is equal to p's url , then return true</li>
* <li>if this's url scheme is not equal to p's url scheme return false</li>
* <li>if the scheme specific part of this's url is '*' return true</li>
* <li>if this's url authority is not equal to p's url authority
* return false</li>
* <li>if the path or paths specified by p's url are contained in the
* set of paths specified by this's url, then return true
* <li>otherwise, return false</li>
* </ol>
* <p>
* Some examples of how paths are matched are shown below:
* <p>
* <table border>
* <tr><th>this's path</th><th>p's path</th><th>match</th></tr>
* <tr><td>/a/b</td><td>/a/b</td><td>yes</td></tr>
* <tr><td>/a/b/*</td><td>/a/b/c</td><td>yes</td></tr>
* <tr><td>/a/b/*</td><td>/a/b/c/d</td><td>no</td></tr>
* <tr><td>/a/b/-</td><td>/a/b/c/d</td><td>yes</td></tr>
* <tr><td>/a/b/-</td><td>/a/b/c/d/e</td><td>yes</td></tr>
* <tr><td>/a/b/-</td><td>/a/b/c/*</td><td>yes</td></tr>
* <tr><td>/a/b/*</td><td>/a/b/c/-</td><td>no</td></tr>
* </table>
*/
public
boolean
implies
(
Permission
p
)
{
if
(!
(
p
instanceof
HttpURLPermission
))
{
return
false
;
}
HttpURLPermission
that
=
(
HttpURLPermission
)
p
;
if
(!
this
.
methods
.
get
(
0
).
equals
(
"*"
)
&&
Collections
.
indexOfSubList
(
this
.
methods
,
that
.
methods
)
==
-
1
)
{
return
false
;
}
if
(
this
.
requestHeaders
.
isEmpty
()
&&
!
that
.
requestHeaders
.
isEmpty
())
{
return
false
;
}
if
(!
this
.
requestHeaders
.
isEmpty
()
&&
!
this
.
requestHeaders
.
get
(
0
).
equals
(
"*"
)
&&
Collections
.
indexOfSubList
(
this
.
requestHeaders
,
that
.
requestHeaders
)
==
-
1
)
{
return
false
;
}
if
(
this
.
uri
.
equals
(
that
.
uri
))
{
return
true
;
}
if
(!
this
.
uri
.
getScheme
().
equals
(
that
.
uri
.
getScheme
()))
{
return
false
;
}
if
(
this
.
uri
.
getSchemeSpecificPart
().
equals
(
"*"
))
{
return
true
;
}
String
thisAuthority
=
this
.
uri
.
getAuthority
();
if
(
thisAuthority
!=
null
&&
!
thisAuthority
.
equals
(
that
.
uri
.
getAuthority
()))
{
return
false
;
}
String
thispath
=
this
.
uri
.
getPath
();
String
thatpath
=
that
.
uri
.
getPath
();
if
(
thispath
.
endsWith
(
"/-"
))
{
String
thisprefix
=
thispath
.
substring
(
0
,
thispath
.
length
()
-
1
);
return
thatpath
.
startsWith
(
thisprefix
);
}
if
(
thispath
.
endsWith
(
"/*"
))
{
String
thisprefix
=
thispath
.
substring
(
0
,
thispath
.
length
()
-
1
);
if
(!
thatpath
.
startsWith
(
thisprefix
))
{
return
false
;
}
String
thatsuffix
=
thatpath
.
substring
(
thisprefix
.
length
());
// suffix must not contain '/' chars
if
(
thatsuffix
.
indexOf
(
'/'
)
!=
-
1
)
{
return
false
;
}
if
(
thatsuffix
.
equals
(
"-"
))
{
return
false
;
}
return
true
;
}
return
false
;
}
/**
* Returns true if, this.getActions().equals(p.getActions())
* and p's url equals this's url. Returns false otherwise.
*/
public
boolean
equals
(
Object
p
)
{
if
(!(
p
instanceof
HttpURLPermission
))
{
return
false
;
}
HttpURLPermission
that
=
(
HttpURLPermission
)
p
;
return
this
.
getActions
().
equals
(
that
.
getActions
())
&&
this
.
uri
.
equals
(
that
.
uri
);
}
/**
* Returns a hashcode calculated from the hashcode of the
* actions String and the url
*/
public
int
hashCode
()
{
return
getActions
().
hashCode
()
+
uri
.
hashCode
();
}
private
List
<
String
>
normalizeMethods
(
String
methods
)
{
List
<
String
>
l
=
new
ArrayList
<>();
StringBuilder
b
=
new
StringBuilder
();
for
(
int
i
=
0
;
i
<
methods
.
length
();
i
++)
{
char
c
=
methods
.
charAt
(
i
);
if
(
c
==
','
)
{
String
s
=
b
.
toString
();
if
(
s
.
length
()
>
0
)
l
.
add
(
s
);
b
=
new
StringBuilder
();
}
else
if
(
c
==
' '
||
c
==
'\t'
)
{
throw
new
IllegalArgumentException
(
"white space not allowed"
);
}
else
{
if
(
c
>=
'a'
&&
c
<=
'z'
)
{
c
+=
'A'
-
'a'
;
}
b
.
append
(
c
);
}
}
String
s
=
b
.
toString
();
if
(
s
.
length
()
>
0
)
l
.
add
(
s
);
return
l
;
}
private
List
<
String
>
normalizeHeaders
(
String
headers
)
{
List
<
String
>
l
=
new
ArrayList
<>();
StringBuilder
b
=
new
StringBuilder
();
boolean
capitalizeNext
=
true
;
for
(
int
i
=
0
;
i
<
headers
.
length
();
i
++)
{
char
c
=
headers
.
charAt
(
i
);
if
(
c
>=
'a'
&&
c
<=
'z'
)
{
if
(
capitalizeNext
)
{
c
+=
'A'
-
'a'
;
capitalizeNext
=
false
;
}
b
.
append
(
c
);
}
else
if
(
c
==
' '
||
c
==
'\t'
)
{
throw
new
IllegalArgumentException
(
"white space not allowed"
);
}
else
if
(
c
==
'-'
)
{
capitalizeNext
=
true
;
b
.
append
(
c
);
}
else
if
(
c
==
','
)
{
String
s
=
b
.
toString
();
if
(
s
.
length
()
>
0
)
l
.
add
(
s
);
b
=
new
StringBuilder
();
capitalizeNext
=
true
;
}
else
{
capitalizeNext
=
false
;
b
.
append
(
c
);
}
}
String
s
=
b
.
toString
();
if
(
s
.
length
()
>
0
)
l
.
add
(
s
);
return
l
;
}
private
URI
parseURI
(
String
url
)
{
URI
u
=
URI
.
create
(
url
);
String
scheme
=
u
.
getScheme
();
if
(!(
scheme
.
equalsIgnoreCase
(
"http"
)
||
scheme
.
equalsIgnoreCase
(
"https"
)))
{
throw
new
IllegalArgumentException
(
"unexpected URL scheme"
);
}
if
(!
u
.
getSchemeSpecificPart
().
equals
(
"*"
))
{
u
=
URI
.
create
(
scheme
+
"://"
+
u
.
getAuthority
()
+
u
.
getPath
());
}
return
u
;
}
private
String
actions
()
{
StringBuilder
b
=
new
StringBuilder
();
for
(
String
s
:
methods
)
{
b
.
append
(
s
);
}
b
.
append
(
":"
);
for
(
String
s
:
requestHeaders
)
{
b
.
append
(
s
);
}
return
b
.
toString
();
}
/**
* restore the state of this object from stream
*/
private
void
readObject
(
ObjectInputStream
s
)
throws
IOException
,
ClassNotFoundException
{
ObjectInputStream
.
GetField
fields
=
s
.
readFields
();
String
actions
=
(
String
)
fields
.
get
(
"actions"
,
null
);
init
(
actions
);
}
}
src/share/classes/java/net/ServerSocket.java
浏览文件 @
9694304e
...
...
@@ -607,9 +607,9 @@ class ServerSocket implements java.io.Closeable {
}
/**
* Enable/disable
SO_TIMEOUT with the specified timeout, in
*
milliseconds. With this option set to a non-zero timeout,
* a call to accept() for this ServerSocket
* Enable/disable
{@link SocketOptions#SO_TIMEOUT SO_TIMEOUT} with the
*
specified timeout, in milliseconds. With this option set to a non-zero
*
timeout,
a call to accept() for this ServerSocket
* will block for only this amount of time. If the timeout expires,
* a <B>java.net.SocketTimeoutException</B> is raised, though the
* ServerSocket is still valid. The option <B>must</B> be enabled
...
...
@@ -629,9 +629,9 @@ class ServerSocket implements java.io.Closeable {
}
/**
* Retrieve setting for
SO_TIMEOUT. 0 returns implies that the
* option is disabled (i.e., timeout of infinity).
* @return the
SO_TIMEOUT
value
* Retrieve setting for
{@link SocketOptions#SO_TIMEOUT SO_TIMEOUT}.
*
0 returns implies that the
option is disabled (i.e., timeout of infinity).
* @return the
{@link SocketOptions#SO_TIMEOUT SO_TIMEOUT}
value
* @exception IOException if an I/O error occurs
* @since JDK1.1
* @see #setSoTimeout(int)
...
...
@@ -649,7 +649,8 @@ class ServerSocket implements java.io.Closeable {
}
/**
* Enable/disable the SO_REUSEADDR socket option.
* Enable/disable the {@link SocketOptions#SO_REUSEADDR SO_REUSEADDR}
* socket option.
* <p>
* When a TCP connection is closed the connection may remain
* in a timeout state for a period of time after the connection
...
...
@@ -660,24 +661,23 @@ class ServerSocket implements java.io.Closeable {
* <tt>SocketAddress</tt> if there is a connection in the
* timeout state involving the socket address or port.
* <p>
* Enabling <tt>SO_REUSEADDR</tt> prior to binding the socket
* using {@link #bind(SocketAddress)} allows the socket to be
* bound even though a previous connection is in a timeout
* state.
* Enabling {@link SocketOptions#SO_REUSEADDR SO_REUSEADDR} prior to
* binding the socket using {@link #bind(SocketAddress)} allows the socket
* to be bound even though a previous connection is in a timeout state.
* <p>
* When a <tt>ServerSocket</tt> is created the initial setting
* of
<tt>SO_REUSEADDR</tt> is not defined. Applications can
* use {@link #getReuseAddress()} to determine the initial
* setting of
<tt>SO_REUSEADDR</tt>
.
* of
{@link SocketOptions#SO_REUSEADDR SO_REUSEADDR} is not defined.
*
Applications can
use {@link #getReuseAddress()} to determine the initial
* setting of
{@link SocketOptions#SO_REUSEADDR SO_REUSEADDR}
.
* <p>
* The behaviour when
<tt>SO_REUSEADDR</tt> is enabled or
* disabled after a socket is bound (See {@link #isBound()})
* The behaviour when
{@link SocketOptions#SO_REUSEADDR SO_REUSEADDR} is
*
enabled or
disabled after a socket is bound (See {@link #isBound()})
* is not defined.
*
* @param on whether to enable or disable the socket option
* @exception SocketException if an error occurs enabling or
* disabling the
<tt>SO_RESUEADDR</tt> socket option,
* or the socket is closed.
* disabling the
{@link SocketOptions#SO_REUSEADDR SO_REUSEADDR}
*
socket option,
or the socket is closed.
* @since 1.4
* @see #getReuseAddress()
* @see #bind(SocketAddress)
...
...
@@ -691,9 +691,10 @@ class ServerSocket implements java.io.Closeable {
}
/**
* Tests if
SO_REUSEADDR
is enabled.
* Tests if
{@link SocketOptions#SO_REUSEADDR SO_REUSEADDR}
is enabled.
*
* @return a <code>boolean</code> indicating whether or not SO_REUSEADDR is enabled.
* @return a <code>boolean</code> indicating whether or not
* {@link SocketOptions#SO_REUSEADDR SO_REUSEADDR} is enabled.
* @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
* @since 1.4
...
...
@@ -768,15 +769,16 @@ class ServerSocket implements java.io.Closeable {
}
/**
* Sets a default proposed value for the SO_RCVBUF option for sockets
* Sets a default proposed value for the
* {@link SocketOptions#SO_RCVBUF SO_RCVBUF} option for sockets
* accepted from this <tt>ServerSocket</tt>. The value actually set
* in the accepted socket must be determined by calling
* {@link Socket#getReceiveBufferSize()} after the socket
* is returned by {@link #accept()}.
* <p>
* The value of
SO_RCVBUF is used both to set the size of the internal
* s
ocket receive buffer, and to set the size of the TCP receive window
* that is advertized to the remote peer.
* The value of
{@link SocketOptions#SO_RCVBUF SO_RCVBUF} is used both to
* s
et the size of the internal socket receive buffer, and to set the size
*
of the TCP receive window
that is advertized to the remote peer.
* <p>
* It is possible to change the value subsequently, by calling
* {@link Socket#setReceiveBufferSize(int)}. However, if the application
...
...
@@ -812,15 +814,16 @@ class ServerSocket implements java.io.Closeable {
}
/**
* Gets the value of the
SO_RCVBUF option for this <tt>ServerSocket</tt>,
*
that is the proposed buffer size that will be used for Sockets accepted
* from this <tt>ServerSocket</tt>.
* Gets the value of the
{@link SocketOptions#SO_RCVBUF SO_RCVBUF} option
*
for this <tt>ServerSocket</tt>, that is the proposed buffer size that
*
will be used for Sockets accepted
from this <tt>ServerSocket</tt>.
*
* <p>Note, the value actually set in the accepted socket is determined by
* calling {@link Socket#getReceiveBufferSize()}.
* @return the value of the SO_RCVBUF option for this <tt>Socket</tt>.
* @return the value of the {@link SocketOptions#SO_RCVBUF SO_RCVBUF}
* option for this <tt>Socket</tt>.
* @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
*
in the underlying protocol, such as a TCP error.
* @see #setReceiveBufferSize(int)
* @since 1.4
*/
...
...
src/share/classes/java/net/Socket.java
浏览文件 @
9694304e
...
...
@@ -924,7 +924,8 @@ class Socket implements java.io.Closeable {
}
/**
* Enable/disable TCP_NODELAY (disable/enable Nagle's algorithm).
* Enable/disable {@link SocketOptions#TCP_NODELAY TCP_NODELAY}
* (disable/enable Nagle's algorithm).
*
* @param on <code>true</code> to enable TCP_NODELAY,
* <code>false</code> to disable.
...
...
@@ -943,9 +944,10 @@ class Socket implements java.io.Closeable {
}
/**
* Tests if
TCP_NODELAY
is enabled.
* Tests if
{@link SocketOptions#TCP_NODELAY TCP_NODELAY}
is enabled.
*
* @return a <code>boolean</code> indicating whether or not TCP_NODELAY is enabled.
* @return a <code>boolean</code> indicating whether or not
* {@link SocketOptions#TCP_NODELAY TCP_NODELAY} is enabled.
* @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
* @since JDK1.1
...
...
@@ -958,8 +960,9 @@ class Socket implements java.io.Closeable {
}
/**
* Enable/disable SO_LINGER with the specified linger time in seconds.
* The maximum timeout value is platform specific.
* Enable/disable {@link SocketOptions#SO_LINGER SO_LINGER} with the
* specified linger time in seconds. The maximum timeout value is platform
* specific.
*
* The setting only affects socket close.
*
...
...
@@ -987,12 +990,13 @@ class Socket implements java.io.Closeable {
}
/**
* Returns setting for SO_LINGER. -1 returns implies that the
* Returns setting for {@link SocketOptions#SO_LINGER SO_LINGER}.
* -1 returns implies that the
* option is disabled.
*
* The setting only affects socket close.
*
* @return the setting for
SO_LINGER
.
* @return the setting for
{@link SocketOptions#SO_LINGER SO_LINGER}
.
* @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
* @since JDK1.1
...
...
@@ -1027,7 +1031,8 @@ class Socket implements java.io.Closeable {
}
/**
* Enable/disable OOBINLINE (receipt of TCP urgent data)
* Enable/disable {@link SocketOptions#SO_OOBINLINE SO_OOBINLINE}
* (receipt of TCP urgent data)
*
* By default, this option is disabled and TCP urgent data received on a
* socket is silently discarded. If the user wishes to receive urgent data, then
...
...
@@ -1039,8 +1044,9 @@ class Socket implements java.io.Closeable {
* and there is no capability to distinguish between normal data and urgent
* data unless provided by a higher level protocol.
*
* @param on <code>true</code> to enable OOBINLINE,
* <code>false</code> to disable.
* @param on <code>true</code> to enable
* {@link SocketOptions#SO_OOBINLINE SO_OOBINLINE},
* <code>false</code> to disable.
*
* @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
...
...
@@ -1056,9 +1062,11 @@ class Socket implements java.io.Closeable {
}
/**
* Tests if OOBINLINE is enabled.
* Tests if {@link SocketOptions#SO_OOBINLINE SO_OOBINLINE} is enabled.
*
* @return a <code>boolean</code> indicating whether or not
* {@link SocketOptions#SO_OOBINLINE SO_OOBINLINE}is enabled.
*
* @return a <code>boolean</code> indicating whether or not OOBINLINE is enabled.
* @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
* @since 1.4
...
...
@@ -1071,15 +1079,16 @@ class Socket implements java.io.Closeable {
}
/**
* Enable/disable
SO_TIMEOUT with the specified timeout, in
*
milliseconds. With this option set to a non-zero timeout,
*
a read() call on the InputStream associated with this Socket
*
will block for only this amount of time. If the timeout expires,
* a <B>java.net.SocketTimeoutException</B> is raised, though the
* Enable/disable
{@link SocketOptions#SO_TIMEOUT SO_TIMEOUT}
*
with the specified timeout, in milliseconds. With this option set
*
to a non-zero timeout, a read() call on the InputStream associated with
*
this Socket will block for only this amount of time. If the timeout
*
expires,
a <B>java.net.SocketTimeoutException</B> is raised, though the
* Socket is still valid. The option <B>must</B> be enabled
* prior to entering the blocking operation to have effect. The
* timeout must be > 0.
* A timeout of zero is interpreted as an infinite timeout.
*
* @param timeout the specified timeout, in milliseconds.
* @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
...
...
@@ -1096,11 +1105,13 @@ class Socket implements java.io.Closeable {
}
/**
* Returns setting for SO_TIMEOUT. 0 returns implies that the
* option is disabled (i.e., timeout of infinity).
* @return the setting for SO_TIMEOUT
* Returns setting for {@link SocketOptions#SO_TIMEOUT SO_TIMEOUT}.
* 0 returns implies that the option is disabled (i.e., timeout of infinity).
*
* @return the setting for {@link SocketOptions#SO_TIMEOUT SO_TIMEOUT}
* @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
*
* @since JDK1.1
* @see #setSoTimeout(int)
*/
...
...
@@ -1117,14 +1128,15 @@ class Socket implements java.io.Closeable {
}
/**
* Sets the SO_SNDBUF option to the specified value for this
* <tt>Socket</tt>. The SO_SNDBUF option is used by the platform's
* networking code as a hint for the size to set
* the underlying network I/O buffers.
* Sets the {@link SocketOptions#SO_SNDBUF SO_SNDBUF} option to the
* specified value for this <tt>Socket</tt>.
* The {@link SocketOptions#SO_SNDBUF SO_SNDBUF} option is used by the
* platform's networking code as a hint for the size to set the underlying
* network I/O buffers.
*
* <p>Because
SO_SNDBUF is a hint, applications that want to
*
verify what size the buffers were set to should call
* {@link #getSendBufferSize()}.
* <p>Because
{@link SocketOptions#SO_SNDBUF SO_SNDBUF} is a hint,
*
applications that want to verify what size the buffers were set to
*
should call
{@link #getSendBufferSize()}.
*
* @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
...
...
@@ -1149,10 +1161,11 @@ class Socket implements java.io.Closeable {
}
/**
* Get value of the
SO_SNDBUF option for this <tt>Socket</tt>,
* that is the buffer size used by the platform
* Get value of the
{@link SocketOptions#SO_SNDBUF SO_SNDBUF} option
*
for this <tt>Socket</tt>,
that is the buffer size used by the platform
* for output on this <tt>Socket</tt>.
* @return the value of the SO_SNDBUF option for this <tt>Socket</tt>.
* @return the value of the {@link SocketOptions#SO_SNDBUF SO_SNDBUF}
* option for this <tt>Socket</tt>.
*
* @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
...
...
@@ -1172,25 +1185,26 @@ class Socket implements java.io.Closeable {
}
/**
* Sets the SO_RCVBUF option to the specified value for this
* <tt>Socket</tt>. The SO_RCVBUF option is used by the platform's
* networking code as a hint for the size to set
* Sets the {@link SocketOptions#SO_RCVBUF SO_RCVBUF} option to the
* specified value for this <tt>Socket</tt>. The
* {@link SocketOptions#SO_RCVBUF SO_RCVBUF} option is
* used by the platform's networking code as a hint for the size to set
* the underlying network I/O buffers.
*
* <p>Increasing the receive buffer size can increase the performance of
* network I/O for high-volume connection, while decreasing it can
* help reduce the backlog of incoming data.
*
* <p>Because
SO_RCVBUF is a hint, applications that want to
*
verify what size the buffers were set to should call
* {@link #getReceiveBufferSize()}.
* <p>Because
{@link SocketOptions#SO_RCVBUF SO_RCVBUF} is a hint,
*
applications that want to verify what size the buffers were set to
*
should call
{@link #getReceiveBufferSize()}.
*
* <p>The value of
SO_RCVBUF is also used to set the TCP receive window
* t
hat is advertized to the remote peer. Generally, the window size
*
can be modified at any time when a socket is connected. However, if
*
a receive window larger than 64K is required then this must be requested
*
<B>before</B> the socket is connected to the remote peer. There are two
* cases to be aware of:<p>
* <p>The value of
{@link SocketOptions#SO_RCVBUF SO_RCVBUF} is also used
* t
o set the TCP receive window that is advertized to the remote peer.
*
Generally, the window size can be modified at any time when a socket is
*
connected. However, if a receive window larger than 64K is required then
*
this must be requested <B>before</B> the socket is connected to the
*
remote peer. There are two
cases to be aware of:<p>
* <ol>
* <li>For sockets accepted from a ServerSocket, this must be done by calling
* {@link ServerSocket#setReceiveBufferSize(int)} before the ServerSocket
...
...
@@ -1221,11 +1235,12 @@ class Socket implements java.io.Closeable {
}
/**
* Gets the value of the
SO_RCVBUF option for this <tt>Socket</tt>,
*
that is the buffer size used by the platform for
* input on this <tt>Socket</tt>.
* Gets the value of the
{@link SocketOptions#SO_RCVBUF SO_RCVBUF} option
*
for this <tt>Socket</tt>, that is the buffer size used by the platform
*
for
input on this <tt>Socket</tt>.
*
* @return the value of the SO_RCVBUF option for this <tt>Socket</tt>.
* @return the value of the {@link SocketOptions#SO_RCVBUF SO_RCVBUF}
* option for this <tt>Socket</tt>.
* @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
* @see #setReceiveBufferSize(int)
...
...
@@ -1244,9 +1259,9 @@ class Socket implements java.io.Closeable {
}
/**
* Enable/disable
SO_KEEPALIVE
.
* Enable/disable
{@link SocketOptions#SO_KEEPALIVE SO_KEEPALIVE}
.
*
* @param on
whether or not to have socket keep alive turned on.
* @param on whether or not to have socket keep alive turned on.
* @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
* @since 1.3
...
...
@@ -1259,9 +1274,10 @@ class Socket implements java.io.Closeable {
}
/**
* Tests if
SO_KEEPALIVE
is enabled.
* Tests if
{@link SocketOptions#SO_KEEPALIVE SO_KEEPALIVE}
is enabled.
*
* @return a <code>boolean</code> indicating whether or not SO_KEEPALIVE is enabled.
* @return a <code>boolean</code> indicating whether or not
* {@link SocketOptions#SO_KEEPALIVE SO_KEEPALIVE} is enabled.
* @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
* @since 1.3
...
...
@@ -1317,6 +1333,7 @@ class Socket implements java.io.Closeable {
* traffic class or type-of-service
* @since 1.4
* @see #getTrafficClass
* @see SocketOptions#IP_TOS
*/
public
void
setTrafficClass
(
int
tc
)
throws
SocketException
{
if
(
tc
<
0
||
tc
>
255
)
...
...
@@ -1341,13 +1358,15 @@ class Socket implements java.io.Closeable {
* traffic class or type-of-service value.
* @since 1.4
* @see #setTrafficClass(int)
* @see SocketOptions#IP_TOS
*/
public
int
getTrafficClass
()
throws
SocketException
{
return
((
Integer
)
(
getImpl
().
getOption
(
SocketOptions
.
IP_TOS
))).
intValue
();
}
/**
* Enable/disable the SO_REUSEADDR socket option.
* Enable/disable the {@link SocketOptions#SO_REUSEADDR SO_REUSEADDR}
* socket option.
* <p>
* When a TCP connection is closed the connection may remain
* in a timeout state for a period of time after the connection
...
...
@@ -1358,22 +1377,22 @@ class Socket implements java.io.Closeable {
* <tt>SocketAddress</tt> if there is a connection in the
* timeout state involving the socket address or port.
* <p>
* Enabling
<tt>SO_REUSEADDR</tt> prior to binding the socket
*
using {@link #bind(SocketAddress)} allows the socket to be
* bound even though a previous connection is in a timeout
* Enabling
{@link SocketOptions#SO_REUSEADDR SO_REUSEADDR}
*
prior to binding the socket using {@link #bind(SocketAddress)} allows
*
the socket to be
bound even though a previous connection is in a timeout
* state.
* <p>
* When a <tt>Socket</tt> is created the initial setting
* of
<tt>SO_REUSEADDR</tt>
is disabled.
* of
{@link SocketOptions#SO_REUSEADDR SO_REUSEADDR}
is disabled.
* <p>
* The behaviour when
<tt>SO_REUSEADDR</tt> is enabled or
* disabled after a socket is bound (See {@link #isBound()})
* The behaviour when
{@link SocketOptions#SO_REUSEADDR SO_REUSEADDR} is
*
enabled or
disabled after a socket is bound (See {@link #isBound()})
* is not defined.
*
* @param on whether to enable or disable the socket option
* @exception SocketException if an error occurs enabling or
* disabling the
<tt>SO_RESUEADDR</tt> socket option,
* or the socket is closed.
* disabling the
{@link SocketOptions#SO_REUSEADDR SO_REUSEADDR}
*
socket option,
or the socket is closed.
* @since 1.4
* @see #getReuseAddress()
* @see #bind(SocketAddress)
...
...
@@ -1387,9 +1406,10 @@ class Socket implements java.io.Closeable {
}
/**
* Tests if
SO_REUSEADDR
is enabled.
* Tests if
{@link SocketOptions#SO_REUSEADDR SO_REUSEADDR}
is enabled.
*
* @return a <code>boolean</code> indicating whether or not SO_REUSEADDR is enabled.
* @return a <code>boolean</code> indicating whether or not
* {@link SocketOptions#SO_REUSEADDR SO_REUSEADDR} is enabled.
* @exception SocketException if there is an error
* in the underlying protocol, such as a TCP error.
* @since 1.4
...
...
src/share/classes/java/nio/charset/Charset.java
浏览文件 @
9694304e
...
...
@@ -427,46 +427,38 @@ public abstract class Charset
}
/* The extended set of charsets */
private
static
Object
extendedProviderLock
=
new
Object
();
private
static
boolean
extendedProviderProbed
=
false
;
private
static
CharsetProvider
extendedProvider
=
null
;
private
static
void
probeExtendedProvider
()
{
AccessController
.
doPrivileged
(
new
PrivilegedAction
<
Object
>()
{
public
Object
run
()
{
try
{
Class
<?>
epc
=
Class
.
forName
(
"sun.nio.cs.ext.ExtendedCharsets"
);
extendedProvider
=
(
CharsetProvider
)
epc
.
newInstance
();
}
catch
(
ClassNotFoundException
x
)
{
// Extended charsets not available
// (charsets.jar not present)
}
catch
(
InstantiationException
x
)
{
throw
new
Error
(
x
);
}
catch
(
IllegalAccessException
x
)
{
throw
new
Error
(
x
);
}
return
null
;
}
});
private
static
class
ExtendedProviderHolder
{
static
final
CharsetProvider
extendedProvider
=
extendedProvider
()
;
// returns ExtendedProvider, if installed
private
static
CharsetProvider
extendedProvider
()
{
return
AccessController
.
doPrivileged
(
new
PrivilegedAction
<
CharsetProvider
>()
{
public
CharsetProvider
run
()
{
try
{
Class
<?>
epc
=
Class
.
forName
(
"sun.nio.cs.ext.ExtendedCharsets"
);
return
(
CharsetProvider
)
epc
.
newInstance
();
}
catch
(
ClassNotFoundException
x
)
{
// Extended charsets not available
// (charsets.jar not present)
}
catch
(
InstantiationException
|
IllegalAccessException
x
)
{
throw
new
Error
(
x
);
}
return
null
;
}
});
}
}
private
static
Charset
lookupExtendedCharset
(
String
charsetName
)
{
CharsetProvider
ecp
=
null
;
synchronized
(
extendedProviderLock
)
{
if
(!
extendedProviderProbed
)
{
probeExtendedProvider
();
extendedProviderProbed
=
true
;
}
ecp
=
extendedProvider
;
}
CharsetProvider
ecp
=
ExtendedProviderHolder
.
extendedProvider
;
return
(
ecp
!=
null
)
?
ecp
.
charsetForName
(
charsetName
)
:
null
;
}
private
static
Charset
lookup
(
String
charsetName
)
{
if
(
charsetName
==
null
)
throw
new
IllegalArgumentException
(
"Null charset name"
);
Object
[]
a
;
if
((
a
=
cache1
)
!=
null
&&
charsetName
.
equals
(
a
[
0
]))
return
(
Charset
)
a
[
1
];
...
...
@@ -483,7 +475,6 @@ public abstract class Charset
cache1
=
a
;
return
(
Charset
)
a
[
1
];
}
Charset
cs
;
if
((
cs
=
standardProvider
.
charsetForName
(
charsetName
))
!=
null
||
(
cs
=
lookupExtendedCharset
(
charsetName
))
!=
null
||
...
...
@@ -589,6 +580,9 @@ public abstract class Charset
new
TreeMap
<
String
,
Charset
>(
ASCIICaseInsensitiveComparator
.
CASE_INSENSITIVE_ORDER
);
put
(
standardProvider
.
charsets
(),
m
);
CharsetProvider
ecp
=
ExtendedProviderHolder
.
extendedProvider
;
if
(
ecp
!=
null
)
put
(
ecp
.
charsets
(),
m
);
for
(
Iterator
<
CharsetProvider
>
i
=
providers
();
i
.
hasNext
();)
{
CharsetProvider
cp
=
i
.
next
();
put
(
cp
.
charsets
(),
m
);
...
...
src/share/classes/java/time/Clock.java
浏览文件 @
9694304e
...
...
@@ -103,7 +103,7 @@ import java.util.TimeZone;
* system clock This may use {@link System#currentTimeMillis()}, or a higher
* resolution clock if one is available.
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This abstract class must be implemented with care to ensure other operate correctly.
* All implementations that can be instantiated must be final, immutable and thread-safe.
* <p>
...
...
@@ -112,13 +112,23 @@ import java.util.TimeZone;
* obtain the time from a central time server across the network. Obviously, in this case the
* lookup could fail, and so the method is permitted to throw an exception.
* <p>
* The returned instants from {@code Clock} work on a time-scale that ignores leap seconds.
* If the implementation wraps a source that provides leap second information, then a mechanism
* should be used to "smooth" the leap second, such as UTC-SLS.
* The returned instants from {@code Clock} work on a time-scale that ignores leap seconds,
* as described in {@link Instant}. If the implementation wraps a source that provides leap
* second information, then a mechanism should be used to "smooth" the leap second.
* The Java Time-Scale mandates the use of UTC-SLS, however clock implementations may choose
* how accurate they are with the time-scale so long as they document how they work.
* Implementations are therefore not required to actually perform the UTC-SLS slew or to
* otherwise be aware of leap seconds.
* <p>
* Implementations should implement {@code Serializable} wherever possible and must
* document whether or not they do support serialization.
*
* @implNote
* The clock implementation provided here is based on {@link System#currentTimeMillis()}.
* That method provides little to no guarantee about the accuracy of the clock.
* Applications requiring a more accurate clock must implement this abstract class
* themselves using a different external clock, such as an NTP server.
*
* @since 1.8
*/
public
abstract
class
Clock
{
...
...
@@ -370,7 +380,7 @@ public abstract class Clock {
/**
* Gets the current millisecond instant of the clock.
* <p>
* This returns the millisecond-based instant, measured from 1970-01-01T00:00
UTC
.
* This returns the millisecond-based instant, measured from 1970-01-01T00:00
Z (UTC)
.
* This is equivalent to the definition of {@link System#currentTimeMillis()}.
* <p>
* Most applications should avoid this method and use {@link Instant} to represent
...
...
@@ -381,7 +391,7 @@ public abstract class Clock {
* The default implementation currently calls {@link #instant}.
*
* @return the current millisecond instant from this clock, measured from
* the Java epoch of 1970-01-01T00:00
UTC
, not null
* the Java epoch of 1970-01-01T00:00
Z (UTC)
, not null
* @throws DateTimeException if the instant cannot be obtained, not thrown by most implementations
*/
public
long
millis
()
{
...
...
src/share/classes/java/time/DateTimeException.java
浏览文件 @
9694304e
...
...
@@ -67,7 +67,7 @@ package java.time;
* This exception is used to indicate problems with creating, querying
* and manipulating date-time objects.
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This class is intended for use in a single thread.
*
* @since 1.8
...
...
src/share/classes/java/time/DayOfWeek.java
浏览文件 @
9694304e
...
...
@@ -100,7 +100,7 @@ import java.util.Locale;
* As such, this enum may be used by any calendar system that has the day-of-week
* concept defined exactly equivalent to the ISO calendar system.
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This is an immutable and thread-safe enum.
*
* @since 1.8
...
...
src/share/classes/java/time/Duration.java
浏览文件 @
9694304e
...
...
@@ -118,7 +118,7 @@ import java.util.regex.Pattern;
* most applications.
* See {@link Instant} for a discussion as to the meaning of the second and time-scales.
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This class is immutable and thread-safe.
*
* @since 1.8
...
...
src/share/classes/java/time/Instant.java
浏览文件 @
9694304e
...
...
@@ -142,47 +142,60 @@ import java.util.Objects;
* introduce other changes.
* <p>
* Given the complexity of accurate timekeeping described above, this Java API defines
* its own time-scale with a simplification. The Java time-scale is defined as follows:
* its own time-scale, the <i>Java Time-Scale</i>.
* <p>
* The Java Time-Scale divides each calendar day into exactly 86400
* subdivisions, known as seconds. These seconds may differ from the
* SI second. It closely matches the de facto international civil time
* scale, the definition of which changes from time to time.
* <p>
* The Java Time-Scale has slightly different definitions for different
* segments of the time-line, each based on the consensus international
* time scale that is used as the basis for civil time. Whenever the
* internationally-agreed time scale is modified or replaced, a new
* segment of the Java Time-Scale must be defined for it. Each segment
* must meet these requirements:
* <p><ul>
* <li>
midday will always be exactly as defined by the agreed international civil time</li>
*
<li>other times during the day will be broadly in line with the agreed international civil time
</li>
* <li>the
day will be divided into exactly 86400 subdivisions, referred to as "seconds"</li>
*
<li>the Java "second" may differ from an SI second
</li>
* <li>
a well-defined algorithm must be specified to map each second in the accurate agreed
*
international civil time to each "second" in this time-scale
</li>
* <li>
the Java Time-Scale shall closely match the underlying international
*
civil time scale;
</li>
* <li>the
Java Time-Scale shall exactly match the international civil
*
time scale at noon each day;
</li>
* <li>
the Java Time-Scale shall have a precisely-defined relationship to
*
the international civil time scale.
</li>
* </ul><p>
* Agreed international civil time is the base time-scale agreed by international convention,
* which in 2012 is UTC (with leap-seconds).
* There are currently, as of 2013, two segments in the Java time-scale.
* <p>
* In 2012, the definition of the Java time-scale is the same as UTC for all days except
* those where a leap-second occurs. On days where a leap-second does occur, the time-scale
* effectively eliminates the leap-second, maintaining the fiction of 86400 seconds in the day.
* The approved well-defined algorithm to eliminate leap-seconds is specified as
* For the segment from 1972-11-03 (exact boundary discussed below) until
* further notice, the consensus international time scale is UTC (with
* leap seconds). In this segment, the Java Time-Scale is identical to
* <a href="http://www.cl.cam.ac.uk/~mgk25/time/utc-sls/">UTC-SLS</a>.
* This is identical to UTC on days that do not have a leap second.
* On days that do have a leap second, the leap second is spread equally
* over the last 1000 seconds of the day, maintaining the appearance of
* exactly 86400 seconds per day.
* <p>
* UTC-SLS is a simple algorithm that smoothes the leap-second over the last 1000 seconds of
* the day, making each of the last 1000 seconds 1/1000th longer or shorter than an SI second.
* Implementations built on an accurate leap-second aware time source should use UTC-SLS.
* Use of a different algorithm risks confusion and misinterpretation of instants around a
* leap-second and is discouraged.
* <p>
* The main benefit of always dividing the day into 86400 subdivisions is that it matches the
* expectations of most users of the API. The alternative is to force every user to understand
* what a leap second is and to force them to have special logic to handle them.
* Most applications do not have access to a clock that is accurate enough to record leap-seconds.
* Most applications also do not have a problem with a second being a very small amount longer or
* shorter than a real SI second during a leap-second.
* For the segment prior to 1972-11-03, extending back arbitrarily far,
* the consensus international time scale is defined to be UT1, applied
* proleptically, which is equivalent to the (mean) solar time on the
* prime meridian (Greenwich). In this segment, the Java Time-Scale is
* identical to the consensus international time scale. The exact
* boundary between the two segments is the instant where UT1 = UTC
* between 1972-11-03T00:00 and 1972-11-04T12:00.
* <p>
* One final problem is the definition of the agreed international civil time before the
* introduction of modern UTC in 1972. This includes the Java epoch of {@code 1970-01-01}.
* It is intended that instants before 1972 be interpreted based on the solar day divided
* into 86400 subdivisions, as per the principles of UT1.
* Implementations of the Java time-scale using the JSR-310 API are not
* required to provide any clock that is sub-second accurate, or that
* progresses monotonically or smoothly. Implementations are therefore
* not required to actually perform the UTC-SLS slew or to otherwise be
* aware of leap seconds. JSR-310 does, however, require that
* implementations must document the approach they use when defining a
* clock representing the current instant.
* See {@link Clock} for details on the available clocks.
* <p>
* The Java time-scale is used for all date-time classes.
* This includes {@code Instant}, {@code LocalDate}, {@code LocalTime}, {@code OffsetDateTime},
* {@code ZonedDateTime} and {@code Duration}.
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This class is immutable and thread-safe.
*
* @since 1.8
...
...
@@ -1030,16 +1043,16 @@ public final class Instant
}
/**
* Calculates the period between this instant and another instant in
* terms of the specified unit.
* Calculates the amount of time until another instant in terms of the specified unit.
* <p>
* This calculates the period between two instants in terms of a single unit.
* This calculates the amount of time between two {@code Instant}
* objects in terms of a single {@code TemporalUnit}.
* The start and end points are {@code this} and the specified instant.
* The result will be negative if the end is before the start.
* The calculation returns a whole number, representing the number of
* complete units between the two instants.
* The {@code Temporal} passed to this method must be an {@code Instant}.
* For example, the
period
in days between two dates can be calculated
* For example, the
amount
in days between two dates can be calculated
* using {@code startInstant.periodUntil(endInstant, SECONDS)}.
* <p>
* There are two equivalent ways of using this method.
...
...
@@ -1064,10 +1077,10 @@ public final class Instant
* <p>
* This instance is immutable and unaffected by this method call.
*
* @param endInstant the end date, which must be a
{@code LocalDate
}, not null
* @param unit the unit to measure the
period
in, not null
* @return the amount of t
he period between this date and the end date
* @throws DateTimeException if the
period
cannot be calculated
* @param endInstant the end date, which must be a
n {@code Instant
}, not null
* @param unit the unit to measure the
amount
in, not null
* @return the amount of t
ime between this instant and the end instant
* @throws DateTimeException if the
amount
cannot be calculated
* @throws UnsupportedTemporalTypeException if the unit is not supported
* @throws ArithmeticException if numeric overflow occurs
*/
...
...
@@ -1075,7 +1088,7 @@ public final class Instant
public
long
periodUntil
(
Temporal
endInstant
,
TemporalUnit
unit
)
{
if
(
endInstant
instanceof
Instant
==
false
)
{
Objects
.
requireNonNull
(
endInstant
,
"endInstant"
);
throw
new
DateTimeException
(
"Unable to calculate
period between objects
of two different types"
);
throw
new
DateTimeException
(
"Unable to calculate
amount as objects are
of two different types"
);
}
Instant
end
=
(
Instant
)
endInstant
;
if
(
unit
instanceof
ChronoUnit
)
{
...
...
src/share/classes/java/time/LocalDate.java
浏览文件 @
9694304e
...
...
@@ -121,7 +121,7 @@ import java.util.Objects;
* However, any application that makes use of historical dates, and requires them
* to be accurate will find the ISO-8601 approach unsuitable.
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This class is immutable and thread-safe.
*
* @since 1.8
...
...
@@ -1489,19 +1489,19 @@ public final class LocalDate
}
/**
* Calculates the period between this date and another date in
* terms of the specified unit.
* Calculates the amount of time until another date in terms of the specified unit.
* <p>
* This calculates the period between two dates in terms of a single unit.
* This calculates the amount of time between two {@code LocalDate}
* objects in terms of a single {@code TemporalUnit}.
* The start and end points are {@code this} and the specified date.
* The result will be negative if the end is before the start.
* The {@code Temporal} passed to this method must be a {@code LocalDate}.
* For example, the
period
in days between two dates can be calculated
* For example, the
amount
in days between two dates can be calculated
* using {@code startDate.periodUntil(endDate, DAYS)}.
* <p>
* The calculation returns a whole number, representing the number of
* complete units between the two dates.
* For example, the
period
in months between 2012-06-15 and 2012-08-14
* For example, the
amount
in months between 2012-06-15 and 2012-08-14
* will only be one month as it is one day short of two months.
* <p>
* There are two equivalent ways of using this method.
...
...
@@ -1527,9 +1527,9 @@ public final class LocalDate
* This instance is immutable and unaffected by this method call.
*
* @param endDate the end date, which must be a {@code LocalDate}, not null
* @param unit the unit to measure the
period
in, not null
* @return the amount of t
he period
between this date and the end date
* @throws DateTimeException if the
period
cannot be calculated
* @param unit the unit to measure the
amount
in, not null
* @return the amount of t
ime
between this date and the end date
* @throws DateTimeException if the
amount
cannot be calculated
* @throws UnsupportedTemporalTypeException if the unit is not supported
* @throws ArithmeticException if numeric overflow occurs
*/
...
...
@@ -1538,7 +1538,7 @@ public final class LocalDate
Objects
.
requireNonNull
(
unit
,
"unit"
);
if
(
endDate
instanceof
LocalDate
==
false
)
{
Objects
.
requireNonNull
(
endDate
,
"endDate"
);
throw
new
DateTimeException
(
"Unable to calculate
period between objects
of two different types"
);
throw
new
DateTimeException
(
"Unable to calculate
amount as objects are
of two different types"
);
}
LocalDate
end
=
(
LocalDate
)
endDate
;
if
(
unit
instanceof
ChronoUnit
)
{
...
...
src/share/classes/java/time/LocalDateTime.java
浏览文件 @
9694304e
...
...
@@ -119,7 +119,7 @@ import java.util.Objects;
* However, any application that makes use of historical dates, and requires them
* to be accurate will find the ISO-8601 approach unsuitable.
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This class is immutable and thread-safe.
*
* @since 1.8
...
...
@@ -1562,19 +1562,19 @@ public final class LocalDateTime
}
/**
* Calculates the period between this date-time and another date-time in
* terms of the specified unit.
* Calculates the amount of time until another date-time in terms of the specified unit.
* <p>
* This calculates the period between two date-times in terms of a single unit.
* This calculates the amount of time between two {@code LocalDateTime}
* objects in terms of a single {@code TemporalUnit}.
* The start and end points are {@code this} and the specified date-time.
* The result will be negative if the end is before the start.
* The {@code Temporal} passed to this method must be a {@code LocalDateTime}.
* For example, the
period
in days between two date-times can be calculated
* For example, the
amount
in days between two date-times can be calculated
* using {@code startDateTime.periodUntil(endDateTime, DAYS)}.
* <p>
* The calculation returns a whole number, representing the number of
* complete units between the two date-times.
* For example, the
period
in months between 2012-06-15T00:00 and 2012-08-14T23:59
* For example, the
amount
in months between 2012-06-15T00:00 and 2012-08-14T23:59
* will only be one month as it is one minute short of two months.
* <p>
* There are two equivalent ways of using this method.
...
...
@@ -1602,9 +1602,9 @@ public final class LocalDateTime
* This instance is immutable and unaffected by this method call.
*
* @param endDateTime the end date-time, which must be a {@code LocalDateTime}, not null
* @param unit the unit to measure the
period
in, not null
* @return the amount of t
he period
between this date-time and the end date-time
* @throws DateTimeException if the
period
cannot be calculated
* @param unit the unit to measure the
amount
in, not null
* @return the amount of t
ime
between this date-time and the end date-time
* @throws DateTimeException if the
amount
cannot be calculated
* @throws UnsupportedTemporalTypeException if the unit is not supported
* @throws ArithmeticException if numeric overflow occurs
*/
...
...
@@ -1612,7 +1612,7 @@ public final class LocalDateTime
public
long
periodUntil
(
Temporal
endDateTime
,
TemporalUnit
unit
)
{
if
(
endDateTime
instanceof
LocalDateTime
==
false
)
{
Objects
.
requireNonNull
(
endDateTime
,
"endDateTime"
);
throw
new
DateTimeException
(
"Unable to calculate
period between objects
of two different types"
);
throw
new
DateTimeException
(
"Unable to calculate
amount as objects are
of two different types"
);
}
LocalDateTime
end
=
(
LocalDateTime
)
endDateTime
;
if
(
unit
instanceof
ChronoUnit
)
{
...
...
src/share/classes/java/time/LocalTime.java
浏览文件 @
9694304e
...
...
@@ -109,7 +109,7 @@ import java.util.Objects;
* in most of the world. This API assumes that all calendar systems use the same
* representation, this class, for time-of-day.
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This class is immutable and thread-safe.
*
* @since 1.8
...
...
@@ -974,9 +974,6 @@ public final class LocalTime
* Returns a {@code LocalTime} with the specified number of half-days added.
* This is equivalent to {@link #plusHours(long)} with the amount
* multiplied by 12.
* <li>{@code DAYS} -
* Returns a {@code LocalTime} with the specified number of days added.
* This returns {@code this} time.
* </ul>
* <p>
* All other {@code ChronoUnit} instances will throw an {@code UnsupportedTemporalTypeException}.
...
...
@@ -1007,7 +1004,6 @@ public final class LocalTime
case
MINUTES:
return
plusMinutes
(
amountToAdd
);
case
HOURS:
return
plusHours
(
amountToAdd
);
case
HALF_DAYS:
return
plusHours
((
amountToAdd
%
2
)
*
12
);
case
DAYS:
return
this
;
}
throw
new
UnsupportedTemporalTypeException
(
"Unsupported unit: "
+
unit
.
getName
());
}
...
...
@@ -1291,19 +1287,19 @@ public final class LocalTime
}
/**
* Calculates the period between this time and another time in
* terms of the specified unit.
* Calculates the amount of time until another time in terms of the specified unit.
* <p>
* This calculates the period between two times in terms of a single unit.
* This calculates the amount of time between two {@code LocalTime}
* objects in terms of a single {@code TemporalUnit}.
* The start and end points are {@code this} and the specified time.
* The result will be negative if the end is before the start.
* The {@code Temporal} passed to this method must be a {@code LocalTime}.
* For example, the
period
in hours between two times can be calculated
* For example, the
amount
in hours between two times can be calculated
* using {@code startTime.periodUntil(endTime, HOURS)}.
* <p>
* The calculation returns a whole number, representing the number of
* complete units between the two times.
* For example, the
period
in hours between 11:30 and 13:29 will only
* For example, the
amount
in hours between 11:30 and 13:29 will only
* be one hour as it is one minute short of two hours.
* <p>
* There are two equivalent ways of using this method.
...
...
@@ -1329,9 +1325,9 @@ public final class LocalTime
* This instance is immutable and unaffected by this method call.
*
* @param endTime the end time, which must be a {@code LocalTime}, not null
* @param unit the unit to measure the
period
in, not null
* @return the amount of t
he period
between this time and the end time
* @throws DateTimeException if the
period
cannot be calculated
* @param unit the unit to measure the
amount
in, not null
* @return the amount of t
ime
between this time and the end time
* @throws DateTimeException if the
amount
cannot be calculated
* @throws UnsupportedTemporalTypeException if the unit is not supported
* @throws ArithmeticException if numeric overflow occurs
*/
...
...
@@ -1339,7 +1335,7 @@ public final class LocalTime
public
long
periodUntil
(
Temporal
endTime
,
TemporalUnit
unit
)
{
if
(
endTime
instanceof
LocalTime
==
false
)
{
Objects
.
requireNonNull
(
endTime
,
"endTime"
);
throw
new
DateTimeException
(
"Unable to calculate
period between objects
of two different types"
);
throw
new
DateTimeException
(
"Unable to calculate
amount as objects are
of two different types"
);
}
LocalTime
end
=
(
LocalTime
)
endTime
;
if
(
unit
instanceof
ChronoUnit
)
{
...
...
src/share/classes/java/time/Month.java
浏览文件 @
9694304e
...
...
@@ -97,7 +97,7 @@ import java.util.Locale;
* As such, this enum may be used by any calendar system that has the month-of-year
* concept defined exactly equivalent to the ISO-8601 calendar system.
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This is an immutable and thread-safe enum.
*
* @since 1.8
...
...
src/share/classes/java/time/MonthDay.java
浏览文件 @
9694304e
...
...
@@ -111,7 +111,7 @@ import java.util.Objects;
* However, any application that makes use of historical dates, and requires them
* to be accurate will find the ISO-8601 approach unsuitable.
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This class is immutable and thread-safe.
*
* @since 1.8
...
...
src/share/classes/java/time/OffsetDateTime.java
浏览文件 @
9694304e
...
...
@@ -111,7 +111,7 @@ import java.util.Objects;
* in simpler applications. This class may be used when modeling date-time concepts in
* more detail, or when communicating to a database or in a network protocol.
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This class is immutable and thread-safe.
*
* @since 1.8
...
...
@@ -1521,10 +1521,10 @@ public final class OffsetDateTime
}
/**
* Calculates the period between this date-time and another date-time in
* terms of the specified unit.
* Calculates the amount of time until another date-time in terms of the specified unit.
* <p>
* This calculates the period between two date-times in terms of a single unit.
* This calculates the amount of time between two {@code OffsetDateTime}
* objects in terms of a single {@code TemporalUnit}.
* The start and end points are {@code this} and the specified date-time.
* The result will be negative if the end is before the start.
* For example, the period in days between two date-times can be calculated
...
...
@@ -1564,9 +1564,9 @@ public final class OffsetDateTime
* This instance is immutable and unaffected by this method call.
*
* @param endDateTime the end date-time, which must be an {@code OffsetDateTime}, not null
* @param unit the unit to measure the
period
in, not null
* @return the amount of t
he period
between this date-time and the end date-time
* @throws DateTimeException if the
period
cannot be calculated
* @param unit the unit to measure the
amount
in, not null
* @return the amount of t
ime
between this date-time and the end date-time
* @throws DateTimeException if the
amount
cannot be calculated
* @throws UnsupportedTemporalTypeException if the unit is not supported
* @throws ArithmeticException if numeric overflow occurs
*/
...
...
@@ -1574,7 +1574,7 @@ public final class OffsetDateTime
public
long
periodUntil
(
Temporal
endDateTime
,
TemporalUnit
unit
)
{
if
(
endDateTime
instanceof
OffsetDateTime
==
false
)
{
Objects
.
requireNonNull
(
endDateTime
,
"endDateTime"
);
throw
new
DateTimeException
(
"Unable to calculate
period between objects
of two different types"
);
throw
new
DateTimeException
(
"Unable to calculate
amount as objects are
of two different types"
);
}
if
(
unit
instanceof
ChronoUnit
)
{
OffsetDateTime
end
=
(
OffsetDateTime
)
endDateTime
;
...
...
src/share/classes/java/time/OffsetTime.java
浏览文件 @
9694304e
...
...
@@ -102,7 +102,7 @@ import java.util.Objects;
* For example, the value "13:45.30.123456789+02:00" can be stored
* in an {@code OffsetTime}.
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This class is immutable and thread-safe.
*
* @since 1.8
...
...
@@ -1077,10 +1077,10 @@ public final class OffsetTime
}
/**
* Calculates the period between this time and another time in
* terms of the specified unit.
* Calculates the amount of time until another time in terms of the specified unit.
* <p>
* This calculates the period between two times in terms of a single unit.
* This calculates the amount of time between two {@code OffsetTime}
* objects in terms of a single {@code TemporalUnit}.
* The start and end points are {@code this} and the specified time.
* The result will be negative if the end is before the start.
* For example, the period in hours between two times can be calculated
...
...
@@ -1118,9 +1118,9 @@ public final class OffsetTime
* This instance is immutable and unaffected by this method call.
*
* @param endTime the end time, which must be an {@code OffsetTime}, not null
* @param unit the unit to measure the
period
in, not null
* @return the amount of t
he period
between this time and the end time
* @throws DateTimeException if the
period
cannot be calculated
* @param unit the unit to measure the
amount
in, not null
* @return the amount of t
ime
between this time and the end time
* @throws DateTimeException if the
amount
cannot be calculated
* @throws UnsupportedTemporalTypeException if the unit is not supported
* @throws ArithmeticException if numeric overflow occurs
*/
...
...
@@ -1128,7 +1128,7 @@ public final class OffsetTime
public
long
periodUntil
(
Temporal
endTime
,
TemporalUnit
unit
)
{
if
(
endTime
instanceof
OffsetTime
==
false
)
{
Objects
.
requireNonNull
(
endTime
,
"endTime"
);
throw
new
DateTimeException
(
"Unable to calculate
period between objects
of two different types"
);
throw
new
DateTimeException
(
"Unable to calculate
amount as objects are
of two different types"
);
}
if
(
unit
instanceof
ChronoUnit
)
{
OffsetTime
end
=
(
OffsetTime
)
endTime
;
...
...
src/share/classes/java/time/Period.java
浏览文件 @
9694304e
...
...
@@ -119,7 +119,7 @@ import java.util.regex.Pattern;
* The months and years fields may be {@linkplain #normalized() normalized}.
* The normalization assumes a 12 month year, so is not appropriate for all calendar systems.
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This class is immutable and thread-safe.
*
* @since 1.8
...
...
src/share/classes/java/time/Ser.java
浏览文件 @
9694304e
...
...
@@ -66,7 +66,7 @@ import java.io.StreamCorruptedException;
/**
* The shared serialization delegate for this package.
*
*
<h3>Implementation notes</h3>
*
@implNote
* This class wraps the object being serialized, and takes a byte representing the type of the class to
* be serialized. This byte can also be used for versioning the serialization format. In this case another
* byte flag would be used in order to specify an alternative version of the type format.
...
...
src/share/classes/java/time/Year.java
浏览文件 @
9694304e
...
...
@@ -115,7 +115,7 @@ import java.util.Objects;
* However, any application that makes use of historical dates, and requires them
* to be accurate will find the ISO-8601 approach unsuitable.
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This class is immutable and thread-safe.
*
* @since 1.8
...
...
@@ -813,10 +813,10 @@ public final class Year
}
/**
* Calculates the period between this year and another year in
* terms of the specified unit.
* Calculates the amount of time until another year in terms of the specified unit.
* <p>
* This calculates the period between two years in terms of a single unit.
* This calculates the amount of time between two {@code Year}
* objects in terms of a single {@code TemporalUnit}.
* The start and end points are {@code this} and the specified year.
* The result will be negative if the end is before the start.
* The {@code Temporal} passed to this method must be a {@code Year}.
...
...
@@ -851,9 +851,9 @@ public final class Year
* This instance is immutable and unaffected by this method call.
*
* @param endYear the end year, which must be a {@code Year}, not null
* @param unit the unit to measure the
period
in, not null
* @return the amount of t
he period
between this year and the end year
* @throws DateTimeException if the
period
cannot be calculated
* @param unit the unit to measure the
amount
in, not null
* @return the amount of t
ime
between this year and the end year
* @throws DateTimeException if the
amount
cannot be calculated
* @throws UnsupportedTemporalTypeException if the unit is not supported
* @throws ArithmeticException if numeric overflow occurs
*/
...
...
@@ -861,7 +861,7 @@ public final class Year
public
long
periodUntil
(
Temporal
endYear
,
TemporalUnit
unit
)
{
if
(
endYear
instanceof
Year
==
false
)
{
Objects
.
requireNonNull
(
endYear
,
"endYear"
);
throw
new
DateTimeException
(
"Unable to calculate
period between objects
of two different types"
);
throw
new
DateTimeException
(
"Unable to calculate
amount as objects are
of two different types"
);
}
Year
end
=
(
Year
)
endYear
;
if
(
unit
instanceof
ChronoUnit
)
{
...
...
src/share/classes/java/time/YearMonth.java
浏览文件 @
9694304e
...
...
@@ -110,7 +110,7 @@ import java.util.Objects;
* However, any application that makes use of historical dates, and requires them
* to be accurate will find the ISO-8601 approach unsuitable.
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This class is immutable and thread-safe.
*
* @since 1.8
...
...
@@ -944,10 +944,10 @@ public final class YearMonth
}
/**
* Calculates the period between this year-month and another year-month in
* terms of the specified unit.
* Calculates the amount of time until another year-month in terms of the specified unit.
* <p>
* This calculates the period between two year-months in terms of a single unit.
* This calculates the amount of time between two {@code YearMonth}
* objects in terms of a single {@code TemporalUnit}.
* The start and end points are {@code this} and the specified year-month.
* The result will be negative if the end is before the start.
* The {@code Temporal} passed to this method must be a {@code YearMonth}.
...
...
@@ -982,9 +982,9 @@ public final class YearMonth
* This instance is immutable and unaffected by this method call.
*
* @param endYearMonth the end year-month, which must be a {@code YearMonth}, not null
* @param unit the unit to measure the
period
in, not null
* @return the amount of t
he period
between this year-month and the end year-month
* @throws DateTimeException if the
period
cannot be calculated
* @param unit the unit to measure the
amount
in, not null
* @return the amount of t
ime
between this year-month and the end year-month
* @throws DateTimeException if the
amount
cannot be calculated
* @throws UnsupportedTemporalTypeException if the unit is not supported
* @throws ArithmeticException if numeric overflow occurs
*/
...
...
@@ -992,7 +992,7 @@ public final class YearMonth
public
long
periodUntil
(
Temporal
endYearMonth
,
TemporalUnit
unit
)
{
if
(
endYearMonth
instanceof
YearMonth
==
false
)
{
Objects
.
requireNonNull
(
endYearMonth
,
"endYearMonth"
);
throw
new
DateTimeException
(
"Unable to calculate
period between objects
of two different types"
);
throw
new
DateTimeException
(
"Unable to calculate
amount as objects are
of two different types"
);
}
YearMonth
end
=
(
YearMonth
)
endYearMonth
;
if
(
unit
instanceof
ChronoUnit
)
{
...
...
src/share/classes/java/time/ZoneId.java
浏览文件 @
9694304e
...
...
@@ -157,7 +157,7 @@ import java.util.TimeZone;
* This approach is designed to allow a {@link ZonedDateTime} to be loaded and
* queried, but not modified, on a Java Runtime with incomplete time-zone information.
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This abstract class has two implementations, both of which are immutable and thread-safe.
* One implementation models region-based IDs, the other is {@code ZoneOffset} modelling
* offset-based IDs. This difference is visible in serialization.
...
...
src/share/classes/java/time/ZoneOffset.java
浏览文件 @
9694304e
...
...
@@ -114,7 +114,7 @@ import java.util.concurrent.ConcurrentMap;
* Implementations may choose to cache certain common offsets, however
* applications must not rely on such caching.
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This class is immutable and thread-safe.
*
* @since 1.8
...
...
src/share/classes/java/time/ZoneRegion.java
浏览文件 @
9694304e
...
...
@@ -83,7 +83,7 @@ import java.util.regex.Pattern;
* By contrast, the region identifier is well-defined and long-lived.
* This separation also allows rules to be shared between regions if appropriate.
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This class is immutable and thread-safe.
*
* @since 1.8
...
...
src/share/classes/java/time/ZonedDateTime.java
浏览文件 @
9694304e
...
...
@@ -142,7 +142,7 @@ import java.util.Objects;
* a vital, but secondary, piece of information, used to ensure that the class
* represents an instant, especially during a daylight savings overlap.
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* A {@code ZonedDateTime} holds state equivalent to three separate objects,
* a {@code LocalDateTime}, a {@code ZoneId} and the resolved {@code ZoneOffset}.
* The offset and local date-time are used to define an instant when necessary.
...
...
@@ -1983,10 +1983,10 @@ public final class ZonedDateTime
}
/**
* Calculates the period between this date-time and another date-time in
* terms of the specified unit.
* Calculates the amount of time until another date-time in terms of the specified unit.
* <p>
* This calculates the period between two date-times in terms of a single unit.
* This calculates the amount of time between two {@code ZonedDateTime}
* objects in terms of a single {@code TemporalUnit}.
* The start and end points are {@code this} and the specified date-time.
* The result will be negative if the end is before the start.
* For example, the period in days between two date-times can be calculated
...
...
@@ -2040,9 +2040,9 @@ public final class ZonedDateTime
* This instance is immutable and unaffected by this method call.
*
* @param endDateTime the end date-time, which must be a {@code ZonedDateTime}, not null
* @param unit the unit to measure the
period
in, not null
* @return the amount of t
he period
between this date-time and the end date-time
* @throws DateTimeException if the
period
cannot be calculated
* @param unit the unit to measure the
amount
in, not null
* @return the amount of t
ime
between this date-time and the end date-time
* @throws DateTimeException if the
amount
cannot be calculated
* @throws UnsupportedTemporalTypeException if the unit is not supported
* @throws ArithmeticException if numeric overflow occurs
*/
...
...
@@ -2050,7 +2050,7 @@ public final class ZonedDateTime
public
long
periodUntil
(
Temporal
endDateTime
,
TemporalUnit
unit
)
{
if
(
endDateTime
instanceof
ZonedDateTime
==
false
)
{
Objects
.
requireNonNull
(
endDateTime
,
"endDateTime"
);
throw
new
DateTimeException
(
"Unable to calculate
period between objects
of two different types"
);
throw
new
DateTimeException
(
"Unable to calculate
amount as objects are
of two different types"
);
}
if
(
unit
instanceof
ChronoUnit
)
{
ZonedDateTime
end
=
(
ZonedDateTime
)
endDateTime
;
...
...
src/share/classes/java/time/chrono/ChronoDateImpl.java
浏览文件 @
9694304e
...
...
@@ -130,7 +130,7 @@ import java.util.Objects;
* The subclass must function according to the {@code Chronology} class description and must provide its
* {@link java.time.chrono.Chronology#getId() chronlogy ID} and {@link Chronology#getCalendarType() calendar type}. </p>
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This abstract class must be implemented with care to ensure other classes operate correctly.
* All implementations that can be instantiated must be final, immutable and thread-safe.
* Subclasses should be Serializable wherever possible.
...
...
@@ -325,11 +325,11 @@ abstract class ChronoDateImpl<D extends ChronoLocalDate<D>>
Objects
.
requireNonNull
(
endDateTime
,
"endDateTime"
);
Objects
.
requireNonNull
(
unit
,
"unit"
);
if
(
endDateTime
instanceof
ChronoLocalDate
==
false
)
{
throw
new
DateTimeException
(
"Unable to calculate
period between objects
of two different types"
);
throw
new
DateTimeException
(
"Unable to calculate
amount as objects are
of two different types"
);
}
ChronoLocalDate
<?>
end
=
(
ChronoLocalDate
<?>)
endDateTime
;
if
(
getChronology
().
equals
(
end
.
getChronology
())
==
false
)
{
throw
new
DateTimeException
(
"Unable to calculate
period between two
different chronologies"
);
throw
new
DateTimeException
(
"Unable to calculate
amount as objects have
different chronologies"
);
}
if
(
unit
instanceof
ChronoUnit
)
{
switch
((
ChronoUnit
)
unit
)
{
...
...
src/share/classes/java/time/chrono/ChronoLocalDate.java
浏览文件 @
9694304e
...
...
@@ -234,7 +234,7 @@ import java.util.Objects;
* Use {@link TemporalAccessor} if read-only access is required, or use {@link Temporal}
* if read-write access is required.
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This interface must be implemented with care to ensure other classes operate correctly.
* All implementations that can be instantiated must be final, immutable and thread-safe.
* Subclasses should be Serializable wherever possible.
...
...
@@ -257,6 +257,7 @@ public interface ChronoLocalDate<D extends ChronoLocalDate<D>>
* This allows dates in different calendar systems to be compared based
* on the position of the date on the local time-line.
* The underlying comparison is equivalent to comparing the epoch-day.
* @return a comparator that compares in time-line order ignoring the chronology
*
* @see #isAfter
* @see #isBefore
...
...
@@ -510,17 +511,17 @@ public interface ChronoLocalDate<D extends ChronoLocalDate<D>>
}
/**
* Calculates the period between this date and another date in
* terms of the specified unit.
* Calculates the amount of time until another date in terms of the specified unit.
* <p>
* This calculates the period between two dates in terms of a single unit.
* This calculates the amount of time between two {@code ChronoLocalDate}
* objects in terms of a single {@code TemporalUnit}.
* The start and end points are {@code this} and the specified date.
* The result will be negative if the end is before the start.
* The {@code Temporal} passed to this method must be a
* {@code ChronoLocalDate} in the same chronology.
* The calculation returns a whole number, representing the number of
* complete units between the two dates.
* For example, the
period
in days between two dates can be calculated
* For example, the
amount
in days between two dates can be calculated
* using {@code startDate.periodUntil(endDate, DAYS)}.
* <p>
* There are two equivalent ways of using this method.
...
...
@@ -548,9 +549,9 @@ public interface ChronoLocalDate<D extends ChronoLocalDate<D>>
*
* @param endDate the end date, which must be a {@code ChronoLocalDate}
* in the same chronology, not null
* @param unit the unit to measure the
period
in, not null
* @return the amount of t
he period
between this date and the end date
* @throws DateTimeException if the
period
cannot be calculated
* @param unit the unit to measure the
amount
in, not null
* @return the amount of t
ime
between this date and the end date
* @throws DateTimeException if the
amount
cannot be calculated
* @throws ArithmeticException if numeric overflow occurs
*/
@Override
// override for Javadoc
...
...
src/share/classes/java/time/chrono/ChronoLocalDateTime.java
浏览文件 @
9694304e
...
...
@@ -106,7 +106,7 @@ import java.util.Objects;
* Ensure that the discussion in {@code ChronoLocalDate} has been read and understood
* before using this interface.
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This interface must be implemented with care to ensure other classes operate correctly.
* All implementations that can be instantiated must be final, immutable and thread-safe.
* Subclasses should be Serializable wherever possible.
...
...
@@ -127,6 +127,8 @@ public interface ChronoLocalDateTime<D extends ChronoLocalDate<D>>
* on the position of the date-time on the local time-line.
* The underlying comparison is equivalent to comparing the epoch-day and nano-of-day.
*
* @return a comparator that compares in time-line order ignoring the chronology
*
* @see #isAfter
* @see #isBefore
* @see #isEqual
...
...
src/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java
浏览文件 @
9694304e
...
...
@@ -92,7 +92,7 @@ import java.util.Objects;
* It does not store or represent a time-zone. For example, the value
* "2nd October 2007 at 13:45.30.123456789" can be stored in an {@code ChronoLocalDateTime}.
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This class is immutable and thread-safe.
*
* @param <D> the concrete type for the date of this date-time
...
...
@@ -353,12 +353,12 @@ final class ChronoLocalDateTimeImpl<D extends ChronoLocalDate<D>>
@Override
public
long
periodUntil
(
Temporal
endDateTime
,
TemporalUnit
unit
)
{
if
(
endDateTime
instanceof
ChronoLocalDateTime
==
false
)
{
throw
new
DateTimeException
(
"Unable to calculate
period between objects
of two different types"
);
throw
new
DateTimeException
(
"Unable to calculate
amount as objects are
of two different types"
);
}
@SuppressWarnings
(
"unchecked"
)
ChronoLocalDateTime
<
D
>
end
=
(
ChronoLocalDateTime
<
D
>)
endDateTime
;
if
(
toLocalDate
().
getChronology
().
equals
(
end
.
toLocalDate
().
getChronology
())
==
false
)
{
throw
new
DateTimeException
(
"Unable to calculate
period between two
different chronologies"
);
throw
new
DateTimeException
(
"Unable to calculate
amount as objects have
different chronologies"
);
}
if
(
unit
instanceof
ChronoUnit
)
{
ChronoUnit
f
=
(
ChronoUnit
)
unit
;
...
...
src/share/classes/java/time/chrono/ChronoZonedDateTime.java
浏览文件 @
9694304e
...
...
@@ -107,7 +107,7 @@ import java.util.Objects;
* Ensure that the discussion in {@code ChronoLocalDate} has been read and understood
* before using this interface.
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This interface must be implemented with care to ensure other classes operate correctly.
* All implementations that can be instantiated must be final, immutable and thread-safe.
* Subclasses should be Serializable wherever possible.
...
...
@@ -128,6 +128,8 @@ public interface ChronoZonedDateTime<D extends ChronoLocalDate<D>>
* on the position of the date-time on the instant time-line.
* The underlying comparison is equivalent to comparing the epoch-second and nano-of-second.
*
* @return a comparator that compares in time-line order ignoring the chronology
*
* @see #isAfter
* @see #isBefore
* @see #isEqual
...
...
src/share/classes/java/time/chrono/ChronoZonedDateTimeImpl.java
浏览文件 @
9694304e
...
...
@@ -95,7 +95,7 @@ import java.util.Objects;
* the local time-line overlaps, typically as a result of the end of daylight time.
* Information about the local-time can be obtained using methods on the time-zone.
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This class is immutable and thread-safe.
*
* @param <D> the concrete type for the date of this date-time
...
...
@@ -287,12 +287,12 @@ final class ChronoZonedDateTimeImpl<D extends ChronoLocalDate<D>>
@Override
public
long
periodUntil
(
Temporal
endDateTime
,
TemporalUnit
unit
)
{
if
(
endDateTime
instanceof
ChronoZonedDateTime
==
false
)
{
throw
new
DateTimeException
(
"Unable to calculate
period between objects
of two different types"
);
throw
new
DateTimeException
(
"Unable to calculate
amount as objects are
of two different types"
);
}
@SuppressWarnings
(
"unchecked"
)
ChronoZonedDateTime
<
D
>
end
=
(
ChronoZonedDateTime
<
D
>)
endDateTime
;
if
(
toLocalDate
().
getChronology
().
equals
(
end
.
toLocalDate
().
getChronology
())
==
false
)
{
throw
new
DateTimeException
(
"Unable to calculate
period between two
different chronologies"
);
throw
new
DateTimeException
(
"Unable to calculate
amount as objects have
different chronologies"
);
}
if
(
unit
instanceof
ChronoUnit
)
{
end
=
end
.
withZoneSameInstant
(
offset
);
...
...
src/share/classes/java/time/chrono/Chronology.java
浏览文件 @
9694304e
...
...
@@ -176,7 +176,7 @@ import sun.util.logging.PlatformLogger;
* CLDR specification then the calendar type is the concatenation of the
* CLDR type and, if applicable, the CLDR variant,
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This class must be implemented with care to ensure other classes operate correctly.
* All implementations that can be instantiated must be final, immutable and thread-safe.
* Subclasses should be Serializable wherever possible.
...
...
@@ -338,16 +338,13 @@ public abstract class Chronology implements Comparable<Chronology> {
* <p>
* The {@code Locale} class also supports an extension mechanism that
* can be used to identify a calendar system. The mechanism is a form
* of key-value pairs, where the calendar system has the key "ca"
* and an optional variant key "cv".
* of key-value pairs, where the calendar system has the key "ca".
* For example, the locale "en-JP-u-ca-japanese" represents the English
* language as used in Japan with the Japanese calendar system.
* <p>
* This method finds the desired calendar system by in a manner equivalent
* to passing "ca" to {@link Locale#getUnicodeLocaleType(String)}.
* If the "ca" key is not present, then {@code IsoChronology} is returned.
* The variant, if present, is appended to the "ca" value separated by "-"
* and the concatenated value is used to find the calendar system by type.
* <p>
* Note that the behavior of this method differs from the older
* {@link java.util.Calendar#getInstance(Locale)} method.
...
...
@@ -374,10 +371,6 @@ public abstract class Chronology implements Comparable<Chronology> {
if
(
type
==
null
||
"iso"
.
equals
(
type
)
||
"iso8601"
.
equals
(
type
))
{
return
IsoChronology
.
INSTANCE
;
}
String
variant
=
locale
.
getUnicodeLocaleType
(
"cv"
);
if
(
variant
!=
null
&&
!
variant
.
isEmpty
())
{
type
=
type
+
'-'
+
variant
;
}
// Not pre-defined; lookup by the type
do
{
Chronology
chrono
=
CHRONOS_BY_TYPE
.
get
(
type
);
...
...
@@ -563,7 +556,7 @@ public abstract class Chronology implements Comparable<Chronology> {
* and the variant, if applicable, is appended separated by "-".
* The calendar type is used to lookup the {@code Chronology} using {@link #of(String)}.
*
* @return the calendar system type, null if the calendar is not defined
* @return the calendar system type, null if the calendar is not defined
by CLDR/LDML
* @see #getId()
*/
public
abstract
String
getCalendarType
();
...
...
src/share/classes/java/time/chrono/Era.java
浏览文件 @
9694304e
...
...
@@ -93,7 +93,7 @@ import java.util.Locale;
* <p>
* Instances of {@code Era} may be compared using the {@code ==} operator.
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This interface must be implemented with care to ensure other classes operate correctly.
* All implementations must be singletons - final, immutable and thread-safe.
* It is recommended to use an enum whenever possible.
...
...
src/share/classes/java/time/chrono/HijrahChronology.java
浏览文件 @
9694304e
...
...
@@ -133,9 +133,10 @@ import sun.util.logging.PlatformLogger;
* Chronology chrono = Chronology.ofLocale(locale);
* </pre>
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This class is immutable and thread-safe.
* <h3>Implementation Note for Hijrah Calendar Variant Configuration</h3>
*
* @implNote
* Each Hijrah variant is configured individually. Each variant is defined by a
* property resource that defines the {@code ID}, the {@code calendar type},
* the start of the calendar, the alignment with the
...
...
@@ -229,6 +230,11 @@ public final class HijrahChronology extends Chronology implements Serializable {
* {@link Chronology#getAvailableChronologies}.
*/
public
static
final
HijrahChronology
INSTANCE
;
/**
* Flag to indicate the initialization of configuration data is complete.
* @see #checkCalendarInit()
*/
private
volatile
boolean
initComplete
;
/**
* Array of epoch days indexed by Hijrah Epoch month.
* Computed by {@link #loadCalendarData}.
...
...
@@ -285,7 +291,8 @@ public final class HijrahChronology extends Chronology implements Serializable {
private
static
final
String
PROP_TYPE_SUFFIX
=
".type"
;
/**
* Name data.
* Static initialization of the predefined calendars found in the
* lib/calendars.properties file.
*/
static
{
try
{
...
...
@@ -299,8 +306,7 @@ public final class HijrahChronology extends Chronology implements Serializable {
// Register it by its aliases
Chronology
.
registerChrono
(
INSTANCE
,
"Hijrah"
);
Chronology
.
registerChrono
(
INSTANCE
,
"islamic"
);
}
catch
(
Exception
ex
)
{
}
catch
(
DateTimeException
ex
)
{
// Absence of Hijrah calendar is fatal to initializing this class.
PlatformLogger
logger
=
PlatformLogger
.
getLogger
(
"java.time.chrono"
);
logger
.
severe
(
"Unable to initialize Hijrah calendar: Hijrah-umalqura"
,
ex
);
...
...
@@ -327,7 +333,7 @@ public final class HijrahChronology extends Chronology implements Serializable {
// Create and register the variant
HijrahChronology
chrono
=
new
HijrahChronology
(
id
);
Chronology
.
registerChrono
(
chrono
);
}
catch
(
Exception
ex
)
{
}
catch
(
DateTime
Exception
ex
)
{
// Log error and continue
PlatformLogger
logger
=
PlatformLogger
.
getLogger
(
"java.time.chrono"
);
logger
.
severe
(
"Unable to initialize Hijrah calendar: "
+
id
,
ex
);
...
...
@@ -343,22 +349,39 @@ public final class HijrahChronology extends Chronology implements Serializable {
* The property names are {@code "calendar.hijrah." + id}
* and {@code "calendar.hijrah." + id + ".type"}
* @param id the id of the calendar
* @throws
Exception if the resource can not be accessed or
*
the format is invalid
* @throws
DateTimeException if the calendar type is missing from the properties file.
*
@throws IllegalArgumentException if the id is empty
*/
private
HijrahChronology
(
String
id
)
throws
Exception
{
private
HijrahChronology
(
String
id
)
throws
DateTime
Exception
{
if
(
id
.
isEmpty
())
{
throw
new
IllegalArgumentException
(
"calendar id is empty"
);
}
String
propName
=
PROP_PREFIX
+
id
+
PROP_TYPE_SUFFIX
;
String
calType
=
calendarProperties
.
getProperty
(
propName
);
if
(
calType
==
null
||
calType
.
isEmpty
())
{
throw
new
DateTimeException
(
"calendarType is missing or empty for: "
+
propName
);
}
this
.
typeId
=
id
;
this
.
calendarType
=
calendarProperties
.
getProperty
(
PROP_PREFIX
+
id
+
PROP_TYPE_SUFFIX
);
this
.
calendarType
=
calType
;
}
try
{
String
resource
=
calendarProperties
.
getProperty
(
PROP_PREFIX
+
id
);
Objects
.
requireNonNull
(
resource
,
"Resource missing for calendar"
);
loadCalendarData
(
resource
);
}
catch
(
Exception
ex
)
{
throw
new
Exception
(
"Unable to initialize HijrahCalendar: "
+
id
,
ex
);
/**
* Check and ensure that the calendar data has been initialized.
* The initialization check is performed at the boundary between
* public and package methods. If a public calls another public method
* a check is not necessary in the caller.
* The constructors of HijrahDate call {@link #getEpochDay} or
* {@link #getHijrahDateInfo} so every call from HijrahDate to a
* HijrahChronology via package private methods has been checked.
*
* @throws DateTimeException if the calendar data configuration is
* malformed or IOExceptions occur loading the data
*/
private
void
checkCalendarInit
()
{
// Keep this short so it can be inlined for performance
if
(
initComplete
==
false
)
{
loadCalendarData
();
initComplete
=
true
;
}
}
...
...
@@ -509,6 +532,7 @@ public final class HijrahChronology extends Chronology implements Serializable {
//-----------------------------------------------------------------------
@Override
public
boolean
isLeapYear
(
long
prolepticYear
)
{
checkCalendarInit
();
int
epochMonth
=
yearToEpochMonth
((
int
)
prolepticYear
);
if
(
epochMonth
<
0
||
epochMonth
>
maxEpochDay
)
{
throw
new
DateTimeException
(
"Hijrah date out of range"
);
...
...
@@ -543,6 +567,7 @@ public final class HijrahChronology extends Chronology implements Serializable {
//-----------------------------------------------------------------------
@Override
public
ValueRange
range
(
ChronoField
field
)
{
checkCalendarInit
();
if
(
field
instanceof
ChronoField
)
{
ChronoField
f
=
field
;
switch
(
f
)
{
...
...
@@ -595,6 +620,7 @@ public final class HijrahChronology extends Chronology implements Serializable {
* @return int[0] = YEAR, int[1] = MONTH, int[2] = DATE
*/
int
[]
getHijrahDateInfo
(
int
epochDay
)
{
checkCalendarInit
();
// ensure that the chronology is initialized
if
(
epochDay
<
minEpochDay
||
epochDay
>=
maxEpochDay
)
{
throw
new
DateTimeException
(
"Hijrah date out of range"
);
}
...
...
@@ -621,6 +647,7 @@ public final class HijrahChronology extends Chronology implements Serializable {
* @return the epoch day
*/
long
getEpochDay
(
int
prolepticYear
,
int
monthOfYear
,
int
dayOfMonth
)
{
checkCalendarInit
();
// ensure that the chronology is initialized
checkValidMonth
(
monthOfYear
);
int
epochMonth
=
yearToEpochMonth
(
prolepticYear
)
+
(
monthOfYear
-
1
);
if
(
epochMonth
<
0
||
epochMonth
>=
hijrahEpochMonthStartDays
.
length
)
{
...
...
@@ -846,84 +873,90 @@ public final class HijrahChronology extends Chronology implements Serializable {
}
/**
* Loads and processes the Hijrah calendar properties file.
* Loads and processes the Hijrah calendar properties file
for this calendarType
.
* The starting Hijrah date and the corresponding ISO date are
* extracted and used to calculate the epochDate offset.
* The version number is identified and ignored.
* Everything else is the data for a year with containing the length of each
* of 12 months.
*
* @param resourceName containing the properties defining the calendar, not null
* @throws IllegalArgumentException if any of the values are malformed
* @throws NumberFormatException if numbers, including properties that should
* be years are invalid
* @throws IOException if access to the property resource fails.
* @throws DateTimeException if initialization of the calendar data from the
* resource fails
*/
private
void
loadCalendarData
(
String
resourceName
)
throws
Exception
{
Properties
props
=
readConfigProperties
(
resourceName
);
Map
<
Integer
,
int
[]>
years
=
new
HashMap
<>();
int
minYear
=
Integer
.
MAX_VALUE
;
int
maxYear
=
Integer
.
MIN_VALUE
;
String
id
=
null
;
String
type
=
null
;
String
version
=
null
;
int
isoStart
=
0
;
for
(
Map
.
Entry
<
Object
,
Object
>
entry
:
props
.
entrySet
())
{
String
key
=
(
String
)
entry
.
getKey
();
switch
(
key
)
{
case
KEY_ID:
id
=
(
String
)
entry
.
getValue
();
break
;
case
KEY_TYPE:
type
=
(
String
)
entry
.
getValue
();
break
;
case
KEY_VERSION:
version
=
(
String
)
entry
.
getValue
();
break
;
case
KEY_ISO_START:
{
int
[]
ymd
=
parseYMD
((
String
)
entry
.
getValue
());
isoStart
=
(
int
)
LocalDate
.
of
(
ymd
[
0
],
ymd
[
1
],
ymd
[
2
]).
toEpochDay
();
break
;
}
default
:
try
{
// Everything else is either a year or invalid
int
year
=
Integer
.
valueOf
(
key
);
int
[]
months
=
parseMonths
((
String
)
entry
.
getValue
());
years
.
put
(
year
,
months
);
maxYear
=
Math
.
max
(
maxYear
,
year
);
minYear
=
Math
.
min
(
minYear
,
year
);
}
catch
(
NumberFormatException
nfe
)
{
throw
new
IllegalArgumentException
(
"bad key: "
+
key
);
private
void
loadCalendarData
()
{
try
{
String
resourceName
=
calendarProperties
.
getProperty
(
PROP_PREFIX
+
typeId
);
Objects
.
requireNonNull
(
resourceName
,
"Resource missing for calendar: "
+
PROP_PREFIX
+
typeId
);
Properties
props
=
readConfigProperties
(
resourceName
);
Map
<
Integer
,
int
[]>
years
=
new
HashMap
<>();
int
minYear
=
Integer
.
MAX_VALUE
;
int
maxYear
=
Integer
.
MIN_VALUE
;
String
id
=
null
;
String
type
=
null
;
String
version
=
null
;
int
isoStart
=
0
;
for
(
Map
.
Entry
<
Object
,
Object
>
entry
:
props
.
entrySet
())
{
String
key
=
(
String
)
entry
.
getKey
();
switch
(
key
)
{
case
KEY_ID:
id
=
(
String
)
entry
.
getValue
();
break
;
case
KEY_TYPE:
type
=
(
String
)
entry
.
getValue
();
break
;
case
KEY_VERSION:
version
=
(
String
)
entry
.
getValue
();
break
;
case
KEY_ISO_START:
{
int
[]
ymd
=
parseYMD
((
String
)
entry
.
getValue
());
isoStart
=
(
int
)
LocalDate
.
of
(
ymd
[
0
],
ymd
[
1
],
ymd
[
2
]).
toEpochDay
();
break
;
}
default
:
try
{
// Everything else is either a year or invalid
int
year
=
Integer
.
valueOf
(
key
);
int
[]
months
=
parseMonths
((
String
)
entry
.
getValue
());
years
.
put
(
year
,
months
);
maxYear
=
Math
.
max
(
maxYear
,
year
);
minYear
=
Math
.
min
(
minYear
,
year
);
}
catch
(
NumberFormatException
nfe
)
{
throw
new
IllegalArgumentException
(
"bad key: "
+
key
);
}
}
}
}
if
(!
getId
().
equals
(
id
))
{
throw
new
IllegalArgumentException
(
"Configuration is for a different calendar: "
+
id
);
}
if
(!
getCalendarType
().
equals
(
type
))
{
throw
new
IllegalArgumentException
(
"Configuration is for a different calendar type: "
+
type
);
}
if
(
version
==
null
||
version
.
isEmpty
())
{
throw
new
IllegalArgumentException
(
"Configuration does not contain a version"
);
}
if
(
isoStart
==
0
)
{
throw
new
IllegalArgumentException
(
"Configuration does not contain a ISO start date"
);
}
if
(!
getId
().
equals
(
id
))
{
throw
new
IllegalArgumentException
(
"Configuration is for a different calendar: "
+
id
);
}
if
(!
getCalendarType
().
equals
(
type
))
{
throw
new
IllegalArgumentException
(
"Configuration is for a different calendar type: "
+
type
);
}
if
(
version
==
null
||
version
.
isEmpty
())
{
throw
new
IllegalArgumentException
(
"Configuration does not contain a version"
);
}
if
(
isoStart
==
0
)
{
throw
new
IllegalArgumentException
(
"Configuration does not contain a ISO start date"
);
}
// Now create and validate the array of epochDays indexed by epochMonth
hijrahStartEpochMonth
=
minYear
*
12
;
minEpochDay
=
isoStart
;
hijrahEpochMonthStartDays
=
createEpochMonths
(
minEpochDay
,
minYear
,
maxYear
,
years
);
maxEpochDay
=
hijrahEpochMonthStartDays
[
hijrahEpochMonthStartDays
.
length
-
1
];
// Compute the min and max year length in days.
for
(
int
year
=
minYear
;
year
<
maxYear
;
year
++)
{
int
length
=
getYearLength
(
year
);
minYearLength
=
Math
.
min
(
minYearLength
,
length
);
maxYearLength
=
Math
.
max
(
maxYearLength
,
length
);
// Now create and validate the array of epochDays indexed by epochMonth
hijrahStartEpochMonth
=
minYear
*
12
;
minEpochDay
=
isoStart
;
hijrahEpochMonthStartDays
=
createEpochMonths
(
minEpochDay
,
minYear
,
maxYear
,
years
);
maxEpochDay
=
hijrahEpochMonthStartDays
[
hijrahEpochMonthStartDays
.
length
-
1
];
// Compute the min and max year length in days.
for
(
int
year
=
minYear
;
year
<
maxYear
;
year
++)
{
int
length
=
getYearLength
(
year
);
minYearLength
=
Math
.
min
(
minYearLength
,
length
);
maxYearLength
=
Math
.
max
(
maxYearLength
,
length
);
}
}
catch
(
Exception
ex
)
{
// Log error and throw a DateTimeException
PlatformLogger
logger
=
PlatformLogger
.
getLogger
(
"java.time.chrono"
);
logger
.
severe
(
"Unable to initialize Hijrah calendar proxy: "
+
typeId
,
ex
);
throw
new
DateTimeException
(
"Unable to initialize HijrahCalendar: "
+
typeId
,
ex
);
}
}
...
...
src/share/classes/java/time/chrono/HijrahDate.java
浏览文件 @
9694304e
...
...
@@ -102,7 +102,7 @@ import java.time.temporal.ValueRange;
* to create new HijrahDate instances.
* Alternatively, the {@link #withVariant} method can be used to convert
* to a new HijrahChronology.
*
<h3>Specification for implementors</h3>
*
@implSpec
* This class is immutable and thread-safe.
*
* @since 1.8
...
...
src/share/classes/java/time/chrono/HijrahEra.java
浏览文件 @
9694304e
...
...
@@ -81,7 +81,7 @@ import java.time.temporal.ValueRange;
* <b>Do not use {@code ordinal()} to obtain the numeric representation of {@code HijrahEra}.
* Use {@code getValue()} instead.</b>
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This is an immutable and thread-safe enum.
*
* @since 1.8
...
...
src/share/classes/java/time/chrono/IsoChronology.java
浏览文件 @
9694304e
...
...
@@ -121,7 +121,7 @@ import java.util.Objects;
* <li>leap-year - Leap years occur every 4 years, except where the year is divisble by 100 and not divisble by 400.
* </ul><p>
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This class is immutable and thread-safe.
*
* @since 1.8
...
...
@@ -588,7 +588,12 @@ public final class IsoChronology extends Chronology implements Serializable {
int
moy
=
MONTH_OF_YEAR
.
checkValidIntValue
(
fieldValues
.
remove
(
MONTH_OF_YEAR
));
int
dom
=
DAY_OF_MONTH
.
checkValidIntValue
(
fieldValues
.
remove
(
DAY_OF_MONTH
));
if
(
resolverStyle
==
ResolverStyle
.
SMART
)
{
// previous valid
dom
=
Math
.
min
(
dom
,
Month
.
of
(
moy
).
length
(
Year
.
isLeap
(
y
)));
if
(
moy
==
4
||
moy
==
6
||
moy
==
9
||
moy
==
11
)
{
dom
=
Math
.
min
(
dom
,
30
);
}
else
if
(
moy
==
2
)
{
dom
=
Math
.
min
(
dom
,
Month
.
FEBRUARY
.
length
(
Year
.
isLeap
(
y
)));
}
}
return
LocalDate
.
of
(
y
,
moy
,
dom
);
}
...
...
src/share/classes/java/time/chrono/IsoEra.java
浏览文件 @
9694304e
...
...
@@ -97,7 +97,7 @@ import java.time.DateTimeException;
* <b>Do not use {@code ordinal()} to obtain the numeric representation of {@code IsoEra}.
* Use {@code getValue()} instead.</b>
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This is an immutable and thread-safe enum.
*
* @since 1.8
...
...
src/share/classes/java/time/chrono/JapaneseChronology.java
浏览文件 @
9694304e
...
...
@@ -85,7 +85,7 @@ import sun.util.calendar.LocalGregorianCalendar;
* Only Meiji (1865-04-07 - 1868-09-07) and later eras are supported.
* Older eras are handled as an unknown era where the year-of-era is the ISO year.
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This class is immutable and thread-safe.
*
* @since 1.8
...
...
@@ -197,7 +197,7 @@ public final class JapaneseChronology extends Chronology implements Serializable
*/
@Override
public
JapaneseDate
dateYearDay
(
Era
era
,
int
yearOfEra
,
int
dayOfYear
)
{
return
dateYearDay
(
prolepticYear
(
era
,
yearOfEra
)
,
dayOfYear
);
return
JapaneseDate
.
ofYearDay
((
JapaneseEra
)
era
,
yearOfEra
,
dayOfYear
);
}
/**
...
...
@@ -251,16 +251,19 @@ public final class JapaneseChronology extends Chronology implements Serializable
}
@Override
@SuppressWarnings
(
"unchecked"
)
public
ChronoLocalDateTime
<
JapaneseDate
>
localDateTime
(
TemporalAccessor
temporal
)
{
return
(
ChronoLocalDateTime
<
JapaneseDate
>)
super
.
localDateTime
(
temporal
);
}
@Override
@SuppressWarnings
(
"unchecked"
)
public
ChronoZonedDateTime
<
JapaneseDate
>
zonedDateTime
(
TemporalAccessor
temporal
)
{
return
(
ChronoZonedDateTime
<
JapaneseDate
>)
super
.
zonedDateTime
(
temporal
);
}
@Override
@SuppressWarnings
(
"unchecked"
)
public
ChronoZonedDateTime
<
JapaneseDate
>
zonedDateTime
(
Instant
instant
,
ZoneId
zone
)
{
return
(
ChronoZonedDateTime
<
JapaneseDate
>)
super
.
zonedDateTime
(
instant
,
zone
);
}
...
...
@@ -286,19 +289,27 @@ public final class JapaneseChronology extends Chronology implements Serializable
if
(
era
instanceof
JapaneseEra
==
false
)
{
throw
new
ClassCastException
(
"Era must be JapaneseEra"
);
}
if
(
era
==
JapaneseEra
.
SEIREKI
)
{
JapaneseEra
nextEra
=
JapaneseEra
.
values
()[
1
];
int
nextEraYear
=
nextEra
.
getPrivateEra
().
getSinceDate
().
getYear
();
if
(
yearOfEra
>=
nextEraYear
||
yearOfEra
<
Year
.
MIN_VALUE
)
{
throw
new
DateTimeException
(
"Invalid yearOfEra value"
);
}
return
yearOfEra
;
}
JapaneseEra
jera
=
(
JapaneseEra
)
era
;
int
gregorianYear
=
jera
.
getPrivateEra
().
getSinceDate
().
getYear
()
+
yearOfEra
-
1
;
if
(
yearOfEra
==
1
)
{
return
gregorianYear
;
}
LocalGregorianCalendar
.
Date
jdate
=
JCAL
.
newCalendarDate
(
null
);
jdate
.
setEra
(
jera
.
getPrivateEra
()).
setDate
(
yearOfEra
,
1
,
1
);
if
(!
JapaneseChronology
.
JCAL
.
validate
(
jdate
))
{
throw
new
DateTimeException
(
"Invalid yearOfEra value"
);
}
JCAL
.
normalize
(
jdate
);
if
(
jdate
.
getNormalizedYear
()
==
gregorianYear
)
{
return
gregorianYear
;
if
(
gregorianYear
>=
Year
.
MIN_VALUE
&&
gregorianYear
<=
Year
.
MAX_VALUE
)
{
LocalGregorianCalendar
.
Date
jdate
=
JCAL
.
newCalendarDate
(
null
);
jdate
.
setEra
(
jera
.
getPrivateEra
()).
setDate
(
yearOfEra
,
1
,
1
);
if
(
JapaneseChronology
.
JCAL
.
validate
(
jdate
))
{
return
gregorianYear
;
}
}
throw
new
DateTimeException
(
"Invalid yearOfEra value"
);
}
...
...
@@ -322,13 +333,20 @@ public final class JapaneseChronology extends Chronology implements Serializable
@Override
public
List
<
Era
>
eras
()
{
return
Arrays
.
asList
(
JapaneseEra
.
values
());
return
Arrays
.<
Era
>
asList
(
JapaneseEra
.
values
());
}
JapaneseEra
getCurrentEra
()
{
// Assume that the last JapaneseEra is the current one.
JapaneseEra
[]
eras
=
JapaneseEra
.
values
();
return
eras
[
eras
.
length
-
1
];
}
//-----------------------------------------------------------------------
@Override
public
ValueRange
range
(
ChronoField
field
)
{
switch
(
field
)
{
case
YEAR:
case
DAY_OF_MONTH:
case
DAY_OF_WEEK:
case
MICRO_OF_DAY:
...
...
@@ -345,27 +363,23 @@ public final class JapaneseChronology extends Chronology implements Serializable
case
NANO_OF_SECOND:
case
CLOCK_HOUR_OF_DAY:
case
CLOCK_HOUR_OF_AMPM:
case
EPOCH_DAY:
// TODO: if year is restricted, then so is epoch-day
case
EPOCH_DAY:
case
PROLEPTIC_MONTH:
case
MONTH_OF_YEAR:
return
field
.
range
();
case
ERA:
return
ValueRange
.
of
(
JapaneseEra
.
SEIREKI
.
getValue
(),
getCurrentEra
().
getValue
());
}
Calendar
jcal
=
Calendar
.
getInstance
(
LOCALE
);
int
fieldIndex
;
switch
(
field
)
{
case
ERA:
return
ValueRange
.
of
(
JapaneseEra
.
SEIREKI
.
getValue
(),
jcal
.
getMaximum
(
Calendar
.
ERA
)
-
JapaneseEra
.
ERA_OFFSET
);
case
YEAR:
case
YEAR_OF_ERA:
// TODO: this is not right
case
YEAR_OF_ERA:
{
int
startYear
=
getCurrentEra
().
getPrivateEra
().
getSinceDate
().
getYear
();
return
ValueRange
.
of
(
Year
.
MIN_VALUE
,
jcal
.
getGreatestMinimum
(
Calendar
.
YEAR
),
jcal
.
getLeastMaximum
(
Calendar
.
YEAR
),
Year
.
MAX_VALUE
);
case
PROLEPTIC_MONTH:
// TODO: should be the range of months bound by the valid range of years
return
ValueRange
.
of
((
jcal
.
getGreatestMinimum
(
Calendar
.
YEAR
)
-
1
)
*
12
,
(
jcal
.
getLeastMaximum
(
Calendar
.
YEAR
))
*
12
);
case
MONTH_OF_YEAR:
return
ValueRange
.
of
(
jcal
.
getMinimum
(
Calendar
.
MONTH
)
+
1
,
jcal
.
getGreatestMinimum
(
Calendar
.
MONTH
)
+
1
,
jcal
.
getLeastMaximum
(
Calendar
.
MONTH
)
+
1
,
jcal
.
getMaximum
(
Calendar
.
MONTH
)
+
1
);
jcal
.
getLeastMaximum
(
Calendar
.
YEAR
)
+
1
,
// +1 due to the different definitions
Year
.
MAX_VALUE
-
startYear
);
}
case
DAY_OF_YEAR:
fieldIndex
=
Calendar
.
DAY_OF_YEAR
;
break
;
...
...
src/share/classes/java/time/chrono/JapaneseDate.java
浏览文件 @
9694304e
...
...
@@ -83,6 +83,7 @@ import java.time.temporal.ValueRange;
import
java.util.Calendar
;
import
java.util.Objects
;
import
sun.util.calendar.CalendarDate
;
import
sun.util.calendar.LocalGregorianCalendar
;
/**
...
...
@@ -101,7 +102,7 @@ import sun.util.calendar.LocalGregorianCalendar;
* Calling {@code japaneseDate.get(ERA)} will return 2, corresponding to
* {@code JapaneseChronology.ERA_HEISEI}.<br>
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This class is immutable and thread-safe.
*
* @since 1.8
...
...
@@ -234,6 +235,24 @@ public final class JapaneseDate
return
of
(
prolepticYear
,
date
.
getMonthValue
(),
date
.
getDayOfMonth
());
}
static
JapaneseDate
ofYearDay
(
JapaneseEra
era
,
int
yearOfEra
,
int
dayOfYear
)
{
CalendarDate
firstDay
=
era
.
getPrivateEra
().
getSinceDate
();
LocalGregorianCalendar
.
Date
jdate
=
JapaneseChronology
.
JCAL
.
newCalendarDate
(
null
);
jdate
.
setEra
(
era
.
getPrivateEra
());
if
(
yearOfEra
==
1
)
{
jdate
.
setDate
(
yearOfEra
,
firstDay
.
getMonth
(),
firstDay
.
getDayOfMonth
()
+
dayOfYear
-
1
);
}
else
{
jdate
.
setDate
(
yearOfEra
,
1
,
dayOfYear
);
}
JapaneseChronology
.
JCAL
.
normalize
(
jdate
);
if
(
era
.
getPrivateEra
()
!=
jdate
.
getEra
()
||
yearOfEra
!=
jdate
.
getYear
())
{
throw
new
DateTimeException
(
"Invalid parameters"
);
}
LocalDate
localdate
=
LocalDate
.
of
(
jdate
.
getNormalizedYear
(),
jdate
.
getMonth
(),
jdate
.
getDayOfMonth
());
return
new
JapaneseDate
(
era
,
yearOfEra
,
localdate
);
}
/**
* Obtains a {@code JapaneseDate} representing a date in the Japanese calendar
* system from the era, year-of-era, month-of-year and day-of-month fields.
...
...
src/share/classes/java/time/chrono/JapaneseEra.java
浏览文件 @
9694304e
...
...
@@ -91,7 +91,7 @@ import sun.util.calendar.CalendarDate;
* and the year of era of Seireki is proleptic Gregorian year.
* (The Julian to Gregorian transition is not supported.)
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This class is immutable and thread-safe.
*
* @since 1.8
...
...
src/share/classes/java/time/chrono/MinguoChronology.java
浏览文件 @
9694304e
...
...
@@ -95,7 +95,7 @@ import java.util.Locale;
* are never out of step.
* </ul><p>
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This class is immutable and thread-safe.
*
* @since 1.8
...
...
src/share/classes/java/time/chrono/MinguoDate.java
浏览文件 @
9694304e
...
...
@@ -89,7 +89,7 @@ import java.util.Objects;
* This calendar system is primarily used in the Republic of China, often known as Taiwan.
* Dates are aligned such that {@code 0001-01-01 (Minguo)} is {@code 1912-01-01 (ISO)}.
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This class is immutable and thread-safe.
*
* @since 1.8
...
...
src/share/classes/java/time/chrono/MinguoEra.java
浏览文件 @
9694304e
...
...
@@ -102,7 +102,7 @@ import java.time.DateTimeException;
* <b>Do not use {@code ordinal()} to obtain the numeric representation of {@code MinguoEra}.
* Use {@code getValue()} instead.</b>
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This is an immutable and thread-safe enum.
*
* @since 1.8
...
...
src/share/classes/java/time/chrono/Ser.java
浏览文件 @
9694304e
...
...
@@ -68,7 +68,7 @@ import java.time.LocalDateTime;
/**
* The shared serialization delegate for this package.
*
*
<h3>Implementation notes</h3>
*
@implNote
* This class wraps the object being serialized, and takes a byte representing the type of the class to
* be serialized. This byte can also be used for versioning the serialization format. In this case another
* byte flag would be used in order to specify an alternative version of the type format.
...
...
src/share/classes/java/time/chrono/ThaiBuddhistChronology.java
浏览文件 @
9694304e
...
...
@@ -96,7 +96,7 @@ import java.util.Locale;
* are never out of step.
* </ul><p>
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This class is immutable and thread-safe.
*
* @since 1.8
...
...
src/share/classes/java/time/chrono/ThaiBuddhistDate.java
浏览文件 @
9694304e
...
...
@@ -89,7 +89,7 @@ import java.util.Objects;
* This calendar system is primarily used in Thailand.
* Dates are aligned such that {@code 2484-01-01 (Buddhist)} is {@code 1941-01-01 (ISO)}.
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This class is immutable and thread-safe.
*
* @since 1.8
...
...
src/share/classes/java/time/chrono/ThaiBuddhistEra.java
浏览文件 @
9694304e
...
...
@@ -102,7 +102,7 @@ import java.time.DateTimeException;
* <b>Do not use {@code ordinal()} to obtain the numeric representation of {@code ThaiBuddhistEra}.
* Use {@code getValue()} instead.</b>
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This is an immutable and thread-safe enum.
*
* @since 1.8
...
...
src/share/classes/java/time/format/DateTimeFormatter.java
浏览文件 @
9694304e
...
...
@@ -77,6 +77,7 @@ import java.text.Format;
import
java.text.ParseException
;
import
java.text.ParsePosition
;
import
java.time.DateTimeException
;
import
java.time.Period
;
import
java.time.ZoneId
;
import
java.time.ZoneOffset
;
import
java.time.chrono.Chronology
;
...
...
@@ -121,7 +122,7 @@ import java.util.Set;
* </pre></blockquote>
* <p>
* In addition to the format, formatters can be created with desired Locale,
* Chronology, ZoneId, and
formatting symbols
.
* Chronology, ZoneId, and
DecimalStyle
.
* <p>
* The {@link #withLocale withLocale} method returns a new formatter that
* overrides the locale. The locale affects some aspects of formatting and
...
...
@@ -138,8 +139,8 @@ import java.util.Set;
* with the requested ZoneId before formatting. During parsing the ZoneId is
* applied before the value is returned.
* <p>
* The {@link #with
Symbols withSymbols
} method returns a new formatter that
* overrides the {@link D
ateTimeFormatSymbols}. Th
e symbols are used for
* The {@link #with
DecimalStyle withDecimalStyle
} method returns a new formatter that
* overrides the {@link D
ecimalStyle}. The DecimalStyl
e symbols are used for
* formatting and parsing.
* <p>
* Some applications may need to use the older {@link Format java.text.Format}
...
...
@@ -417,7 +418,65 @@ import java.util.Set;
* that you want to output directly to ensure that future changes do not break
* your application.
*
* <h3>Specification for implementors</h3>
* <h3 id="resolving">Resolving</h3>
* Parsing is implemented as a two-phase operation.
* First, the text is parsed using the layout defined by the formatter, producing
* a {@code Map} of field to value, a {@code ZoneId} and a {@code Chronology}.
* Second, the parsed data is <em>resolved</em>, by validating, combining and
* simplifying the various fields into more useful ones.
* <p>
* Five parsing methods are supplied by this class.
* Four of these perform both the parse and resolve phases.
* The fifth method, {@link #parseUnresolved(CharSequence, ParsePosition)},
* only performs the first phase, leaving the result unresolved.
* As such, it is essentially a low-level operation.
* <p>
* The resolve phase is controlled by two parameters, set on this class.
* <p>
* The {@link ResolverStyle} is an enum that offers three different approaches,
* strict, smart and lenient. The smart option is the default.
* It can be set using {@link #withResolverStyle(ResolverStyle)}.
* <p>
* The {@link #withResolverFields(TemporalField...)} parameter allows the
* set of fields that will be resolved to be filtered before resolving starts.
* For example, if the formatter has parsed a year, month, day-of-month
* and day-of-year, then there are two approaches to resolve a date:
* (year + month + day-of-month) and (year + day-of-year).
* The resolver fields allows one of the two approaches to be selected.
* If no resolver fields are set then both approaches must result in the same date.
* <p>
* Resolving separate fields to form a complete date and time is a complex
* process with behaviour distributed across a number of classes.
* It follows these steps:
* <ol>
* <li>The chronology is determined.
* The chronology of the result is either the chronology that was parsed,
* or if no chronology was parsed, it is the chronology set on this class,
* or if that is null, it is {@code IsoChronology}.
* <li>The {@code ChronoField} date fields are resolved.
* This is achieved using {@link Chronology#resolveDate(Map, ResolverStyle)}.
* Documentation about field resolution is located in the implementation
* of {@code Chronology}.
* <li>The {@code ChronoField} time fields are resolved.
* This is documented on {@link ChronoField} and is the same for all chronologies.
* <li>Any fields that are not {@code ChronoField} are processed.
* This is achieved using {@link TemporalField#resolve(TemporalAccessor, long, ResolverStyle)}.
* Documentation about field resolution is located in the implementation
* of {@code TemporalField}.
* <li>The {@code ChronoField} date and time fields are re-resolved.
* This allows fields in step four to produce {@code ChronoField} values
* and have them be processed into dates and times.
* <li>A {@code LocalTime} is formed if there is at least an hour-of-day available.
* This involves providing default values for minute, second and fraction of second.
* <li>Any remaining unresolved fields are cross-checked against any
* date and/or time that was resolved. Thus, an earlier stage would resolve
* (year + month + day-of-month) to a date, and this stage would check that
* day-of-week was valid for the date.
* <li>If an {@linkplain #parsedExcessDays() excess number of days}
* was parsed then it is added to the date if a date is available.
* </ol>
*
* @implSpec
* This class is immutable and thread-safe.
*
* @since 1.8
...
...
@@ -435,7 +494,7 @@ public final class DateTimeFormatter {
/**
* The symbols to use for formatting, not null.
*/
private
final
D
ateTimeFormatSymbols
symbols
;
private
final
D
ecimalStyle
decimalStyle
;
/**
* The resolver style to use, not null.
*/
...
...
@@ -1040,6 +1099,11 @@ public final class DateTimeFormatter {
* <p>
* This returns an immutable formatter capable of formatting and parsing
* the ISO-8601 instant format.
* When formatting, the second-of-minute is always output.
* The nano-of-second outputs zero, three, six or nine digits digits as necessary.
* When parsing, time to at least the seconds field is required.
* Fractional seconds from zero to nine are parsed.
* The localized decimal style is not used.
* <p>
* This is a special case formatter intended to allow a human readable form
* of an {@link java.time.Instant}. The {@code Instant} class is designed to
...
...
@@ -1201,25 +1265,117 @@ public final class DateTimeFormatter {
.
toFormatter
(
ResolverStyle
.
SMART
,
IsoChronology
.
INSTANCE
);
}
//-----------------------------------------------------------------------
/**
* A query that provides access to the excess days that were parsed.
* <p>
* This returns a singleton {@linkplain TemporalQuery query} that provides
* access to additional information from the parse. The query always returns
* a non-null period, with a zero period returned instead of null.
* <p>
* There are two situations where this query may return a non-zero period.
* <p><ul>
* <li>If the {@code ResolverStyle} is {@code LENIENT} and a time is parsed
* without a date, then the complete result of the parse consists of a
* {@code LocalTime} and an excess {@code Period} in days.
* <p>
* <li>If the {@code ResolverStyle} is {@code SMART} and a time is parsed
* without a date where the time is 24:00:00, then the complete result of
* the parse consists of a {@code LocalTime} of 00:00:00 and an excess
* {@code Period} of one day.
* </ul>
* <p>
* In both cases, if a complete {@code ChronoLocalDateTime} or {@code Instant}
* is parsed, then the excess days are added to the date part.
* As a result, this query will return a zero period.
* <p>
* The {@code SMART} behaviour handles the common "end of day" 24:00 value.
* Processing in {@code LENIENT} mode also produces the same result:
* <pre>
* Text to parse Parsed object Excess days
* "2012-12-03T00:00" LocalDateTime.of(2012, 12, 3, 0, 0) ZERO
* "2012-12-03T24:00" LocalDateTime.of(2012, 12, 4, 0, 0) ZERO
* "00:00" LocalTime.of(0, 0) ZERO
* "24:00" LocalTime.of(0, 0) Period.ofDays(1)
* </pre>
* The query can be used as follows:
* <pre>
* TemporalAccessor parsed = formatter.parse(str);
* LocalTime time = parsed.query(LocalTime::from);
* Period extraDays = parsed.query(DateTimeFormatter.parsedExcessDays());
* </pre>
*/
public
static
final
TemporalQuery
<
Period
>
parsedExcessDays
()
{
return
PARSED_EXCESS_DAYS
;
}
private
static
final
TemporalQuery
<
Period
>
PARSED_EXCESS_DAYS
=
t
->
{
if
(
t
instanceof
Parsed
)
{
return
((
Parsed
)
t
).
excessDays
;
}
else
{
return
Period
.
ZERO
;
}
};
/**
* A query that provides access to whether a leap-second was parsed.
* <p>
* This returns a singleton {@linkplain TemporalQuery query} that provides
* access to additional information from the parse. The query always returns
* a non-null boolean, true if parsing saw a leap-second, false if not.
* <p>
* Instant parsing handles the special "leap second" time of '23:59:60'.
* Leap seconds occur at '23:59:60' in the UTC time-zone, but at other
* local times in different time-zones. To avoid this potential ambiguity,
* the handling of leap-seconds is limited to
* {@link DateTimeFormatterBuilder#appendInstant()}, as that method
* always parses the instant with the UTC zone offset.
* <p>
* If the time '23:59:60' is received, then a simple conversion is applied,
* replacing the second-of-minute of 60 with 59. This query can be used
* on the parse result to determine if the leap-second adjustment was made.
* The query will return one second of excess if it did adjust to remove
* the leap-second, and zero if not. Note that applying a leap-second
* smoothing mechanism, such as UTC-SLS, is the responsibility of the
* application, as follows:
* <pre>
* TemporalAccessor parsed = formatter.parse(str);
* Instant instant = parsed.query(Instant::from);
* if (parsed.query(DateTimeFormatter.parsedLeapSecond())) {
* // validate leap-second is correct and apply correct smoothing
* }
* </pre>
*/
public
static
final
TemporalQuery
<
Boolean
>
parsedLeapSecond
()
{
return
PARSED_LEAP_SECOND
;
}
private
static
final
TemporalQuery
<
Boolean
>
PARSED_LEAP_SECOND
=
t
->
{
if
(
t
instanceof
Parsed
)
{
return
((
Parsed
)
t
).
leapSecond
;
}
else
{
return
Boolean
.
FALSE
;
}
};
//-----------------------------------------------------------------------
/**
* Constructor.
*
* @param printerParser the printer/parser to use, not null
* @param locale the locale to use, not null
* @param
symbols the symbols
to use, not null
* @param
decimalStyle the DecimalStyle
to use, not null
* @param resolverStyle the resolver style to use, not null
* @param resolverFields the fields to use during resolving, null for all fields
* @param chrono the chronology to use, null for no override
* @param zone the zone to use, null for no override
*/
DateTimeFormatter
(
CompositePrinterParser
printerParser
,
Locale
locale
,
D
ateTimeFormatSymbols
symbols
,
Locale
locale
,
D
ecimalStyle
decimalStyle
,
ResolverStyle
resolverStyle
,
Set
<
TemporalField
>
resolverFields
,
Chronology
chrono
,
ZoneId
zone
)
{
this
.
printerParser
=
Objects
.
requireNonNull
(
printerParser
,
"printerParser"
);
this
.
resolverFields
=
resolverFields
;
this
.
locale
=
Objects
.
requireNonNull
(
locale
,
"locale"
);
this
.
symbols
=
Objects
.
requireNonNull
(
symbols
,
"symbols
"
);
this
.
decimalStyle
=
Objects
.
requireNonNull
(
decimalStyle
,
"decimalStyle
"
);
this
.
resolverStyle
=
Objects
.
requireNonNull
(
resolverStyle
,
"resolverStyle"
);
this
.
chrono
=
chrono
;
this
.
zone
=
zone
;
...
...
@@ -1253,32 +1409,32 @@ public final class DateTimeFormatter {
if
(
this
.
locale
.
equals
(
locale
))
{
return
this
;
}
return
new
DateTimeFormatter
(
printerParser
,
locale
,
symbols
,
resolverStyle
,
resolverFields
,
chrono
,
zone
);
return
new
DateTimeFormatter
(
printerParser
,
locale
,
decimalStyle
,
resolverStyle
,
resolverFields
,
chrono
,
zone
);
}
//-----------------------------------------------------------------------
/**
* Gets the
set of symbols
to be used during formatting.
* Gets the
DecimalStyle
to be used during formatting.
*
* @return the locale of this formatter, not null
*/
public
D
ateTimeFormatSymbols
getSymbols
()
{
return
symbols
;
public
D
ecimalStyle
getDecimalStyle
()
{
return
decimalStyle
;
}
/**
* Returns a copy of this formatter with a new
set of symbols
.
* Returns a copy of this formatter with a new
DecimalStyle
.
* <p>
* This instance is immutable and unaffected by this method call.
*
* @param
symbols the new symbols
, not null
* @return a formatter based on this formatter with the requested
symbols
, not null
* @param
decimalStyle the new DecimalStyle
, not null
* @return a formatter based on this formatter with the requested
DecimalStyle
, not null
*/
public
DateTimeFormatter
with
Symbols
(
DateTimeFormatSymbols
symbols
)
{
if
(
this
.
symbols
.
equals
(
symbols
))
{
public
DateTimeFormatter
with
DecimalStyle
(
DecimalStyle
decimalStyle
)
{
if
(
this
.
decimalStyle
.
equals
(
decimalStyle
))
{
return
this
;
}
return
new
DateTimeFormatter
(
printerParser
,
locale
,
symbols
,
resolverStyle
,
resolverFields
,
chrono
,
zone
);
return
new
DateTimeFormatter
(
printerParser
,
locale
,
decimalStyle
,
resolverStyle
,
resolverFields
,
chrono
,
zone
);
}
//-----------------------------------------------------------------------
...
...
@@ -1332,7 +1488,7 @@ public final class DateTimeFormatter {
if
(
Objects
.
equals
(
this
.
chrono
,
chrono
))
{
return
this
;
}
return
new
DateTimeFormatter
(
printerParser
,
locale
,
symbols
,
resolverStyle
,
resolverFields
,
chrono
,
zone
);
return
new
DateTimeFormatter
(
printerParser
,
locale
,
decimalStyle
,
resolverStyle
,
resolverFields
,
chrono
,
zone
);
}
//-----------------------------------------------------------------------
...
...
@@ -1389,7 +1545,7 @@ public final class DateTimeFormatter {
if
(
Objects
.
equals
(
this
.
zone
,
zone
))
{
return
this
;
}
return
new
DateTimeFormatter
(
printerParser
,
locale
,
symbols
,
resolverStyle
,
resolverFields
,
chrono
,
zone
);
return
new
DateTimeFormatter
(
printerParser
,
locale
,
decimalStyle
,
resolverStyle
,
resolverFields
,
chrono
,
zone
);
}
//-----------------------------------------------------------------------
...
...
@@ -1431,7 +1587,7 @@ public final class DateTimeFormatter {
if
(
Objects
.
equals
(
this
.
resolverStyle
,
resolverStyle
))
{
return
this
;
}
return
new
DateTimeFormatter
(
printerParser
,
locale
,
symbols
,
resolverStyle
,
resolverFields
,
chrono
,
zone
);
return
new
DateTimeFormatter
(
printerParser
,
locale
,
decimalStyle
,
resolverStyle
,
resolverFields
,
chrono
,
zone
);
}
//-----------------------------------------------------------------------
...
...
@@ -1495,7 +1651,7 @@ public final class DateTimeFormatter {
return
this
;
}
fields
=
Collections
.
unmodifiableSet
(
fields
);
return
new
DateTimeFormatter
(
printerParser
,
locale
,
symbols
,
resolverStyle
,
fields
,
chrono
,
zone
);
return
new
DateTimeFormatter
(
printerParser
,
locale
,
decimalStyle
,
resolverStyle
,
fields
,
chrono
,
zone
);
}
/**
...
...
@@ -1543,7 +1699,7 @@ public final class DateTimeFormatter {
return
this
;
}
resolverFields
=
Collections
.
unmodifiableSet
(
new
HashSet
<>(
resolverFields
));
return
new
DateTimeFormatter
(
printerParser
,
locale
,
symbols
,
resolverStyle
,
resolverFields
,
chrono
,
zone
);
return
new
DateTimeFormatter
(
printerParser
,
locale
,
decimalStyle
,
resolverStyle
,
resolverFields
,
chrono
,
zone
);
}
//-----------------------------------------------------------------------
...
...
src/share/classes/java/time/format/DateTimeFormatterBuilder.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/java/time/format/DateTimeParseContext.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/java/time/format/DateTimeParseException.java
浏览文件 @
9694304e
...
...
@@ -68,7 +68,7 @@ import java.time.DateTimeException;
* <p>
* This exception includes the text being parsed and the error index.
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This class is intended for use in a single thread.
*
* @since 1.8
...
...
src/share/classes/java/time/format/DateTimePrintContext.java
浏览文件 @
9694304e
...
...
@@ -85,7 +85,7 @@ import java.util.Objects;
* <p>
* This class provides a single wrapper to items used in the format.
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This class is a mutable context intended for use from a single thread.
* Usage of the class is thread-safe within standard printing as the framework creates
* a new instance of the class for each format and printing is single-threaded.
...
...
@@ -234,7 +234,7 @@ final class DateTimePrintContext {
* Gets the locale.
* <p>
* This locale is used to control localization in the format output except
* where localization is controlled by the
symbols
.
* where localization is controlled by the
DecimalStyle
.
*
* @return the locale, not null
*/
...
...
@@ -243,14 +243,14 @@ final class DateTimePrintContext {
}
/**
* Gets the
formatting symbols
.
* Gets the
DecimalStyle
.
* <p>
* The
symbols control
the localization of numeric output.
* The
DecimalStyle controls
the localization of numeric output.
*
* @return the
formatting symbols
, not null
* @return the
DecimalStyle
, not null
*/
D
ateTimeFormatSymbols
getSymbols
()
{
return
formatter
.
get
Symbols
();
D
ecimalStyle
getDecimalStyle
()
{
return
formatter
.
get
DecimalStyle
();
}
//-----------------------------------------------------------------------
...
...
src/share/classes/java/time/format/DateTimeTextProvider.java
浏览文件 @
9694304e
...
...
@@ -94,7 +94,7 @@ import sun.util.locale.provider.LocaleResources;
/**
* A provider to obtain the textual form of a date-time field.
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* Implementations must be thread-safe.
* Implementations should cache the textual information.
*
...
...
src/share/classes/java/time/format/D
ateTimeFormatSymbols
.java
→
src/share/classes/java/time/format/D
ecimalStyle
.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/java/time/format/FormatStyle.java
浏览文件 @
9694304e
...
...
@@ -67,7 +67,7 @@ package java.time.format;
* These styles are used when obtaining a date-time style from configuration.
* See {@link DateTimeFormatter} and {@link DateTimeFormatterBuilder} for usage.
*
*
<h3>Specification for implementors</h3>
*
@implSpec
* This is an immutable and thread-safe enum.
*
* @since 1.8
...
...
src/share/classes/java/time/format/Parsed.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/java/time/format/ResolverStyle.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/java/time/format/SignStyle.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/java/time/format/TextStyle.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/java/time/format/package-info.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/java/time/temporal/ChronoField.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/java/time/temporal/ChronoUnit.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/java/time/temporal/IsoFields.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/java/time/temporal/JulianFields.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/java/time/temporal/Temporal.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/java/time/temporal/TemporalAccessor.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/java/time/temporal/TemporalAdjuster.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/java/time/temporal/TemporalAmount.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/java/time/temporal/TemporalField.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/java/time/temporal/TemporalQuery.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/java/time/temporal/TemporalUnit.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/java/time/temporal/UnsupportedTemporalTypeException.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/java/time/temporal/ValueRange.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/java/time/temporal/WeekFields.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/java/time/zone/Ser.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/java/time/zone/ZoneOffsetTransition.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/java/time/zone/ZoneOffsetTransitionRule.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/java/time/zone/ZoneRules.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/java/time/zone/ZoneRulesException.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/java/time/zone/ZoneRulesProvider.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/java/util/Base64.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/java/util/JapaneseImperialCalendar.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/java/util/Objects.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/sun/net/www/MessageHeader.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/sun/nio/cs/ext/ISO2022_JP_2.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/sun/nio/cs/ext/META-INF/services/java.nio.charset.spi.CharsetProvider
已删除
100644 → 0
浏览文件 @
0321af12
此差异已折叠。
点击以展开。
src/share/classes/sun/nio/cs/ext/MSISO2022JP.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/sun/util/calendar/LocalGregorianCalendar.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/sun/util/calendar/ZoneInfoFile.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/sun/util/resources/TimeZoneNames.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/sun/util/resources/de/TimeZoneNames_de.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/sun/util/resources/es/TimeZoneNames_es.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/sun/util/resources/fr/TimeZoneNames_fr.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/sun/util/resources/it/TimeZoneNames_it.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/sun/util/resources/ja/TimeZoneNames_ja.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/sun/util/resources/ko/TimeZoneNames_ko.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/sun/util/resources/pt/TimeZoneNames_pt_BR.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/sun/util/resources/sv/TimeZoneNames_sv.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/sun/util/resources/zh/TimeZoneNames_zh_CN.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/classes/sun/util/resources/zh/TimeZoneNames_zh_TW.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/sample/scripting/scriptpad/src/com/sun/sample/scriptpad/Main.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/sample/scripting/scriptpad/src/resources/Main.js
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/sample/scripting/scriptpad/src/resources/conc.js
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/sample/scripting/scriptpad/src/resources/gui.js
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/sample/scripting/scriptpad/src/resources/mm.js
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/sample/scripting/scriptpad/src/resources/scriptpad.js
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/sample/scripting/scriptpad/src/scripts/browse.js
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/sample/scripting/scriptpad/src/scripts/insertfile.js
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/sample/scripting/scriptpad/src/scripts/linewrap.js
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/sample/scripting/scriptpad/src/scripts/mail.js
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/sample/scripting/scriptpad/src/scripts/memmonitor.js
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/sample/scripting/scriptpad/src/scripts/memory.js
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/sample/scripting/scriptpad/src/scripts/memory.sh
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/share/sample/scripting/scriptpad/src/scripts/textcolor.js
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
src/windows/classes/java/lang/ProcessImpl.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/lang/Runtime/exec/ExecCommand.java
0 → 100644
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/lang/StringBuffer/ToStringCache.java
0 → 100644
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/net/HttpURLPermission/HttpURLPermissionTest.java
0 → 100644
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/net/HttpURLPermission/URLTest.java
0 → 100644
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/net/HttpURLPermission/policy.1
0 → 100644
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/net/HttpURLPermission/policy.2
0 → 100644
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/net/HttpURLPermission/policy.3
0 → 100644
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/time/tck/java/time/TCKInstant.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/time/tck/java/time/TCKLocalTime.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/time/tck/java/time/TCKOffsetTime.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/time/tck/java/time/TCKYear.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/time/tck/java/time/TCKYearMonth.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/time/tck/java/time/TCKZoneOffset.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/time/tck/java/time/chrono/TCKChronology.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/time/tck/java/time/chrono/TCKChronologySerialization.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/time/tck/java/time/chrono/TCKHijrahChronology.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/time/tck/java/time/chrono/TCKJapaneseChronology.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/time/tck/java/time/chrono/TCKThaiBuddhistChronology.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/time/tck/java/time/format/TCKDateTimeFormatter.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/time/tck/java/time/format/TCKDateTimeFormatters.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/time/tck/java/time/format/TCKDateTimeParseResolver.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/time/tck/java/time/format/TCKD
ateTimeFormatSymbols
.java
→
test/java/time/tck/java/time/format/TCKD
ecimalStyle
.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/time/tck/java/time/format/TCKInstantPrinterParser.java
0 → 100644
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/time/tck/java/time/format/TCKTextStyle.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/time/tck/java/time/temporal/TCKWeekFields.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/time/test/java/time/chrono/TestChronologyPerf.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/time/test/java/time/chrono/TestExampleCode.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/time/test/java/time/chrono/TestJapaneseChronology.java
0 → 100644
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/time/test/java/time/format/AbstractTestPrinterParser.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/time/test/java/time/format/TestDateTimeFormatter.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/time/test/java/time/format/TestDateTimeFormatterBuilder.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/time/test/java/time/format/TestD
ateTimeFormatSymbols
.java
→
test/java/time/test/java/time/format/TestD
ecimalStyle
.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/time/test/java/time/format/TestFractionPrinterParser.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/time/test/java/time/format/TestNonIsoFormatter.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/time/test/java/time/format/TestNumberParser.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/time/test/java/time/format/TestReducedParser.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/time/test/java/time/format/TestReducedPrinter.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/time/test/java/time/format/TestZoneTextPrinterParser.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/util/Base64/TestBase64.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/util/Locale/LocaleProviders.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/util/Locale/LocaleProviders.sh
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/java/util/Objects/BasicObjectsTest.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/sun/util/calendar/zi/Rule.java
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/sun/util/calendar/zi/tzdata/VERSION
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/sun/util/calendar/zi/tzdata/africa
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/sun/util/calendar/zi/tzdata/antarctica
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/sun/util/calendar/zi/tzdata/asia
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/sun/util/calendar/zi/tzdata/australasia
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/sun/util/calendar/zi/tzdata/europe
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/sun/util/calendar/zi/tzdata/northamerica
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/sun/util/calendar/zi/tzdata/southamerica
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
test/sun/util/calendar/zi/tzdata/zone.tab
浏览文件 @
9694304e
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录