Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
95184625
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看板
提交
95184625
编写于
11月 26, 2014
作者:
L
lana
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
9e4b724c
1e917361
变更
66
展开全部
隐藏空白更改
内联
并排
Showing
66 changed file
with
2558 addition
and
863 deletion
+2558
-863
make/CompileJavaClasses.gmk
make/CompileJavaClasses.gmk
+0
-1
make/data/tzdata/VERSION
make/data/tzdata/VERSION
+1
-1
make/data/tzdata/africa
make/data/tzdata/africa
+22
-57
make/data/tzdata/asia
make/data/tzdata/asia
+57
-32
make/data/tzdata/australasia
make/data/tzdata/australasia
+6
-6
make/data/tzdata/europe
make/data/tzdata/europe
+15
-3
make/data/tzdata/leapseconds
make/data/tzdata/leapseconds
+2
-2
make/data/tzdata/northamerica
make/data/tzdata/northamerica
+12
-8
make/data/tzdata/southamerica
make/data/tzdata/southamerica
+9
-9
src/macosx/classes/com/apple/laf/AquaComboBoxUI.java
src/macosx/classes/com/apple/laf/AquaComboBoxUI.java
+6
-1
src/macosx/classes/com/apple/laf/AquaIcon.java
src/macosx/classes/com/apple/laf/AquaIcon.java
+1
-1
src/macosx/classes/com/apple/laf/AquaImageFactory.java
src/macosx/classes/com/apple/laf/AquaImageFactory.java
+1
-1
src/macosx/classes/com/apple/laf/AquaNativeResources.java
src/macosx/classes/com/apple/laf/AquaNativeResources.java
+2
-1
src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
+3
-0
src/macosx/classes/sun/lwawt/macosx/CWrapper.java
src/macosx/classes/sun/lwawt/macosx/CWrapper.java
+18
-0
src/macosx/native/sun/awt/CWrapper.m
src/macosx/native/sun/awt/CWrapper.m
+17
-0
src/macosx/native/sun/java2d/opengl/CGLGraphicsConfig.m
src/macosx/native/sun/java2d/opengl/CGLGraphicsConfig.m
+2
-0
src/macosx/native/sun/java2d/opengl/CGLSurfaceData.m
src/macosx/native/sun/java2d/opengl/CGLSurfaceData.m
+5
-0
src/share/classes/java/awt/datatransfer/SystemFlavorMap.java
src/share/classes/java/awt/datatransfer/SystemFlavorMap.java
+151
-206
src/share/classes/java/beans/Introspector.java
src/share/classes/java/beans/Introspector.java
+57
-15
src/share/classes/java/lang/invoke/DelegatingMethodHandle.java
...hare/classes/java/lang/invoke/DelegatingMethodHandle.java
+28
-9
src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java
...re/classes/java/lang/invoke/InvokerBytecodeGenerator.java
+7
-2
src/share/classes/java/lang/invoke/LambdaForm.java
src/share/classes/java/lang/invoke/LambdaForm.java
+22
-5
src/share/classes/java/lang/invoke/MethodHandle.java
src/share/classes/java/lang/invoke/MethodHandle.java
+15
-28
src/share/classes/java/lang/invoke/MethodHandleImpl.java
src/share/classes/java/lang/invoke/MethodHandleImpl.java
+127
-6
src/share/classes/java/lang/invoke/MethodHandleStatics.java
src/share/classes/java/lang/invoke/MethodHandleStatics.java
+6
-6
src/share/classes/java/lang/invoke/MethodHandles.java
src/share/classes/java/lang/invoke/MethodHandles.java
+91
-161
src/share/classes/java/lang/invoke/MethodTypeForm.java
src/share/classes/java/lang/invoke/MethodTypeForm.java
+19
-18
src/share/classes/java/lang/reflect/Executable.java
src/share/classes/java/lang/reflect/Executable.java
+48
-1
src/share/classes/java/lang/reflect/Parameter.java
src/share/classes/java/lang/reflect/Parameter.java
+1
-1
src/share/classes/javax/swing/CellEditor.java
src/share/classes/javax/swing/CellEditor.java
+2
-2
src/share/classes/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java
...s/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java
+8
-4
src/share/classes/javax/swing/plaf/basic/BasicTransferable.java
...are/classes/javax/swing/plaf/basic/BasicTransferable.java
+13
-2
src/share/classes/sun/awt/datatransfer/DataTransferer.java
src/share/classes/sun/awt/datatransfer/DataTransferer.java
+6
-5
src/share/classes/sun/java2d/opengl/OGLBlitLoops.java
src/share/classes/sun/java2d/opengl/OGLBlitLoops.java
+61
-17
src/share/classes/sun/java2d/pipe/DrawImage.java
src/share/classes/sun/java2d/pipe/DrawImage.java
+1
-1
src/share/classes/sun/management/Flag.java
src/share/classes/sun/management/Flag.java
+9
-1
src/share/classes/sun/net/www/http/HttpClient.java
src/share/classes/sun/net/www/http/HttpClient.java
+8
-6
src/solaris/classes/sun/awt/X11/XDataTransferer.java
src/solaris/classes/sun/awt/X11/XDataTransferer.java
+6
-4
src/solaris/classes/sun/awt/X11/XWM.java
src/solaris/classes/sun/awt/X11/XWM.java
+6
-1
src/windows/classes/sun/java2d/d3d/D3DBlitLoops.java
src/windows/classes/sun/java2d/d3d/D3DBlitLoops.java
+53
-7
test/java/awt/datatransfer/MappingGenerationTest/MappingGenerationTest.java
...transfer/MappingGenerationTest/MappingGenerationTest.java
+183
-0
test/java/awt/image/DrawImage/IncorrectAlphaConversionBicubic.java
.../awt/image/DrawImage/IncorrectAlphaConversionBicubic.java
+113
-0
test/java/awt/image/DrawImage/IncorrectClipXorModeSW2Surface.java
...a/awt/image/DrawImage/IncorrectClipXorModeSW2Surface.java
+179
-0
test/java/awt/image/DrawImage/IncorrectUnmanagedImageSourceOffset.java
.../image/DrawImage/IncorrectUnmanagedImageSourceOffset.java
+150
-0
test/java/awt/image/DrawImage/UnmanagedDrawImagePerformance.java
...va/awt/image/DrawImage/UnmanagedDrawImagePerformance.java
+125
-0
test/java/beans/Introspector/Test4168833.java
test/java/beans/Introspector/Test4168833.java
+3
-6
test/java/beans/Introspector/Test8034085.java
test/java/beans/Introspector/Test8034085.java
+236
-0
test/java/beans/Introspector/Test8034164.java
test/java/beans/Introspector/Test8034164.java
+233
-0
test/java/lang/instrument/DaemonThread/TestDaemonThread.java
test/java/lang/instrument/DaemonThread/TestDaemonThread.java
+1
-1
test/java/lang/invoke/LFCaching/LFGarbageCollectedTest.java
test/java/lang/invoke/LFCaching/LFGarbageCollectedTest.java
+1
-1
test/java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java
.../java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java
+1
-1
test/java/lang/invoke/LFCaching/LFSingleThreadCachingTest.java
...java/lang/invoke/LFCaching/LFSingleThreadCachingTest.java
+1
-1
test/javax/swing/DataTransfer/8059739/bug8059739.java
test/javax/swing/DataTransfer/8059739/bug8059739.java
+80
-0
test/javax/swing/JComboBox/ConsumedKeyTest/ConsumedKeyTest.java
...avax/swing/JComboBox/ConsumedKeyTest/ConsumedKeyTest.java
+18
-12
test/sun/java2d/DirectX/OnScreenRenderingResizeTest/OnScreenRenderingResizeTest.java
...creenRenderingResizeTest/OnScreenRenderingResizeTest.java
+11
-6
test/sun/net/www/http/HttpClient/StreamingRetry.java
test/sun/net/www/http/HttpClient/StreamingRetry.java
+14
-5
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
+41
-95
test/sun/util/calendar/zi/tzdata/asia
test/sun/util/calendar/zi/tzdata/asia
+119
-52
test/sun/util/calendar/zi/tzdata/australasia
test/sun/util/calendar/zi/tzdata/australasia
+44
-12
test/sun/util/calendar/zi/tzdata/europe
test/sun/util/calendar/zi/tzdata/europe
+27
-6
test/sun/util/calendar/zi/tzdata/leapseconds
test/sun/util/calendar/zi/tzdata/leapseconds
+2
-2
test/sun/util/calendar/zi/tzdata/northamerica
test/sun/util/calendar/zi/tzdata/northamerica
+40
-21
test/sun/util/calendar/zi/tzdata/southamerica
test/sun/util/calendar/zi/tzdata/southamerica
+9
-9
test/sun/util/calendar/zi/tzdata/zone.tab
test/sun/util/calendar/zi/tzdata/zone.tab
+2
-1
未找到文件。
make/CompileJavaClasses.gmk
浏览文件 @
95184625
...
...
@@ -59,7 +59,6 @@ endif
ifndef OPENJDK
# There exists two versions of these files...
EXFILES += $(JDK_TOPDIR)/src/share/classes/javax/crypto/JarVerifier.java
EXFILES += $(JDK_TOPDIR)/src/share/classes/sun/management/ExtendedPlatformComponent.java
ifeq ($(OPENJDK_TARGET_OS), windows)
# This gets built on unix platforms implicitly in the old build even though
...
...
make/data/tzdata/VERSION
浏览文件 @
95184625
...
...
@@ -21,4 +21,4 @@
# or visit www.oracle.com if you need additional information or have any
# questions.
#
tzdata2014
i
tzdata2014
j
make/data/tzdata/africa
浏览文件 @
95184625
...
...
@@ -29,20 +29,19 @@
# tz@iana.org for general use in the future). For more, please see
# the file CONTRIBUTING in the tz distribution.
# From Paul Eggert (201
3-02-2
1):
# From Paul Eggert (201
4-10-3
1):
#
#
A good source for time zone historical data outside the U.S. is
#
Unless otherwise specified, the source for data through 1990 is:
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
# San Diego: ACS Publications, Inc. (2003).
# Unfortunately this book contains many errors and cites no sources.
#
# 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),
# published semiannually. Law sent in several helpful summaries
# of the IATA's data after 1990.
#
# Except where otherwise noted, Shanks & Pottenger is the source for
# entries through 1990, and IATA SSIM is the source for entries afterwards.
# of the IATA's data after 1990. Except where otherwise noted,
# IATA SSIM is the source for entries after 1990.
#
# Another source occasionally used is Edward W. Whitman, World Time Differences,
# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which
...
...
@@ -88,7 +87,6 @@
# 3:00 CAST Central Africa Summer Time (no longer used)
# 3:00 SAST South Africa Summer Time (no longer used)
# 3:00 EAT East Africa Time
# 4:00 EAST East Africa Summer Time (no longer used)
# Algeria
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
...
...
@@ -169,9 +167,7 @@ Zone Africa/Ndjamena 1:00:12 - LMT 1912 # N'Djamena
1:00 - WAT
# Comoros
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Indian/Comoro 2:53:04 - LMT 1911 Jul # Moroni, Gran Comoro
3:00 - EAT
# See Africa/Nairobi.
# Democratic Republic of the Congo
# See Africa/Lagos for the western part and Africa/Maputo for the eastern.
...
...
@@ -195,9 +191,7 @@ Link Africa/Abidjan Africa/Sao_Tome # São Tomé and Príncipe
Link Africa/Abidjan Atlantic/St_Helena # St Helena
# Djibouti
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Djibouti 2:52:36 - LMT 1911 Jul
3:00 - EAT
# See Africa/Nairobi.
###############################################################################
...
...
@@ -410,27 +404,8 @@ Zone Africa/Cairo 2:05:09 - LMT 1900 Oct
# See Africa/Lagos.
# Eritrea
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Asmara 2:35:32 - LMT 1870
2:35:32 - AMT 1890 # Asmara Mean Time
2:35:20 - ADMT 1936 May 5 # Adis Dera MT
3:00 - EAT
# Ethiopia
# From Paul Eggert (2014-07-31):
# Like the Swahili of Kenya and Tanzania, many Ethiopians keep a
# 12-hour clock starting at our 06:00, so their "8 o'clock" is our
# 02:00 or 14:00. Keep this in mind when you ask the time in Amharic.
#
# Shanks & Pottenger write that Ethiopia had six narrowly-spaced time
# zones between 1870 and 1890, that they merged to 38E50 (2:35:20) in
# 1890, and that they switched to 3:00 on 1936-05-05. Perhaps 38E50
# was for Adis Dera. Quite likely the Shanks data entries are wrong
# anyway.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Addis_Ababa 2:34:48 - LMT 1870
2:35:20 - ADMT 1936 May 5 # Adis Dera MT
3:00 - EAT
# See Africa/Nairobi.
# Gabon
# See Africa/Lagos.
...
...
@@ -474,6 +449,15 @@ Zone Africa/Nairobi 2:27:16 - LMT 1928 Jul
2:30 - BEAT 1940
2:45 - BEAUT 1960
3:00 - EAT
Link Africa/Nairobi Africa/Addis_Ababa # Ethiopia
Link Africa/Nairobi Africa/Asmara # Eritrea
Link Africa/Nairobi Africa/Dar_es_Salaam # Tanzania
Link Africa/Nairobi Africa/Djibouti
Link Africa/Nairobi Africa/Kampala # Uganda
Link Africa/Nairobi Africa/Mogadishu # Somalia
Link Africa/Nairobi Indian/Antananarivo # Madagascar
Link Africa/Nairobi Indian/Comoro
Link Africa/Nairobi Indian/Mayotte
# Lesotho
# See Africa/Johannesburg.
...
...
@@ -551,11 +535,7 @@ Zone Africa/Tripoli 0:52:44 - LMT 1920
2:00 - EET
# Madagascar
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Indian/Antananarivo 3:10:04 - LMT 1911 Jul
3:00 - EAT 1954 Feb 27 23:00s
3:00 1:00 EAST 1954 May 29 23:00s
3:00 - EAT
# See Africa/Nairobi.
# Malawi
# See Africa/Maputo.
...
...
@@ -658,9 +638,7 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis
# no information; probably like Indian/Mauritius
# Mayotte
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou
3:00 - EAT
# See Africa/Nairobi.
# Morocco
# See the 'europe' file for Spanish Morocco (Africa/Ceuta).
...
...
@@ -1072,11 +1050,7 @@ Zone Indian/Mahe 3:41:48 - LMT 1906 Jun # Victoria
# See Africa/Abidjan.
# Somalia
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Mogadishu 3:01:28 - LMT 1893 Nov
3:00 - EAT 1931
2:30 - BEAT 1957
3:00 - EAT
# See Africa/Nairobi.
# South Africa
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
...
...
@@ -1119,11 +1093,7 @@ Link Africa/Khartoum Africa/Juba
# See Africa/Johannesburg.
# Tanzania
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Dar_es_Salaam 2:37:08 - LMT 1931
3:00 - EAT 1948
2:45 - BEAUT 1961
3:00 - EAT
# See Africa/Nairobi.
# Togo
# See Africa/Abidjan.
...
...
@@ -1229,12 +1199,7 @@ Zone Africa/Tunis 0:40:44 - LMT 1881 May 12
1:00 Tunisia CE%sT
# Uganda
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Kampala 2:09:40 - LMT 1928 Jul
3:00 - EAT 1930
2:30 - BEAT 1948
2:45 - BEAUT 1957
3:00 - EAT
# See Africa/Nairobi.
# Zambia
# Zimbabwe
...
...
make/data/tzdata/asia
浏览文件 @
95184625
...
...
@@ -29,20 +29,19 @@
# tz@iana.org for general use in the future). For more, please see
# the file CONTRIBUTING in the tz distribution.
# From Paul Eggert (201
3-08-1
1):
# From Paul Eggert (201
4-10-3
1):
#
#
A good source for time zone historical data outside the U.S. is
#
Unless otherwise specified, the source for data through 1990 is:
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
# San Diego: ACS Publications, Inc. (2003).
# Unfortunately this book contains many errors and cites no sources.
#
# 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),
# published semiannually. Law sent in several helpful summaries
# of the IATA's data after 1990.
#
# Except where otherwise noted, Shanks & Pottenger is the source for
# entries through 1990, and IATA SSIM is the source for entries afterwards.
# of the IATA's data after 1990. Except where otherwise noted,
# IATA SSIM is the source for entries after 1990.
#
# Another source occasionally used is Edward W. Whitman, World Time Differences,
# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which
...
...
@@ -1686,44 +1685,70 @@ Zone Asia/Bishkek 4:58:24 - LMT 1924 May 2
# Korea (North and South)
# From Annie I. Bang (2006-07-10):
# http://www.koreaherald.co.kr/SITE/data/html_dir/2006/07/10/200607100012.asp
# The Ministry of Commerce, Industry and Energy has already
# commissioned a research project [to reintroduce DST] and has said
# the system may begin as early as 2008.... Korea ran a daylight
# saving program from 1949-61 but stopped it during the 1950-53 Korean War.
# http://www.koreaherald.com/view.php?ud=200607100012
# Korea ran a daylight saving program from 1949-61 but stopped it
# during the 1950-53 Korean War. The system was temporarily enforced
# between 1987 and 1988 ...
# From Sanghyuk Jung (2014-10-29):
# http://mm.icann.org/pipermail/tz/2014-October/021830.html
# According to the Korean Wikipedia
# http://ko.wikipedia.org/wiki/한국_표준시
# [oldid=12896437 2014-09-04 08:03 UTC]
# DST in Republic of Korea was as follows.... And I checked old
# newspapers in Korean, all articles correspond with data in Wikipedia.
# For example, the article in 1948 (Korean Language) proved that DST
# started at June 1 in that year. For another example, the article in
# 1988 said that DST started at 2:00 AM in that year.
# From Shanks & Pottenger:
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule ROK 1960 only - May 15 0:00 1:00 D
Rule ROK 1960 only - Sep 13 0:00 0 S
Rule ROK 1987 1988 - May Sun>=8 0:00 1:00 D
Rule ROK 1987 1988 - Oct Sun>=8 0:00 0 S
# From Paul Eggert (2014-07-01):
# The following entries are from Shanks & Pottenger, except that I
# guessed that time zone abbreviations through 1945 followed the same
Rule ROK 1948 only - Jun 1 0:00 1:00 D
Rule ROK 1948 only - Sep 13 0:00 0 S
Rule ROK 1949 only - Apr 3 0:00 1:00 D
Rule ROK 1949 1951 - Sep Sun>=8 0:00 0 S
Rule ROK 1950 only - Apr 1 0:00 1:00 D
Rule ROK 1951 only - May 6 0:00 1:00 D
Rule ROK 1955 only - May 5 0:00 1:00 D
Rule ROK 1955 only - Sep 9 0:00 0 S
Rule ROK 1956 only - May 20 0:00 1:00 D
Rule ROK 1956 only - Sep 30 0:00 0 S
Rule ROK 1957 1960 - May Sun>=1 0:00 1:00 D
Rule ROK 1957 1960 - Sep Sun>=18 0:00 0 S
Rule ROK 1987 1988 - May Sun>=8 2:00 1:00 D
Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S
# From Paul Eggert (2014-10-30):
# The Korean Wikipedia entry gives the following sources for UT offsets:
#
# 1908: Official Journal Article No. 3994 (Edict No. 5)
# 1912: Governor-General of Korea Official Gazette Issue No. 367
# (Announcement No. 338)
# 1954: Presidential Decree No. 876 (1954-03-17)
# 1961: Law No. 676 (1961-08-07)
# 1987: Law No. 3919 (1986-12-31)
#
# The Wikipedia entry also has confusing information about a change
# to UT+9 in April 1910, but then what would be the point of the later change
# to UT+9 on 1912-01-01? Omit the 1910 change for now.
#
# I guessed that time zone abbreviations through 1945 followed the same
# rules as discussed under Taiwan, with nominal switches from JST to KST
# when the respective cities were taken over by the Allies after WWII.
#
# For Pyongyang we have no information; guess no changes since World War II.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Seoul 8:27:52 - LMT 1890
8:30 - KST 1904 Dec
9:00 - JCST 1928
8:30 - KST 1932
Zone Asia/Seoul 8:27:52 - LMT 1908 Apr 1
8:30 - KST 1912 Jan 1
9:00 - JCST 1937 Oct 1
9:00 - JST 1945 Sep 8
9:00 - KST 1954 Mar 21
8:00 ROK K%sT 1961 Aug 10
8:30 - KST 1968 Oct
8:30 ROK K%sT 1961 Aug 10
9:00 ROK K%sT
Zone Asia/Pyongyang 8:23:00 - LMT 1890
8:30 - KST 1904 Dec
9:00 - JCST 1928
8:30 - KST 1932
Zone Asia/Pyongyang 8:23:00 - LMT 1908 Apr 1
8:30 - KST 1912 Jan 1
9:00 - JCST 1937 Oct 1
9:00 - JST 1945 Aug 24
9:00 - KST 1954 Mar 21
8:00 - KST 1961 Aug 10
9:00 - KST
###############################################################################
...
...
make/data/tzdata/australasia
浏览文件 @
95184625
...
...
@@ -820,19 +820,19 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# tz@iana.org for general use in the future). For more, please see
# the file CONTRIBUTING in the tz distribution.
# From Paul Eggert (2013-02-21):
# A good source for time zone historical data outside the U.S. is
# From Paul Eggert (2014-10-31):
#
# Unless otherwise specified, the source for data through 1990 is:
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
# San Diego: ACS Publications, Inc. (2003).
# Unfortunately this book contains many errors and cites no sources.
#
# 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),
# published semiannually. Law sent in several helpful summaries
# of the IATA's data after 1990.
#
# Except where otherwise noted, Shanks & Pottenger is the source for
# entries through 1990, and IATA SSIM is the source for entries afterwards.
# of the IATA's data after 1990. Except where otherwise noted,
# IATA SSIM is the source for entries after 1990.
#
# Another source occasionally used is Edward W. Whitman, World Time Differences,
# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which
...
...
make/data/tzdata/europe
浏览文件 @
95184625
...
...
@@ -29,16 +29,19 @@
# tz@iana.org for general use in the future). For more, please see
# the file CONTRIBUTING in the tz distribution.
# From Paul Eggert (2014-05-31):
# A good source for time zone historical data outside the U.S. is
# From Paul Eggert (2014-10-31):
#
# Unless otherwise specified, the source for data through 1990 is:
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
# San Diego: ACS Publications, Inc. (2003).
# Unfortunately this book contains many errors and cites no sources.
#
# 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),
# published semiannually. Law sent in several helpful summaries
# of the IATA's data after 1990.
# of the IATA's data after 1990. Except where otherwise noted,
# IATA SSIM is the source for entries after 1990.
#
# A reliable and entertaining source about time zones is
# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
...
...
@@ -310,6 +313,14 @@
# "Timeball on the ballast office is down. Dunsink time."
# -- James Joyce, Ulysses
# "Countess Markievicz ... claimed that the [1916] abolition of Dublin Mean Time
# was among various actions undertaken by the 'English' government that
# would 'put the whole country into the SF (Sinn Féin) camp'. She claimed
# Irish 'public feeling (was) outraged by forcing of English time on us'."
# -- Parsons M. Dublin lost its time zone - and 25 minutes - after 1916 Rising.
# Irish Times 2014-10-27.
# http://www.irishtimes.com/news/politics/dublin-lost-its-time-zone-and-25-minutes-after-1916-rising-1.1977411
# From Joseph S. Myers (2005-01-26):
# Irish laws are available online at <http://www.irishstatutebook.ie>.
# These include various relating to legal time, for example:
...
...
@@ -617,6 +628,7 @@ Rule Russia 1992 only - Sep lastSat 23:00 0 -
Rule Russia 1993 2010 - Mar lastSun 2:00s 1:00 S
Rule Russia 1993 1995 - Sep lastSun 2:00s 0 -
Rule Russia 1996 2010 - Oct lastSun 2:00s 0 -
# As described below, Russia's 2014 change affects Zone data, not Rule data.
# From Alexander Krivenyshev (2011-06-14):
# According to Kremlin press service, Russian President Dmitry Medvedev
...
...
make/data/tzdata/leapseconds
浏览文件 @
95184625
...
...
@@ -33,8 +33,8 @@
# The NTP Timescale and Leap Seconds
# http://www.eecis.udel.edu/~mills/leap.html
# The International Earth Rotation
Service periodically uses leap seconds
# to keep UTC to within 0.9 s of UT1
# The International Earth Rotation
and Reference Systems Service
#
periodically uses leap seconds
to keep UTC to within 0.9 s of UT1
# (which measures the true angular orientation of the earth in space); see
# Terry J Quinn, The BIPM and the accurate measure of time,
# Proc IEEE 79, 7 (July 1991), 894-905 <http://dx.doi.org/10.1109/5.84965>.
...
...
make/data/tzdata/northamerica
浏览文件 @
95184625
...
...
@@ -1014,19 +1014,19 @@ Zone America/Menominee -5:50:27 - LMT 1885 Sep 18 12:00
################################################################################
# From Paul Eggert (2006-03-22):
# A good source for time zone historical data outside the U.S. is
# From Paul Eggert (2014-10-31):
#
# Unless otherwise specified, the source for data through 1990 is:
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
# San Diego: ACS Publications, Inc. (2003).
# Unfortunately this book contains many errors and cites no sources.
#
# 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),
# published semiannually. Law sent in several helpful summaries
# of the IATA's data after 1990.
#
# Except where otherwise noted, Shanks & Pottenger is the source for
# entries through 1990, and IATA SSIM is the source for entries afterwards.
# of the IATA's data after 1990. Except where otherwise noted,
# IATA SSIM is the source for entries after 1990.
#
# Other sources occasionally used include:
#
...
...
@@ -3154,13 +3154,17 @@ Zone America/Miquelon -3:44:40 - LMT 1911 May 15 # St Pierre
# From Paul Eggert (2014-08-19):
# The 2014-08-13 Cabinet meeting decided to stay on UTC-4 year-round. See:
# http://tcweeklynews.com/daylight-savings-time-to-be-maintained-p5353-127.htm
# Model this as a switch from EST/EDT to AST on 2014-11-02 at 02:00.
# Model this as a switch from EST/EDT to AST ...
# From Chris Walton (2014-11-04):
# ... the TCI government appears to have delayed the switch to
# "permanent daylight saving time" by one year....
# http://tcweeklynews.com/time-change-to-go-ahead-this-november-p5437-127.htm
#
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Grand_Turk -4:44:32 - LMT 1890
-5:07:11 - KMT 1912 Feb # Kingston Mean Time
-5:00 - EST 1979
-5:00 US E%sT 201
4 Nov 2
2:00
-5:00 US E%sT 201
5 Nov Sun>=1
2:00
-4:00 - AST
# British Virgin Is
...
...
make/data/tzdata/southamerica
浏览文件 @
95184625
...
...
@@ -29,23 +29,23 @@
# tz@iana.org for general use in the future). For more, please see
# the file CONTRIBUTING in the tz distribution.
# From Paul Eggert (2006-03-22):
# A good source for time zone historical data outside the U.S. is
# From Paul Eggert (2014-10-31):
#
# Unless otherwise specified, the source for data through 1990 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
# Unfortunately this book contains many errors and cites no sources.
#
# 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),
# published semiannually. Law sent in several helpful summaries
# of the IATA's data after 1990.
# of the IATA's data after 1990. Except where otherwise noted,
# IATA SSIM is the source for entries after 1990.
#
# Except where otherwise noted, Shanks & Pottenger is the source for
# entries through 1990, and IATA SSIM is the source for entries afterwards.
# 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
#
# Earlier editions of these tables used the North American style (e.g. ARST and
# ARDT for Argentine Standard and Daylight Time), but the following quote
...
...
src/macosx/classes/com/apple/laf/AquaComboBoxUI.java
浏览文件 @
95184625
...
...
@@ -486,10 +486,15 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
// This is somewhat messy. The difference here from BasicComboBoxUI.EnterAction is that
// arrow up or down does not automatically select the
private
static
final
Action
triggerSelectionAction
=
new
AbstractAction
()
{
private
final
Action
triggerSelectionAction
=
new
AbstractAction
()
{
public
void
actionPerformed
(
final
ActionEvent
e
)
{
triggerSelectionEvent
((
JComboBox
)
e
.
getSource
(),
e
);
}
@Override
public
boolean
isEnabled
()
{
return
comboBox
.
isPopupVisible
()
&&
super
.
isEnabled
();
}
};
private
static
final
Action
toggleSelectionAction
=
new
AbstractAction
()
{
...
...
src/macosx/classes/com/apple/laf/AquaIcon.java
浏览文件 @
95184625
...
...
@@ -62,7 +62,7 @@ public class AquaIcon {
if
(
w
<=
0
||
h
<=
0
)
return
null
;
// This could be any kind of icon, so we need to make a buffer for it, draw it and then pass the new image off to appkit.
final
BufferedImage
image
=
new
BufferedImage
(
w
,
h
,
BufferedImage
.
TYPE_INT_ARGB
);
final
BufferedImage
image
=
new
BufferedImage
(
w
,
h
,
BufferedImage
.
TYPE_INT_ARGB
_PRE
);
final
Graphics
g
=
image
.
getGraphics
();
i
.
paintIcon
(
null
,
g
,
0
,
0
);
g
.
dispose
();
...
...
src/macosx/classes/com/apple/laf/AquaImageFactory.java
浏览文件 @
95184625
...
...
@@ -129,7 +129,7 @@ public class AquaImageFactory {
};
final
BufferedImage
image
=
new
BufferedImage
(
scaledAlertIconSize
,
scaledAlertIconSize
,
BufferedImage
.
TYPE_INT_ARGB
);
scaledAlertIconSize
,
BufferedImage
.
TYPE_INT_ARGB
_PRE
);
final
Graphics
g
=
image
.
getGraphics
();
g
.
drawImage
(
background
,
0
,
0
,
scaledAlertIconSize
,
scaledAlertIconSize
,
null
);
...
...
src/macosx/classes/com/apple/laf/AquaNativeResources.java
浏览文件 @
95184625
...
...
@@ -66,11 +66,12 @@ public class AquaNativeResources {
}
static
BufferedImage
getRadioButtonSizerImage
()
{
final
BufferedImage
img
=
new
BufferedImage
(
20
,
20
,
BufferedImage
.
TYPE_INT_ARGB
);
final
BufferedImage
img
=
new
BufferedImage
(
20
,
20
,
BufferedImage
.
TYPE_INT_ARGB
_PRE
);
Graphics
g
=
img
.
getGraphics
();
g
.
setColor
(
Color
.
pink
);
g
.
fillRect
(
0
,
0
,
20
,
20
);
g
.
dispose
();
return
img
;
}
...
...
src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
浏览文件 @
95184625
...
...
@@ -568,7 +568,10 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
CWrapper
.
NSWindow
.
makeKeyWindow
(
nsWindowPtr
);
}
}
else
{
// immediately hide the window
CWrapper
.
NSWindow
.
orderOut
(
nsWindowPtr
);
// process the close
CWrapper
.
NSWindow
.
close
(
nsWindowPtr
);
}
}
else
{
// otherwise, put it in a proper z-order
...
...
src/macosx/classes/sun/lwawt/macosx/CWrapper.java
浏览文件 @
95184625
...
...
@@ -54,8 +54,26 @@ final class CWrapper {
static
native
void
orderFront
(
long
window
);
static
native
void
orderFrontRegardless
(
long
window
);
static
native
void
orderWindow
(
long
window
,
int
ordered
,
long
relativeTo
);
/**
* Removes the window from the screen.
*
* @param window the pointer of the NSWindow
*/
static
native
void
orderOut
(
long
window
);
/**
* Removes the window from the screen and releases it. According to
* documentation this method should be similar to {@link #orderOut},
* because we use ReleasedWhenClosed:NO, so the window shouldn't be
* released. But the close method works differently, for example it
* close the space if the window was in the full screen via
* {@link CPlatformWindow#toggleFullScreen()}.
*
* @param window the pointer of the NSWindow
*/
static
native
void
close
(
long
window
);
static
native
void
addChildWindow
(
long
parent
,
long
child
,
int
ordered
);
static
native
void
removeChildWindow
(
long
parent
,
long
child
);
...
...
src/macosx/native/sun/awt/CWrapper.m
浏览文件 @
95184625
...
...
@@ -173,6 +173,23 @@ JNF_COCOA_ENTER(env);
JNF_COCOA_EXIT(env);
}
/*
* Class: sun_lwawt_macosx_CWrapper$NSWindow
* Method: close
* Signature: (J)V
*/
JNIEXPORT void JNICALL
Java_sun_lwawt_macosx_CWrapper_00024NSWindow_close
(JNIEnv *env, jclass cls, jlong windowPtr)
{
JNF_COCOA_ENTER(env);
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){
[window close];
}];
JNF_COCOA_EXIT(env);
}
/*
* Class: sun_lwawt_macosx_CWrapper$NSWindow
* Method: orderFrontRegardless
...
...
src/macosx/native/sun/java2d/opengl/CGLGraphicsConfig.m
浏览文件 @
95184625
...
...
@@ -72,7 +72,9 @@ OGLGC_DestroyOGLGraphicsConfig(jlong pConfigInfo)
}
[
pool
drain
];
free
(
ctxinfo
);
oglc
->
ctxInfo
=
NULL
;
}
cglinfo
->
context
=
NULL
;
}
free
(
cglinfo
);
...
...
src/macosx/native/sun/java2d/opengl/CGLSurfaceData.m
浏览文件 @
95184625
...
...
@@ -187,6 +187,11 @@ OGLSD_SetScratchSurface(JNIEnv *env, jlong pConfigInfo)
}
OGLContext *oglc = cglInfo->context;
if (oglc == NULL) {
J2dRlsTraceLn(J2D_TRACE_ERROR, "OGLSD_SetScratchContext: ogl context is null");
return NULL;
}
CGLCtxInfo *ctxinfo = (CGLCtxInfo *)oglc->ctxInfo;
JNF_COCOA_ENTER(env);
...
...
src/share/classes/java/awt/datatransfer/SystemFlavorMap.java
浏览文件 @
95184625
此差异已折叠。
点击以展开。
src/share/classes/java/beans/Introspector.java
浏览文件 @
95184625
/*
* Copyright (c) 1996, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 201
4
, 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
...
...
@@ -729,27 +729,53 @@ public class Introspector {
if
(
igpd
!=
null
&&
ispd
!=
null
)
{
// Complete indexed properties set
// Merge any classic property descriptors
if
(
gpd
!=
null
)
{
PropertyDescriptor
tpd
=
mergePropertyDescriptor
(
igpd
,
gpd
);
if
(
tpd
instanceof
IndexedPropertyDescriptor
)
{
igpd
=
(
IndexedPropertyDescriptor
)
tpd
;
}
}
if
(
spd
!=
null
)
{
PropertyDescriptor
tpd
=
mergePropertyDescriptor
(
ispd
,
spd
);
if
(
tpd
instanceof
IndexedPropertyDescriptor
)
{
ispd
=
(
IndexedPropertyDescriptor
)
tpd
;
}
if
((
gpd
==
spd
)
||
(
gpd
==
null
))
{
pd
=
spd
;
}
else
if
(
spd
==
null
)
{
pd
=
gpd
;
}
else
if
(
spd
instanceof
IndexedPropertyDescriptor
)
{
pd
=
mergePropertyWithIndexedProperty
(
gpd
,
(
IndexedPropertyDescriptor
)
spd
);
}
else
if
(
gpd
instanceof
IndexedPropertyDescriptor
)
{
pd
=
mergePropertyWithIndexedProperty
(
spd
,
(
IndexedPropertyDescriptor
)
gpd
);
}
else
{
pd
=
mergePropertyDescriptor
(
gpd
,
spd
);
}
if
(
igpd
==
ispd
)
{
pd
=
igpd
;
i
pd
=
igpd
;
}
else
{
pd
=
mergePropertyDescriptor
(
igpd
,
ispd
);
ipd
=
mergePropertyDescriptor
(
igpd
,
ispd
);
}
if
(
pd
==
null
)
{
pd
=
ipd
;
}
else
{
Class
<?>
propType
=
pd
.
getPropertyType
();
Class
<?>
ipropType
=
ipd
.
getIndexedPropertyType
();
if
(
propType
.
isArray
()
&&
propType
.
getComponentType
()
==
ipropType
)
{
pd
=
pd
.
getClass0
().
isAssignableFrom
(
ipd
.
getClass0
())
?
new
IndexedPropertyDescriptor
(
pd
,
ipd
)
:
new
IndexedPropertyDescriptor
(
ipd
,
pd
);
}
else
if
(
pd
.
getClass0
().
isAssignableFrom
(
ipd
.
getClass0
()))
{
pd
=
pd
.
getClass0
().
isAssignableFrom
(
ipd
.
getClass0
())
?
new
PropertyDescriptor
(
pd
,
ipd
)
:
new
PropertyDescriptor
(
ipd
,
pd
);
}
else
{
pd
=
ipd
;
}
}
}
else
if
(
gpd
!=
null
&&
spd
!=
null
)
{
if
(
igpd
!=
null
)
{
gpd
=
mergePropertyWithIndexedProperty
(
gpd
,
igpd
);
}
if
(
ispd
!=
null
)
{
spd
=
mergePropertyWithIndexedProperty
(
spd
,
ispd
);
}
// Complete simple properties set
if
(
gpd
==
spd
)
{
pd
=
gpd
;
}
else
if
(
spd
instanceof
IndexedPropertyDescriptor
)
{
pd
=
mergePropertyWithIndexedProperty
(
gpd
,
(
IndexedPropertyDescriptor
)
spd
);
}
else
if
(
gpd
instanceof
IndexedPropertyDescriptor
)
{
pd
=
mergePropertyWithIndexedProperty
(
spd
,
(
IndexedPropertyDescriptor
)
gpd
);
}
else
{
pd
=
mergePropertyDescriptor
(
gpd
,
spd
);
}
...
...
@@ -809,6 +835,16 @@ public class Introspector {
return
((
current
==
null
)
||
(
candidate
==
null
))
?
current
==
candidate
:
current
.
isAssignableFrom
(
candidate
);
}
private
PropertyDescriptor
mergePropertyWithIndexedProperty
(
PropertyDescriptor
pd
,
IndexedPropertyDescriptor
ipd
)
{
Class
<?>
type
=
pd
.
getPropertyType
();
if
(
type
.
isArray
()
&&
(
type
.
getComponentType
()
==
ipd
.
getIndexedPropertyType
()))
{
return
pd
.
getClass0
().
isAssignableFrom
(
ipd
.
getClass0
())
?
new
IndexedPropertyDescriptor
(
pd
,
ipd
)
:
new
IndexedPropertyDescriptor
(
ipd
,
pd
);
}
return
pd
;
}
/**
* Adds the property descriptor to the indexedproperty descriptor only if the
* types are the same.
...
...
@@ -828,6 +864,12 @@ public class Introspector {
}
else
{
result
=
new
IndexedPropertyDescriptor
(
ipd
,
pd
);
}
}
else
if
((
ipd
.
getReadMethod
()
==
null
)
&&
(
ipd
.
getWriteMethod
()
==
null
))
{
if
(
pd
.
getClass0
().
isAssignableFrom
(
ipd
.
getClass0
()))
{
result
=
new
PropertyDescriptor
(
pd
,
ipd
);
}
else
{
result
=
new
PropertyDescriptor
(
ipd
,
pd
);
}
}
else
{
// Cannot merge the pd because of type mismatch
// Return the most specific pd
...
...
@@ -879,7 +921,7 @@ public class Introspector {
}
// Handle regular ipd merge
private
PropertyDescriptor
mergePropertyDescriptor
(
IndexedPropertyDescriptor
ipd1
,
private
Indexed
PropertyDescriptor
mergePropertyDescriptor
(
IndexedPropertyDescriptor
ipd1
,
IndexedPropertyDescriptor
ipd2
)
{
if
(
ipd1
.
getClass0
().
isAssignableFrom
(
ipd2
.
getClass0
()))
{
return
new
IndexedPropertyDescriptor
(
ipd1
,
ipd2
);
...
...
src/share/classes/java/lang/invoke/DelegatingMethodHandle.java
浏览文件 @
95184625
...
...
@@ -44,6 +44,10 @@ abstract class DelegatingMethodHandle extends MethodHandle {
super
(
type
,
chooseDelegatingForm
(
target
));
}
protected
DelegatingMethodHandle
(
MethodType
type
,
LambdaForm
form
)
{
super
(
type
,
form
);
}
/** Define this to extract the delegated target which supplies the invocation behavior. */
abstract
protected
MethodHandle
getTarget
();
...
...
@@ -88,14 +92,31 @@ abstract class DelegatingMethodHandle extends MethodHandle {
return
makeReinvokerForm
(
target
,
MethodTypeForm
.
LF_DELEGATE
,
DelegatingMethodHandle
.
class
,
NF_getTarget
);
}
/** Create a LF which simply reinvokes a target of the given basic type. */
static
LambdaForm
makeReinvokerForm
(
MethodHandle
target
,
int
whichCache
,
Object
constraint
,
NamedFunction
getTargetFn
)
{
String
debugString
;
switch
(
whichCache
)
{
case
MethodTypeForm
.
LF_REBIND
:
debugString
=
"BMH.reinvoke"
;
break
;
case
MethodTypeForm
.
LF_DELEGATE
:
debugString
=
"MH.delegate"
;
break
;
default
:
debugString
=
"MH.reinvoke"
;
break
;
}
// No pre-action needed.
return
makeReinvokerForm
(
target
,
whichCache
,
constraint
,
debugString
,
true
,
getTargetFn
,
null
);
}
/** Create a LF which simply reinvokes a target of the given basic type. */
static
LambdaForm
makeReinvokerForm
(
MethodHandle
target
,
int
whichCache
,
Object
constraint
,
String
debugString
,
boolean
forceInline
,
NamedFunction
getTargetFn
,
NamedFunction
preActionFn
)
{
MethodType
mtype
=
target
.
type
().
basicType
();
boolean
customized
=
(
whichCache
<
0
||
mtype
.
parameterSlotCount
()
>
MethodType
.
MAX_MH_INVOKER_ARITY
);
boolean
hasPreAction
=
(
preActionFn
!=
null
);
LambdaForm
form
;
if
(!
customized
)
{
form
=
mtype
.
form
().
cachedLambdaForm
(
whichCache
);
...
...
@@ -105,12 +126,16 @@ abstract class DelegatingMethodHandle extends MethodHandle {
final
int
ARG_BASE
=
1
;
final
int
ARG_LIMIT
=
ARG_BASE
+
mtype
.
parameterCount
();
int
nameCursor
=
ARG_LIMIT
;
final
int
PRE_ACTION
=
hasPreAction
?
nameCursor
++
:
-
1
;
final
int
NEXT_MH
=
customized
?
-
1
:
nameCursor
++;
final
int
REINVOKE
=
nameCursor
++;
LambdaForm
.
Name
[]
names
=
LambdaForm
.
arguments
(
nameCursor
-
ARG_LIMIT
,
mtype
.
invokerType
());
assert
(
names
.
length
==
nameCursor
);
names
[
THIS_DMH
]
=
names
[
THIS_DMH
].
withConstraint
(
constraint
);
Object
[]
targetArgs
;
if
(
hasPreAction
)
{
names
[
PRE_ACTION
]
=
new
LambdaForm
.
Name
(
preActionFn
,
names
[
THIS_DMH
]);
}
if
(
customized
)
{
targetArgs
=
Arrays
.
copyOfRange
(
names
,
ARG_BASE
,
ARG_LIMIT
,
Object
[].
class
);
names
[
REINVOKE
]
=
new
LambdaForm
.
Name
(
target
,
targetArgs
);
// the invoker is the target itself
...
...
@@ -120,20 +145,14 @@ abstract class DelegatingMethodHandle extends MethodHandle {
targetArgs
[
0
]
=
names
[
NEXT_MH
];
// overwrite this MH with next MH
names
[
REINVOKE
]
=
new
LambdaForm
.
Name
(
mtype
,
targetArgs
);
}
String
debugString
;
switch
(
whichCache
)
{
case
MethodTypeForm
.
LF_REBIND
:
debugString
=
"BMH.reinvoke"
;
break
;
case
MethodTypeForm
.
LF_DELEGATE
:
debugString
=
"MH.delegate"
;
break
;
default
:
debugString
=
"MH.reinvoke"
;
break
;
}
form
=
new
LambdaForm
(
debugString
,
ARG_LIMIT
,
names
);
form
=
new
LambdaForm
(
debugString
,
ARG_LIMIT
,
names
,
forceInline
);
if
(!
customized
)
{
form
=
mtype
.
form
().
setCachedLambdaForm
(
whichCache
,
form
);
}
return
form
;
}
private
static
final
NamedFunction
NF_getTarget
;
static
final
NamedFunction
NF_getTarget
;
static
{
try
{
NF_getTarget
=
new
NamedFunction
(
DelegatingMethodHandle
.
class
...
...
src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java
浏览文件 @
95184625
...
...
@@ -628,8 +628,13 @@ class InvokerBytecodeGenerator {
// Mark this method as a compiled LambdaForm
mv
.
visitAnnotation
(
"Ljava/lang/invoke/LambdaForm$Compiled;"
,
true
);
// Force inlining of this invoker method.
mv
.
visitAnnotation
(
"Ljava/lang/invoke/ForceInline;"
,
true
);
if
(
lambdaForm
.
forceInline
)
{
// Force inlining of this invoker method.
mv
.
visitAnnotation
(
"Ljava/lang/invoke/ForceInline;"
,
true
);
}
else
{
mv
.
visitAnnotation
(
"Ljava/lang/invoke/DontInline;"
,
true
);
}
// iterate over the form's names, generating bytecode instructions for each
// start iterating at the first name following the arguments
...
...
src/share/classes/java/lang/invoke/LambdaForm.java
浏览文件 @
95184625
...
...
@@ -119,6 +119,7 @@ import static java.lang.invoke.MethodHandleNatives.Constants.*;
class
LambdaForm
{
final
int
arity
;
final
int
result
;
final
boolean
forceInline
;
@Stable
final
Name
[]
names
;
final
String
debugName
;
MemberName
vmentry
;
// low-level behavior, or null if not yet prepared
...
...
@@ -243,11 +244,16 @@ class LambdaForm {
LambdaForm
(
String
debugName
,
int
arity
,
Name
[]
names
,
int
result
)
{
this
(
debugName
,
arity
,
names
,
result
,
true
);
}
LambdaForm
(
String
debugName
,
int
arity
,
Name
[]
names
,
int
result
,
boolean
forceInline
)
{
assert
(
namesOK
(
arity
,
names
));
this
.
arity
=
arity
;
this
.
result
=
fixResult
(
result
,
names
);
this
.
names
=
names
.
clone
();
this
.
debugName
=
fixDebugName
(
debugName
);
this
.
forceInline
=
forceInline
;
int
maxOutArity
=
normalize
();
if
(
maxOutArity
>
MethodType
.
MAX_MH_INVOKER_ARITY
)
{
// Cannot use LF interpreter on very high arity expressions.
...
...
@@ -255,17 +261,23 @@ class LambdaForm {
compileToBytecode
();
}
}
LambdaForm
(
String
debugName
,
int
arity
,
Name
[]
names
)
{
this
(
debugName
,
arity
,
names
,
LAST_RESULT
);
this
(
debugName
,
arity
,
names
,
LAST_RESULT
,
true
);
}
LambdaForm
(
String
debugName
,
int
arity
,
Name
[]
names
,
boolean
forceInline
)
{
this
(
debugName
,
arity
,
names
,
LAST_RESULT
,
forceInline
);
}
LambdaForm
(
String
debugName
,
Name
[]
formals
,
Name
[]
temps
,
Name
result
)
{
this
(
debugName
,
formals
.
length
,
buildNames
(
formals
,
temps
,
result
),
LAST_RESULT
);
formals
.
length
,
buildNames
(
formals
,
temps
,
result
),
LAST_RESULT
,
true
);
}
LambdaForm
(
String
debugName
,
Name
[]
formals
,
Name
[]
temps
,
Name
result
,
boolean
forceInline
)
{
this
(
debugName
,
formals
.
length
,
buildNames
(
formals
,
temps
,
result
),
LAST_RESULT
,
forceInline
);
}
private
static
Name
[]
buildNames
(
Name
[]
formals
,
Name
[]
temps
,
Name
result
)
{
...
...
@@ -279,6 +291,10 @@ class LambdaForm {
}
private
LambdaForm
(
String
sig
)
{
this
(
sig
,
true
);
}
private
LambdaForm
(
String
sig
,
boolean
forceInline
)
{
// Make a blank lambda form, which returns a constant zero or null.
// It is used as a template for managing the invocation of similar forms that are non-empty.
// Called only from getPreparedForm.
...
...
@@ -287,6 +303,7 @@ class LambdaForm {
this
.
result
=
(
signatureReturn
(
sig
)
==
V_TYPE
?
-
1
:
arity
);
this
.
names
=
buildEmptyNames
(
arity
,
sig
);
this
.
debugName
=
"LF.zero"
;
this
.
forceInline
=
forceInline
;
assert
(
nameRefsAreLegal
());
assert
(
isEmpty
());
assert
(
sig
.
equals
(
basicTypeSignature
()))
:
sig
+
" != "
+
basicTypeSignature
();
...
...
src/share/classes/java/lang/invoke/MethodHandle.java
浏览文件 @
95184625
...
...
@@ -867,15 +867,11 @@ assertEquals("[A, B, C]", (String) caToString2.invokeExact('A', "BC".toCharArray
MethodType
postSpreadType
=
asSpreaderChecks
(
arrayType
,
arrayLength
);
int
arity
=
type
().
parameterCount
();
int
spreadArgPos
=
arity
-
arrayLength
;
if
(
USE_LAMBDA_FORM_EDITOR
)
{
MethodHandle
afterSpread
=
this
.
asType
(
postSpreadType
);
BoundMethodHandle
mh
=
afterSpread
.
rebind
();
LambdaForm
lform
=
mh
.
editor
().
spreadArgumentsForm
(
1
+
spreadArgPos
,
arrayType
,
arrayLength
);
MethodType
preSpreadType
=
postSpreadType
.
replaceParameterTypes
(
spreadArgPos
,
arity
,
arrayType
);
return
mh
.
copyWith
(
preSpreadType
,
lform
);
}
else
{
return
MethodHandleImpl
.
makeSpreadArguments
(
this
,
arrayType
,
spreadArgPos
,
arrayLength
);
}
MethodHandle
afterSpread
=
this
.
asType
(
postSpreadType
);
BoundMethodHandle
mh
=
afterSpread
.
rebind
();
LambdaForm
lform
=
mh
.
editor
().
spreadArgumentsForm
(
1
+
spreadArgPos
,
arrayType
,
arrayLength
);
MethodType
preSpreadType
=
postSpreadType
.
replaceParameterTypes
(
spreadArgPos
,
arity
,
arrayType
);
return
mh
.
copyWith
(
preSpreadType
,
lform
);
}
/**
...
...
@@ -996,23 +992,15 @@ assertEquals("[123]", (String) longsToString.invokeExact((long)123));
public
MethodHandle
asCollector
(
Class
<?>
arrayType
,
int
arrayLength
)
{
asCollectorChecks
(
arrayType
,
arrayLength
);
int
collectArgPos
=
type
().
parameterCount
()
-
1
;
if
(
USE_LAMBDA_FORM_EDITOR
)
{
BoundMethodHandle
mh
=
rebind
();
MethodType
resultType
=
type
().
asCollectorType
(
arrayType
,
arrayLength
);
MethodHandle
newArray
=
MethodHandleImpl
.
varargsArray
(
arrayType
,
arrayLength
);
LambdaForm
lform
=
mh
.
editor
().
collectArgumentArrayForm
(
1
+
collectArgPos
,
newArray
);
if
(
lform
!=
null
)
{
return
mh
.
copyWith
(
resultType
,
lform
);
}
lform
=
mh
.
editor
().
collectArgumentsForm
(
1
+
collectArgPos
,
newArray
.
type
().
basicType
());
return
mh
.
copyWithExtendL
(
resultType
,
lform
,
newArray
);
}
else
{
MethodHandle
target
=
this
;
if
(
arrayType
!=
type
().
parameterType
(
collectArgPos
))
target
=
MethodHandleImpl
.
makePairwiseConvert
(
this
,
type
().
changeParameterType
(
collectArgPos
,
arrayType
),
true
);
MethodHandle
collector
=
MethodHandleImpl
.
varargsArray
(
arrayType
,
arrayLength
);
return
MethodHandles
.
collectArguments
(
target
,
collectArgPos
,
collector
);
BoundMethodHandle
mh
=
rebind
();
MethodType
resultType
=
type
().
asCollectorType
(
arrayType
,
arrayLength
);
MethodHandle
newArray
=
MethodHandleImpl
.
varargsArray
(
arrayType
,
arrayLength
);
LambdaForm
lform
=
mh
.
editor
().
collectArgumentArrayForm
(
1
+
collectArgPos
,
newArray
);
if
(
lform
!=
null
)
{
return
mh
.
copyWith
(
resultType
,
lform
);
}
lform
=
mh
.
editor
().
collectArgumentsForm
(
1
+
collectArgPos
,
newArray
.
type
().
basicType
());
return
mh
.
copyWithExtendL
(
resultType
,
lform
,
newArray
);
}
/**
...
...
@@ -1438,10 +1426,9 @@ assertEquals("[three, thee, tee]", asListFix.invoke((Object)argv).toString());
/*non-public*/
void
updateForm
(
LambdaForm
newForm
)
{
if
(
form
==
newForm
)
return
;
assert
(
this
instanceof
DirectMethodHandle
&&
this
.
internalMemberName
().
isStatic
());
// ISSUE: Should we have a memory fence here?
newForm
.
prepare
();
// as in MethodHandle.<init>
UNSAFE
.
putObject
(
this
,
FORM_OFFSET
,
newForm
);
this
.
form
.
prepare
();
// as in MethodHandle.<init>
UNSAFE
.
fullFence
();
}
private
static
final
long
FORM_OFFSET
;
...
...
src/share/classes/java/lang/invoke/MethodHandleImpl.java
浏览文件 @
95184625
...
...
@@ -30,6 +30,7 @@ import java.security.PrivilegedAction;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.function.Function
;
import
sun.invoke.empty.Empty
;
import
sun.invoke.util.ValueConversions
;
...
...
@@ -190,11 +191,7 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
MethodType
dstType
=
target
.
type
();
if
(
srcType
==
dstType
)
return
target
;
if
(
USE_LAMBDA_FORM_EDITOR
)
{
return
makePairwiseConvertByEditor
(
target
,
srcType
,
strict
,
monobox
);
}
else
{
return
makePairwiseConvertIndirect
(
target
,
srcType
,
strict
,
monobox
);
}
return
makePairwiseConvertByEditor
(
target
,
srcType
,
strict
,
monobox
);
}
private
static
int
countNonNull
(
Object
[]
array
)
{
...
...
@@ -713,10 +710,11 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
LambdaForm
form
=
makeGuardWithTestForm
(
basicType
);
BoundMethodHandle
.
SpeciesData
data
=
BoundMethodHandle
.
speciesData_LLL
();
BoundMethodHandle
mh
;
try
{
mh
=
(
BoundMethodHandle
)
data
.
constructor
().
invokeBasic
(
type
,
form
,
(
Object
)
test
,
(
Object
)
target
,
(
Object
)
fallback
);
(
Object
)
test
,
(
Object
)
profile
(
target
),
(
Object
)
profile
(
fallback
)
);
}
catch
(
Throwable
ex
)
{
throw
uncaughtException
(
ex
);
}
...
...
@@ -724,6 +722,129 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
return
mh
;
}
static
MethodHandle
profile
(
MethodHandle
target
)
{
if
(
DONT_INLINE_THRESHOLD
>=
0
)
{
return
makeBlockInlningWrapper
(
target
);
}
else
{
return
target
;
}
}
/**
* Block inlining during JIT-compilation of a target method handle if it hasn't been invoked enough times.
* Corresponding LambdaForm has @DontInline when compiled into bytecode.
*/
static
MethodHandle
makeBlockInlningWrapper
(
MethodHandle
target
)
{
LambdaForm
lform
=
PRODUCE_BLOCK_INLINING_FORM
.
apply
(
target
);
return
new
CountingWrapper
(
target
,
lform
,
PRODUCE_BLOCK_INLINING_FORM
,
PRODUCE_REINVOKER_FORM
,
DONT_INLINE_THRESHOLD
);
}
/** Constructs reinvoker lambda form which block inlining during JIT-compilation for a particular method handle */
private
static
final
Function
<
MethodHandle
,
LambdaForm
>
PRODUCE_BLOCK_INLINING_FORM
=
new
Function
<
MethodHandle
,
LambdaForm
>()
{
@Override
public
LambdaForm
apply
(
MethodHandle
target
)
{
return
DelegatingMethodHandle
.
makeReinvokerForm
(
target
,
MethodTypeForm
.
LF_DELEGATE_BLOCK_INLINING
,
CountingWrapper
.
class
,
"reinvoker.dontInline"
,
false
,
DelegatingMethodHandle
.
NF_getTarget
,
CountingWrapper
.
NF_maybeStopCounting
);
}
};
/** Constructs simple reinvoker lambda form for a particular method handle */
private
static
final
Function
<
MethodHandle
,
LambdaForm
>
PRODUCE_REINVOKER_FORM
=
new
Function
<
MethodHandle
,
LambdaForm
>()
{
@Override
public
LambdaForm
apply
(
MethodHandle
target
)
{
return
DelegatingMethodHandle
.
makeReinvokerForm
(
target
,
MethodTypeForm
.
LF_DELEGATE
,
DelegatingMethodHandle
.
class
,
DelegatingMethodHandle
.
NF_getTarget
);
}
};
/**
* Counting method handle. It has 2 states: counting and non-counting.
* It is in counting state for the first n invocations and then transitions to non-counting state.
* Behavior in counting and non-counting states is determined by lambda forms produced by
* countingFormProducer & nonCountingFormProducer respectively.
*/
static
class
CountingWrapper
extends
DelegatingMethodHandle
{
private
final
MethodHandle
target
;
private
int
count
;
private
Function
<
MethodHandle
,
LambdaForm
>
countingFormProducer
;
private
Function
<
MethodHandle
,
LambdaForm
>
nonCountingFormProducer
;
private
volatile
boolean
isCounting
;
private
CountingWrapper
(
MethodHandle
target
,
LambdaForm
lform
,
Function
<
MethodHandle
,
LambdaForm
>
countingFromProducer
,
Function
<
MethodHandle
,
LambdaForm
>
nonCountingFormProducer
,
int
count
)
{
super
(
target
.
type
(),
lform
);
this
.
target
=
target
;
this
.
count
=
count
;
this
.
countingFormProducer
=
countingFromProducer
;
this
.
nonCountingFormProducer
=
nonCountingFormProducer
;
this
.
isCounting
=
(
count
>
0
);
}
@Hidden
@Override
protected
MethodHandle
getTarget
()
{
return
target
;
}
@Override
public
MethodHandle
asTypeUncached
(
MethodType
newType
)
{
MethodHandle
newTarget
=
target
.
asType
(
newType
);
MethodHandle
wrapper
;
if
(
isCounting
)
{
LambdaForm
lform
;
lform
=
countingFormProducer
.
apply
(
target
);
wrapper
=
new
CountingWrapper
(
newTarget
,
lform
,
countingFormProducer
,
nonCountingFormProducer
,
DONT_INLINE_THRESHOLD
);
}
else
{
wrapper
=
newTarget
;
// no need for a counting wrapper anymore
}
return
(
asTypeCache
=
wrapper
);
}
boolean
countDown
()
{
if
(
count
<=
0
)
{
// Try to limit number of updates. MethodHandle.updateForm() doesn't guarantee LF update visibility.
if
(
isCounting
)
{
isCounting
=
false
;
return
true
;
}
else
{
return
false
;
}
}
else
{
--
count
;
return
false
;
}
}
@Hidden
static
void
maybeStopCounting
(
Object
o1
)
{
CountingWrapper
wrapper
=
(
CountingWrapper
)
o1
;
if
(
wrapper
.
countDown
())
{
// Reached invocation threshold. Replace counting behavior with a non-counting one.
LambdaForm
lform
=
wrapper
.
nonCountingFormProducer
.
apply
(
wrapper
.
target
);
lform
.
compileToBytecode
();
// speed up warmup by avoiding LF interpretation again after transition
wrapper
.
updateForm
(
lform
);
}
}
static
final
NamedFunction
NF_maybeStopCounting
;
static
{
Class
<?>
THIS_CLASS
=
CountingWrapper
.
class
;
try
{
NF_maybeStopCounting
=
new
NamedFunction
(
THIS_CLASS
.
getDeclaredMethod
(
"maybeStopCounting"
,
Object
.
class
));
}
catch
(
ReflectiveOperationException
ex
)
{
throw
newInternalError
(
ex
);
}
}
}
static
LambdaForm
makeGuardWithTestForm
(
MethodType
basicType
)
{
LambdaForm
lform
=
basicType
.
form
().
cachedLambdaForm
(
MethodTypeForm
.
LF_GWT
);
...
...
src/share/classes/java/lang/invoke/MethodHandleStatics.java
浏览文件 @
95184625
...
...
@@ -45,20 +45,20 @@ import sun.misc.Unsafe;
static
final
boolean
DUMP_CLASS_FILES
;
static
final
boolean
TRACE_INTERPRETER
;
static
final
boolean
TRACE_METHOD_LINKAGE
;
static
final
boolean
USE_LAMBDA_FORM_EDITOR
;
static
final
int
COMPILE_THRESHOLD
;
static
final
int
DONT_INLINE_THRESHOLD
;
static
final
int
PROFILE_LEVEL
;
static
{
final
Object
[]
values
=
{
false
,
false
,
false
,
false
,
false
,
null
,
null
}
;
final
Object
[]
values
=
new
Object
[
7
]
;
AccessController
.
doPrivileged
(
new
PrivilegedAction
<
Void
>()
{
public
Void
run
()
{
values
[
0
]
=
Boolean
.
getBoolean
(
"java.lang.invoke.MethodHandle.DEBUG_NAMES"
);
values
[
1
]
=
Boolean
.
getBoolean
(
"java.lang.invoke.MethodHandle.DUMP_CLASS_FILES"
);
values
[
2
]
=
Boolean
.
getBoolean
(
"java.lang.invoke.MethodHandle.TRACE_INTERPRETER"
);
values
[
3
]
=
Boolean
.
getBoolean
(
"java.lang.invoke.MethodHandle.TRACE_METHOD_LINKAGE"
);
values
[
4
]
=
Boolean
.
getBoolean
(
"java.lang.invoke.MethodHandle.USE_LF_EDITOR"
);
values
[
5
]
=
Integer
.
getInteger
(
"java.lang.invoke.MethodHandle.
COMPIL
E_THRESHOLD"
,
30
);
values
[
4
]
=
Integer
.
getInteger
(
"java.lang.invoke.MethodHandle.COMPILE_THRESHOLD"
,
0
);
values
[
5
]
=
Integer
.
getInteger
(
"java.lang.invoke.MethodHandle.
DONT_INLIN
E_THRESHOLD"
,
30
);
values
[
6
]
=
Integer
.
getInteger
(
"java.lang.invoke.MethodHandle.PROFILE_LEVEL"
,
0
);
return
null
;
}
...
...
@@ -67,8 +67,8 @@ import sun.misc.Unsafe;
DUMP_CLASS_FILES
=
(
Boolean
)
values
[
1
];
TRACE_INTERPRETER
=
(
Boolean
)
values
[
2
];
TRACE_METHOD_LINKAGE
=
(
Boolean
)
values
[
3
];
USE_LAMBDA_FORM_EDITOR
=
(
Boolean
)
values
[
4
];
COMPILE_THRESHOLD
=
(
Integer
)
values
[
5
];
COMPILE_THRESHOLD
=
(
Integer
)
values
[
4
];
DONT_INLINE_THRESHOLD
=
(
Integer
)
values
[
5
];
PROFILE_LEVEL
=
(
Integer
)
values
[
6
];
}
...
...
src/share/classes/java/lang/invoke/MethodHandles.java
浏览文件 @
95184625
...
...
@@ -2104,115 +2104,65 @@ assert((int)twice.invokeExact(21) == 42);
reorder
=
reorder
.
clone
();
// get a private copy
MethodType
oldType
=
target
.
type
();
permuteArgumentChecks
(
reorder
,
newType
,
oldType
);
if
(
USE_LAMBDA_FORM_EDITOR
)
{
// first detect dropped arguments and handle them separately
int
[]
originalReorder
=
reorder
;
BoundMethodHandle
result
=
target
.
rebind
();
LambdaForm
form
=
result
.
form
;
int
newArity
=
newType
.
parameterCount
();
// Normalize the reordering into a real permutation,
// by removing duplicates and adding dropped elements.
// This somewhat improves lambda form caching, as well
// as simplifying the transform by breaking it up into steps.
for
(
int
ddIdx
;
(
ddIdx
=
findFirstDupOrDrop
(
reorder
,
newArity
))
!=
0
;
)
{
if
(
ddIdx
>
0
)
{
// We found a duplicated entry at reorder[ddIdx].
// Example: (x,y,z)->asList(x,y,z)
// permuted by [1*,0,1] => (a0,a1)=>asList(a1,a0,a1)
// permuted by [0,1,0*] => (a0,a1)=>asList(a0,a1,a0)
// The starred element corresponds to the argument
// deleted by the dupArgumentForm transform.
int
srcPos
=
ddIdx
,
dstPos
=
srcPos
,
dupVal
=
reorder
[
srcPos
];
boolean
killFirst
=
false
;
for
(
int
val
;
(
val
=
reorder
[--
dstPos
])
!=
dupVal
;
)
{
// Set killFirst if the dup is larger than an intervening position.
// This will remove at least one inversion from the permutation.
if
(
dupVal
>
val
)
killFirst
=
true
;
}
if
(!
killFirst
)
{
srcPos
=
dstPos
;
dstPos
=
ddIdx
;
}
form
=
form
.
editor
().
dupArgumentForm
(
1
+
srcPos
,
1
+
dstPos
);
assert
(
reorder
[
srcPos
]
==
reorder
[
dstPos
]);
oldType
=
oldType
.
dropParameterTypes
(
dstPos
,
dstPos
+
1
);
// contract the reordering by removing the element at dstPos
int
tailPos
=
dstPos
+
1
;
System
.
arraycopy
(
reorder
,
tailPos
,
reorder
,
dstPos
,
reorder
.
length
-
tailPos
);
reorder
=
Arrays
.
copyOf
(
reorder
,
reorder
.
length
-
1
);
}
else
{
int
dropVal
=
~
ddIdx
,
insPos
=
0
;
while
(
insPos
<
reorder
.
length
&&
reorder
[
insPos
]
<
dropVal
)
{
// Find first element of reorder larger than dropVal.
// This is where we will insert the dropVal.
insPos
+=
1
;
}
Class
<?>
ptype
=
newType
.
parameterType
(
dropVal
);
form
=
form
.
editor
().
addArgumentForm
(
1
+
insPos
,
BasicType
.
basicType
(
ptype
));
oldType
=
oldType
.
insertParameterTypes
(
insPos
,
ptype
);
// expand the reordering by inserting an element at insPos
int
tailPos
=
insPos
+
1
;
reorder
=
Arrays
.
copyOf
(
reorder
,
reorder
.
length
+
1
);
System
.
arraycopy
(
reorder
,
insPos
,
reorder
,
tailPos
,
reorder
.
length
-
tailPos
);
reorder
[
insPos
]
=
dropVal
;
// first detect dropped arguments and handle them separately
int
[]
originalReorder
=
reorder
;
BoundMethodHandle
result
=
target
.
rebind
();
LambdaForm
form
=
result
.
form
;
int
newArity
=
newType
.
parameterCount
();
// Normalize the reordering into a real permutation,
// by removing duplicates and adding dropped elements.
// This somewhat improves lambda form caching, as well
// as simplifying the transform by breaking it up into steps.
for
(
int
ddIdx
;
(
ddIdx
=
findFirstDupOrDrop
(
reorder
,
newArity
))
!=
0
;
)
{
if
(
ddIdx
>
0
)
{
// We found a duplicated entry at reorder[ddIdx].
// Example: (x,y,z)->asList(x,y,z)
// permuted by [1*,0,1] => (a0,a1)=>asList(a1,a0,a1)
// permuted by [0,1,0*] => (a0,a1)=>asList(a0,a1,a0)
// The starred element corresponds to the argument
// deleted by the dupArgumentForm transform.
int
srcPos
=
ddIdx
,
dstPos
=
srcPos
,
dupVal
=
reorder
[
srcPos
];
boolean
killFirst
=
false
;
for
(
int
val
;
(
val
=
reorder
[--
dstPos
])
!=
dupVal
;
)
{
// Set killFirst if the dup is larger than an intervening position.
// This will remove at least one inversion from the permutation.
if
(
dupVal
>
val
)
killFirst
=
true
;
}
assert
(
permuteArgumentChecks
(
reorder
,
newType
,
oldType
));
}
assert
(
reorder
.
length
==
newArity
);
// a perfect permutation
// Note: This may cache too many distinct LFs. Consider backing off to varargs code.
form
=
form
.
editor
().
permuteArgumentsForm
(
1
,
reorder
);
if
(
newType
==
result
.
type
()
&&
form
==
result
.
internalForm
())
return
result
;
return
result
.
copyWith
(
newType
,
form
);
}
else
{
// first detect dropped arguments and handle them separately
MethodHandle
originalTarget
=
target
;
int
newArity
=
newType
.
parameterCount
();
for
(
int
dropIdx
;
(
dropIdx
=
findFirstDrop
(
reorder
,
newArity
))
>=
0
;
)
{
// dropIdx is missing from reorder; add it in at the end
int
oldArity
=
reorder
.
length
;
target
=
dropArguments
(
target
,
oldArity
,
newType
.
parameterType
(
dropIdx
));
reorder
=
Arrays
.
copyOf
(
reorder
,
oldArity
+
1
);
reorder
[
oldArity
]
=
dropIdx
;
if
(!
killFirst
)
{
srcPos
=
dstPos
;
dstPos
=
ddIdx
;
}
form
=
form
.
editor
().
dupArgumentForm
(
1
+
srcPos
,
1
+
dstPos
);
assert
(
reorder
[
srcPos
]
==
reorder
[
dstPos
]);
oldType
=
oldType
.
dropParameterTypes
(
dstPos
,
dstPos
+
1
);
// contract the reordering by removing the element at dstPos
int
tailPos
=
dstPos
+
1
;
System
.
arraycopy
(
reorder
,
tailPos
,
reorder
,
dstPos
,
reorder
.
length
-
tailPos
);
reorder
=
Arrays
.
copyOf
(
reorder
,
reorder
.
length
-
1
);
}
else
{
int
dropVal
=
~
ddIdx
,
insPos
=
0
;
while
(
insPos
<
reorder
.
length
&&
reorder
[
insPos
]
<
dropVal
)
{
// Find first element of reorder larger than dropVal.
// This is where we will insert the dropVal.
insPos
+=
1
;
}
Class
<?>
ptype
=
newType
.
parameterType
(
dropVal
);
form
=
form
.
editor
().
addArgumentForm
(
1
+
insPos
,
BasicType
.
basicType
(
ptype
));
oldType
=
oldType
.
insertParameterTypes
(
insPos
,
ptype
);
// expand the reordering by inserting an element at insPos
int
tailPos
=
insPos
+
1
;
reorder
=
Arrays
.
copyOf
(
reorder
,
reorder
.
length
+
1
);
System
.
arraycopy
(
reorder
,
insPos
,
reorder
,
tailPos
,
reorder
.
length
-
tailPos
);
reorder
[
insPos
]
=
dropVal
;
}
assert
(
target
==
originalTarget
||
permuteArgumentChecks
(
reorder
,
newType
,
target
.
type
()));
// Note: This may cache too many distinct LFs. Consider backing off to varargs code.
BoundMethodHandle
result
=
target
.
rebind
();
LambdaForm
form
=
result
.
form
.
permuteArguments
(
1
,
reorder
,
basicTypes
(
newType
.
parameterList
()));
return
result
.
copyWith
(
newType
,
form
);
}
}
/** Return the first value in [0..newArity-1] that is not present in reorder. */
private
static
int
findFirstDrop
(
int
[]
reorder
,
int
newArity
)
{
final
int
BIT_LIMIT
=
63
;
// max number of bits in bit mask
if
(
newArity
<
BIT_LIMIT
)
{
long
mask
=
0
;
for
(
int
arg
:
reorder
)
{
assert
(
arg
<
newArity
);
mask
|=
(
1L
<<
arg
);
}
if
(
mask
==
(
1L
<<
newArity
)
-
1
)
{
assert
(
Long
.
numberOfTrailingZeros
(
Long
.
lowestOneBit
(~
mask
))
==
newArity
);
return
-
1
;
}
// find first zero
long
zeroBit
=
Long
.
lowestOneBit
(~
mask
);
int
zeroPos
=
Long
.
numberOfTrailingZeros
(
zeroBit
);
assert
(
zeroPos
<
newArity
);
return
zeroPos
;
}
else
{
BitSet
mask
=
new
BitSet
(
newArity
);
for
(
int
arg
:
reorder
)
{
assert
(
arg
<
newArity
);
mask
.
set
(
arg
);
}
int
zeroPos
=
mask
.
nextClearBit
(
0
);
assert
(
zeroPos
<=
newArity
);
if
(
zeroPos
==
newArity
)
return
-
1
;
return
zeroPos
;
assert
(
permuteArgumentChecks
(
reorder
,
newType
,
oldType
));
}
assert
(
reorder
.
length
==
newArity
);
// a perfect permutation
// Note: This may cache too many distinct LFs. Consider backing off to varargs code.
form
=
form
.
editor
().
permuteArgumentsForm
(
1
,
reorder
);
if
(
newType
==
result
.
type
()
&&
form
==
result
.
internalForm
())
return
result
;
return
result
.
copyWith
(
newType
,
form
);
}
/**
...
...
@@ -2503,13 +2453,9 @@ assertEquals("yz", (String) d0.invokeExact(123, "x", "y", "z"));
if
(
dropped
==
0
)
return
target
;
BoundMethodHandle
result
=
target
.
rebind
();
LambdaForm
lform
=
result
.
form
;
if
(
USE_LAMBDA_FORM_EDITOR
)
{
int
insertFormArg
=
1
+
pos
;
for
(
Class
<?>
ptype
:
valueTypes
)
{
lform
=
lform
.
editor
().
addArgumentForm
(
insertFormArg
++,
BasicType
.
basicType
(
ptype
));
}
}
else
{
lform
=
lform
.
addArguments
(
pos
,
valueTypes
);
int
insertFormArg
=
1
+
pos
;
for
(
Class
<?>
ptype
:
valueTypes
)
{
lform
=
lform
.
editor
().
addArgumentForm
(
insertFormArg
++,
BasicType
.
basicType
(
ptype
));
}
result
=
result
.
copyWith
(
newType
,
lform
);
return
result
;
...
...
@@ -2660,18 +2606,14 @@ assertEquals("XY", (String) f2.invokeExact("x", "y")); // XY
/*non-public*/
static
MethodHandle
filterArgument
(
MethodHandle
target
,
int
pos
,
MethodHandle
filter
)
{
filterArgumentChecks
(
target
,
pos
,
filter
);
if
(
USE_LAMBDA_FORM_EDITOR
)
{
MethodType
targetType
=
target
.
type
();
MethodType
filterType
=
filter
.
type
();
BoundMethodHandle
result
=
target
.
rebind
();
Class
<?>
newParamType
=
filterType
.
parameterType
(
0
);
LambdaForm
lform
=
result
.
editor
().
filterArgumentForm
(
1
+
pos
,
BasicType
.
basicType
(
newParamType
));
MethodType
newType
=
targetType
.
changeParameterType
(
pos
,
newParamType
);
result
=
result
.
copyWithExtendL
(
newType
,
lform
,
filter
);
return
result
;
}
else
{
return
MethodHandleImpl
.
makeCollectArguments
(
target
,
filter
,
pos
,
false
);
}
MethodType
targetType
=
target
.
type
();
MethodType
filterType
=
filter
.
type
();
BoundMethodHandle
result
=
target
.
rebind
();
Class
<?>
newParamType
=
filterType
.
parameterType
(
0
);
LambdaForm
lform
=
result
.
editor
().
filterArgumentForm
(
1
+
pos
,
BasicType
.
basicType
(
newParamType
));
MethodType
newType
=
targetType
.
changeParameterType
(
pos
,
newParamType
);
result
=
result
.
copyWithExtendL
(
newType
,
lform
,
filter
);
return
result
;
}
private
static
void
filterArgumentsCheckArity
(
MethodHandle
target
,
int
pos
,
MethodHandle
[]
filters
)
{
...
...
@@ -2798,21 +2740,17 @@ assertEquals("[top, [[up, down, strange], charm], bottom]",
public
static
MethodHandle
collectArguments
(
MethodHandle
target
,
int
pos
,
MethodHandle
filter
)
{
MethodType
newType
=
collectArgumentsChecks
(
target
,
pos
,
filter
);
if
(
USE_LAMBDA_FORM_EDITOR
)
{
MethodType
collectorType
=
filter
.
type
();
BoundMethodHandle
result
=
target
.
rebind
();
LambdaForm
lform
;
if
(
collectorType
.
returnType
().
isArray
()
&&
filter
.
intrinsicName
()
==
Intrinsic
.
NEW_ARRAY
)
{
lform
=
result
.
editor
().
collectArgumentArrayForm
(
1
+
pos
,
filter
);
if
(
lform
!=
null
)
{
return
result
.
copyWith
(
newType
,
lform
);
}
MethodType
collectorType
=
filter
.
type
();
BoundMethodHandle
result
=
target
.
rebind
();
LambdaForm
lform
;
if
(
collectorType
.
returnType
().
isArray
()
&&
filter
.
intrinsicName
()
==
Intrinsic
.
NEW_ARRAY
)
{
lform
=
result
.
editor
().
collectArgumentArrayForm
(
1
+
pos
,
filter
);
if
(
lform
!=
null
)
{
return
result
.
copyWith
(
newType
,
lform
);
}
lform
=
result
.
editor
().
collectArgumentsForm
(
1
+
pos
,
collectorType
.
basicType
());
return
result
.
copyWithExtendL
(
newType
,
lform
,
filter
);
}
else
{
return
MethodHandleImpl
.
makeCollectArguments
(
target
,
filter
,
pos
,
false
);
}
lform
=
result
.
editor
().
collectArgumentsForm
(
1
+
pos
,
collectorType
.
basicType
());
return
result
.
copyWithExtendL
(
newType
,
lform
,
filter
);
}
private
static
MethodType
collectArgumentsChecks
(
MethodHandle
target
,
int
pos
,
MethodHandle
filter
)
throws
RuntimeException
{
...
...
@@ -2891,16 +2829,12 @@ System.out.println((int) f0.invokeExact("x", "y")); // 2
MethodType
targetType
=
target
.
type
();
MethodType
filterType
=
filter
.
type
();
filterReturnValueChecks
(
targetType
,
filterType
);
if
(
USE_LAMBDA_FORM_EDITOR
)
{
BoundMethodHandle
result
=
target
.
rebind
();
BasicType
rtype
=
BasicType
.
basicType
(
filterType
.
returnType
());
LambdaForm
lform
=
result
.
editor
().
filterReturnForm
(
rtype
,
false
);
MethodType
newType
=
targetType
.
changeReturnType
(
filterType
.
returnType
());
result
=
result
.
copyWithExtendL
(
newType
,
lform
,
filter
);
return
result
;
}
else
{
return
MethodHandleImpl
.
makeCollectArguments
(
filter
,
target
,
0
,
false
);
}
BoundMethodHandle
result
=
target
.
rebind
();
BasicType
rtype
=
BasicType
.
basicType
(
filterType
.
returnType
());
LambdaForm
lform
=
result
.
editor
().
filterReturnForm
(
rtype
,
false
);
MethodType
newType
=
targetType
.
changeReturnType
(
filterType
.
returnType
());
result
=
result
.
copyWithExtendL
(
newType
,
lform
,
filter
);
return
result
;
}
private
static
void
filterReturnValueChecks
(
MethodType
targetType
,
MethodType
filterType
)
throws
RuntimeException
{
...
...
@@ -2994,19 +2928,15 @@ assertEquals("boojum", (String) catTrace.invokeExact("boo", "jum"));
MethodType
targetType
=
target
.
type
();
MethodType
combinerType
=
combiner
.
type
();
Class
<?>
rtype
=
foldArgumentChecks
(
foldPos
,
targetType
,
combinerType
);
if
(
USE_LAMBDA_FORM_EDITOR
)
{
BoundMethodHandle
result
=
target
.
rebind
();
boolean
dropResult
=
(
rtype
==
void
.
class
);
// Note: This may cache too many distinct LFs. Consider backing off to varargs code.
LambdaForm
lform
=
result
.
editor
().
foldArgumentsForm
(
1
+
foldPos
,
dropResult
,
combinerType
.
basicType
());
MethodType
newType
=
targetType
;
if
(!
dropResult
)
newType
=
newType
.
dropParameterTypes
(
foldPos
,
foldPos
+
1
);
result
=
result
.
copyWithExtendL
(
newType
,
lform
,
combiner
);
return
result
;
}
else
{
return
MethodHandleImpl
.
makeCollectArguments
(
target
,
combiner
,
foldPos
,
true
);
}
BoundMethodHandle
result
=
target
.
rebind
();
boolean
dropResult
=
(
rtype
==
void
.
class
);
// Note: This may cache too many distinct LFs. Consider backing off to varargs code.
LambdaForm
lform
=
result
.
editor
().
foldArgumentsForm
(
1
+
foldPos
,
dropResult
,
combinerType
.
basicType
());
MethodType
newType
=
targetType
;
if
(!
dropResult
)
newType
=
newType
.
dropParameterTypes
(
foldPos
,
foldPos
+
1
);
result
=
result
.
copyWithExtendL
(
newType
,
lform
,
combiner
);
return
result
;
}
private
static
Class
<?>
foldArgumentChecks
(
int
foldPos
,
MethodType
targetType
,
MethodType
combinerType
)
{
...
...
src/share/classes/java/lang/invoke/MethodTypeForm.java
浏览文件 @
95184625
...
...
@@ -63,24 +63,25 @@ final class MethodTypeForm {
final
@Stable
LambdaForm
[]
lambdaForms
;
// Indexes into lambdaForms:
static
final
int
LF_INVVIRTUAL
=
0
,
// DMH invokeVirtual
LF_INVSTATIC
=
1
,
LF_INVSPECIAL
=
2
,
LF_NEWINVSPECIAL
=
3
,
LF_INVINTERFACE
=
4
,
LF_INVSTATIC_INIT
=
5
,
// DMH invokeStatic with <clinit> barrier
LF_INTERPRET
=
6
,
// LF interpreter
LF_REBIND
=
7
,
// BoundMethodHandle
LF_DELEGATE
=
8
,
// DelegatingMethodHandle
LF_EX_LINKER
=
9
,
// invokeExact_MT (for invokehandle)
LF_EX_INVOKER
=
10
,
// MHs.invokeExact
LF_GEN_LINKER
=
11
,
// generic invoke_MT (for invokehandle)
LF_GEN_INVOKER
=
12
,
// generic MHs.invoke
LF_CS_LINKER
=
13
,
// linkToCallSite_CS
LF_MH_LINKER
=
14
,
// linkToCallSite_MH
LF_GWC
=
15
,
// guardWithCatch (catchException)
LF_GWT
=
16
,
// guardWithTest
LF_LIMIT
=
17
;
LF_INVVIRTUAL
=
0
,
// DMH invokeVirtual
LF_INVSTATIC
=
1
,
LF_INVSPECIAL
=
2
,
LF_NEWINVSPECIAL
=
3
,
LF_INVINTERFACE
=
4
,
LF_INVSTATIC_INIT
=
5
,
// DMH invokeStatic with <clinit> barrier
LF_INTERPRET
=
6
,
// LF interpreter
LF_REBIND
=
7
,
// BoundMethodHandle
LF_DELEGATE
=
8
,
// DelegatingMethodHandle
LF_DELEGATE_BLOCK_INLINING
=
9
,
// Counting DelegatingMethodHandle w/ @DontInline
LF_EX_LINKER
=
10
,
// invokeExact_MT (for invokehandle)
LF_EX_INVOKER
=
11
,
// MHs.invokeExact
LF_GEN_LINKER
=
12
,
// generic invoke_MT (for invokehandle)
LF_GEN_INVOKER
=
13
,
// generic MHs.invoke
LF_CS_LINKER
=
14
,
// linkToCallSite_CS
LF_MH_LINKER
=
15
,
// linkToCallSite_MH
LF_GWC
=
16
,
// guardWithCatch (catchException)
LF_GWT
=
17
,
// guardWithTest
LF_LIMIT
=
18
;
/** Return the type corresponding uniquely (1-1) to this MT-form.
* It might have any primitive returns or arguments, but will have no references except Object.
...
...
src/share/classes/java/lang/reflect/Executable.java
浏览文件 @
95184625
...
...
@@ -286,6 +286,53 @@ public abstract class Executable extends AccessibleObject
return
getParameterTypes
();
}
/**
* Behaves like {@code getGenericParameterTypes}, but returns type
* information for all parameters, including synthetic parameters.
*/
Type
[]
getAllGenericParameterTypes
()
{
final
boolean
genericInfo
=
hasGenericInformation
();
// Easy case: we don't have generic parameter information. In
// this case, we just return the result of
// getParameterTypes().
if
(!
genericInfo
)
{
return
getParameterTypes
();
}
else
{
final
boolean
realParamData
=
hasRealParameterData
();
final
Type
[]
genericParamTypes
=
getGenericParameterTypes
();
final
Type
[]
nonGenericParamTypes
=
getParameterTypes
();
final
Type
[]
out
=
new
Type
[
nonGenericParamTypes
.
length
];
final
Parameter
[]
params
=
getParameters
();
int
fromidx
=
0
;
// If we have real parameter data, then we use the
// synthetic and mandate flags to our advantage.
if
(
realParamData
)
{
for
(
int
i
=
0
;
i
<
out
.
length
;
i
++)
{
final
Parameter
param
=
params
[
i
];
if
(
param
.
isSynthetic
()
||
param
.
isImplicit
())
{
// If we hit a synthetic or mandated parameter,
// use the non generic parameter info.
out
[
i
]
=
nonGenericParamTypes
[
i
];
}
else
{
// Otherwise, use the generic parameter info.
out
[
i
]
=
genericParamTypes
[
fromidx
];
fromidx
++;
}
}
}
else
{
// Otherwise, use the non-generic parameter data.
// Without method parameter reflection data, we have
// no way to figure out which parameters are
// synthetic/mandated, thus, no way to match up the
// indexes.
return
genericParamTypes
.
length
==
nonGenericParamTypes
.
length
?
genericParamTypes
:
nonGenericParamTypes
;
}
return
out
;
}
}
/**
* Returns an array of {@code Parameter} objects that represent
* all the parameters to the underlying executable represented by
...
...
@@ -654,7 +701,7 @@ public abstract class Executable extends AccessibleObject
getConstantPool
(
getDeclaringClass
()),
this
,
getDeclaringClass
(),
getGenericParameterTypes
(),
get
All
GenericParameterTypes
(),
TypeAnnotation
.
TypeAnnotationTarget
.
METHOD_FORMAL_PARAMETER
);
}
...
...
src/share/classes/java/lang/reflect/Parameter.java
浏览文件 @
95184625
...
...
@@ -198,7 +198,7 @@ public final class Parameter implements AnnotatedElement {
public
Type
getParameterizedType
()
{
Type
tmp
=
parameterTypeCache
;
if
(
null
==
tmp
)
{
tmp
=
executable
.
getGenericParameterTypes
()[
index
];
tmp
=
executable
.
get
All
GenericParameterTypes
()[
index
];
parameterTypeCache
=
tmp
;
}
...
...
src/share/classes/javax/swing/CellEditor.java
浏览文件 @
95184625
/*
* Copyright (c) 1997, 20
05
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 20
14
, 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
...
...
@@ -47,7 +47,7 @@ import javax.swing.event.*;
* new component implement the interface. Or the developer can
* choose a wrapper based approach and provide a companion object which
* implements the <code>CellEditor</code> interface (See
* <code>
J
CellEditor</code> for example). The wrapper approach
* <code>
Default
CellEditor</code> for example). The wrapper approach
* is particularly useful if the user want to use a 3rd party ISV
* editor with <code>JTable</code>, but the ISV didn't implement the
* <code>CellEditor</code> interface. The user can simply create an object
...
...
src/share/classes/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java
浏览文件 @
95184625
...
...
@@ -31,16 +31,14 @@ import java.awt.event.*;
import
javax.accessibility.AccessibleContext
;
import
javax.swing.*
;
import
javax.swing.plaf.*
;
import
javax.swing.border.*
;
import
javax.swing.event.InternalFrameEvent
;
import
java.util.EventListener
;
import
java.beans.PropertyChangeListener
;
import
java.beans.PropertyChangeEvent
;
import
java.beans.VetoableChangeListener
;
import
java.beans.PropertyVetoException
;
import
sun.swing.DefaultLookup
;
import
sun.swing.UIAction
;
import
static
sun
.
swing
.
SwingUtilities2
.
AA_TEXT_PROPERTY_KEY
;
/**
* The class that manages a basic title bar
...
...
@@ -125,6 +123,12 @@ public class BasicInternalFrameTitlePane extends JComponent
createButtons
();
addSubComponents
();
updateProperties
();
}
private
void
updateProperties
()
{
final
Object
aaTextInfo
=
frame
.
getClientProperty
(
AA_TEXT_PROPERTY_KEY
);
putClientProperty
(
AA_TEXT_PROPERTY_KEY
,
aaTextInfo
);
}
protected
void
addSubComponents
()
{
...
...
src/share/classes/javax/swing/plaf/basic/BasicTransferable.java
浏览文件 @
95184625
...
...
@@ -24,6 +24,8 @@
*/
package
javax.swing.plaf.basic
;
import
sun.awt.datatransfer.DataTransferer
;
import
java.io.*
;
import
java.awt.datatransfer.*
;
import
javax.swing.plaf.UIResource
;
...
...
@@ -145,7 +147,7 @@ class BasicTransferable implements Transferable, UIResource {
}
else
if
(
Reader
.
class
.
equals
(
flavor
.
getRepresentationClass
()))
{
return
new
StringReader
(
data
);
}
else
if
(
InputStream
.
class
.
equals
(
flavor
.
getRepresentationClass
()))
{
return
new
StringBufferInputStream
(
data
);
return
createInputStream
(
flavor
,
data
);
}
// fall through to unsupported
}
else
if
(
isPlainFlavor
(
flavor
))
{
...
...
@@ -156,7 +158,7 @@ class BasicTransferable implements Transferable, UIResource {
}
else
if
(
Reader
.
class
.
equals
(
flavor
.
getRepresentationClass
()))
{
return
new
StringReader
(
data
);
}
else
if
(
InputStream
.
class
.
equals
(
flavor
.
getRepresentationClass
()))
{
return
new
StringBufferInputStream
(
data
);
return
createInputStream
(
flavor
,
data
);
}
// fall through to unsupported
...
...
@@ -168,6 +170,15 @@ class BasicTransferable implements Transferable, UIResource {
throw
new
UnsupportedFlavorException
(
flavor
);
}
private
InputStream
createInputStream
(
DataFlavor
flavor
,
String
data
)
throws
IOException
,
UnsupportedFlavorException
{
String
cs
=
DataTransferer
.
getTextCharset
(
flavor
);
if
(
cs
==
null
)
{
throw
new
UnsupportedFlavorException
(
flavor
);
}
return
new
ByteArrayInputStream
(
data
.
getBytes
(
cs
));
}
// --- richer subclass flavors ----------------------------------------------
protected
boolean
isRicherFlavor
(
DataFlavor
flavor
)
{
...
...
src/share/classes/sun/awt/datatransfer/DataTransferer.java
浏览文件 @
95184625
...
...
@@ -77,6 +77,7 @@ import java.util.Comparator;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.Iterator
;
import
java.util.LinkedHashSet
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.SortedMap
;
...
...
@@ -273,7 +274,7 @@ public abstract class DataTransferer {
* instead, null will be returned.
*/
public
static
synchronized
DataTransferer
getInstance
()
{
return
((
ComponentFactory
)
Toolkit
.
getDefaultToolkit
()).
getDataTransferer
();
return
((
SunToolkit
)
Toolkit
.
getDefaultToolkit
()).
getDataTransferer
();
}
/**
...
...
@@ -2424,8 +2425,8 @@ search:
* If there are no platform-specific mappings for this native, the method
* returns an empty <code>List</code>.
*/
public
Li
st
getPlatformMappingsForNative
(
String
nat
)
{
return
new
ArrayList
();
public
Li
nkedHashSet
<
DataFlavor
>
getPlatformMappingsForNative
(
String
nat
)
{
return
new
LinkedHashSet
<>
();
}
/**
...
...
@@ -2433,8 +2434,8 @@ search:
* If there are no platform-specific mappings for this flavor, the method
* returns an empty <code>List</code>.
*/
public
Li
st
getPlatformMappingsForFlavor
(
DataFlavor
df
)
{
return
new
ArrayList
();
public
Li
nkedHashSet
<
String
>
getPlatformMappingsForFlavor
(
DataFlavor
df
)
{
return
new
LinkedHashSet
<>
();
}
/**
...
...
src/share/classes/sun/java2d/opengl/OGLBlitLoops.java
浏览文件 @
95184625
...
...
@@ -47,7 +47,7 @@ import sun.java2d.pipe.RenderQueue;
import
static
sun
.
java2d
.
pipe
.
BufferedOpCodes
.*;
import
java.lang.annotation.Native
;
class
OGLBlitLoops
{
final
class
OGLBlitLoops
{
static
void
register
()
{
Blit
blitIntArgbPreToSurface
=
...
...
@@ -56,7 +56,9 @@ class OGLBlitLoops {
Blit
blitIntArgbPreToTexture
=
new
OGLSwToTextureBlit
(
SurfaceType
.
IntArgbPre
,
OGLSurfaceData
.
PF_INT_ARGB_PRE
);
TransformBlit
transformBlitIntArgbPreToSurface
=
new
OGLSwToSurfaceTransform
(
SurfaceType
.
IntArgbPre
,
OGLSurfaceData
.
PF_INT_ARGB_PRE
);
GraphicsPrimitive
[]
primitives
=
{
// surface->surface ops
new
OGLSurfaceToSurfaceBlit
(),
...
...
@@ -100,7 +102,7 @@ class OGLBlitLoops {
CompositeType
.
AnyAlpha
,
blitIntArgbPreToSurface
),
new
OGLAnyCompositeBlit
(
OGLSurfaceData
.
OpenGLSurface
),
new
OGLAnyCompositeBlit
(),
new
OGLSwToSurfaceScale
(
SurfaceType
.
IntRgb
,
OGLSurfaceData
.
PF_INT_RGB
),
...
...
@@ -145,8 +147,9 @@ class OGLBlitLoops {
OGLSurfaceData
.
PF_BYTE_GRAY
),
new
OGLSwToSurfaceTransform
(
SurfaceType
.
UshortGray
,
OGLSurfaceData
.
PF_USHORT_GRAY
),
new
OGLSwToSurfaceTransform
(
SurfaceType
.
IntArgbPre
,
OGLSurfaceData
.
PF_INT_ARGB_PRE
),
transformBlitIntArgbPreToSurface
,
new
OGLGeneralTransformedBlit
(
transformBlitIntArgbPreToSurface
),
// texture->surface ops
new
OGLTextureToSurfaceBlit
(),
...
...
@@ -178,9 +181,6 @@ class OGLBlitLoops {
new
OGLGeneralBlit
(
OGLSurfaceData
.
OpenGLTexture
,
CompositeType
.
SrcNoEa
,
blitIntArgbPreToTexture
),
new
OGLAnyCompositeBlit
(
OGLSurfaceData
.
OpenGLTexture
),
};
GraphicsPrimitiveMgr
.
register
(
primitives
);
}
...
...
@@ -781,11 +781,11 @@ class OGLTextureToSurfaceTransform extends TransformBlit {
* This general Blit implementation converts any source surface to an
* intermediate IntArgbPre surface, and then uses the more specific
* IntArgbPre->OpenGLSurface/Texture loop to get the intermediate
* (premultiplied) surface down to OpenGL.
* (premultiplied) surface down to OpenGL
using simple blit
.
*/
class
OGLGeneralBlit
extends
Blit
{
private
Blit
performop
;
private
final
Blit
performop
;
private
WeakReference
srcTmp
;
OGLGeneralBlit
(
SurfaceType
dstType
,
...
...
@@ -826,12 +826,56 @@ class OGLGeneralBlit extends Blit {
}
}
class
OGLAnyCompositeBlit
extends
Blit
{
/**
* This general TransformedBlit implementation converts any source surface to an
* intermediate IntArgbPre surface, and then uses the more specific
* IntArgbPre->OpenGLSurface/Texture loop to get the intermediate
* (premultiplied) surface down to OpenGL using simple transformBlit.
*/
final
class
OGLGeneralTransformedBlit
extends
TransformBlit
{
private
final
TransformBlit
performop
;
private
WeakReference
<
SurfaceData
>
srcTmp
;
OGLGeneralTransformedBlit
(
final
TransformBlit
performop
)
{
super
(
SurfaceType
.
Any
,
CompositeType
.
AnyAlpha
,
OGLSurfaceData
.
OpenGLSurface
);
this
.
performop
=
performop
;
}
@Override
public
synchronized
void
Transform
(
SurfaceData
src
,
SurfaceData
dst
,
Composite
comp
,
Region
clip
,
AffineTransform
at
,
int
hint
,
int
srcx
,
int
srcy
,
int
dstx
,
int
dsty
,
int
width
,
int
height
){
Blit
convertsrc
=
Blit
.
getFromCache
(
src
.
getSurfaceType
(),
CompositeType
.
SrcNoEa
,
SurfaceType
.
IntArgbPre
);
// use cached intermediate surface, if available
final
SurfaceData
cachedSrc
=
srcTmp
!=
null
?
srcTmp
.
get
()
:
null
;
// convert source to IntArgbPre
src
=
convertFrom
(
convertsrc
,
src
,
srcx
,
srcy
,
width
,
height
,
cachedSrc
,
BufferedImage
.
TYPE_INT_ARGB_PRE
);
// transform IntArgbPre intermediate surface to OpenGL surface
performop
.
Transform
(
src
,
dst
,
comp
,
clip
,
at
,
hint
,
0
,
0
,
dstx
,
dsty
,
width
,
height
);
if
(
src
!=
cachedSrc
)
{
// cache the intermediate surface
srcTmp
=
new
WeakReference
<>(
src
);
}
}
}
final
class
OGLAnyCompositeBlit
extends
Blit
{
private
WeakReference
<
SurfaceData
>
dstTmp
;
public
OGLAnyCompositeBlit
(
SurfaceType
dstType
)
{
super
(
SurfaceType
.
Any
,
CompositeType
.
Any
,
dstTyp
e
);
OGLAnyCompositeBlit
(
)
{
super
(
SurfaceType
.
Any
,
CompositeType
.
Any
,
OGLSurfaceData
.
OpenGLSurfac
e
);
}
public
synchronized
void
Blit
(
SurfaceData
src
,
SurfaceData
dst
,
Composite
comp
,
Region
clip
,
int
sx
,
int
sy
,
int
dx
,
int
dy
,
...
...
@@ -848,15 +892,15 @@ class OGLAnyCompositeBlit extends Blit {
cachedDst
=
dstTmp
.
get
();
}
// convert
source
to IntArgbPre
// convert
destination
to IntArgbPre
SurfaceData
dstBuffer
=
convertFrom
(
convertdst
,
dst
,
dx
,
dy
,
w
,
h
,
cachedDst
,
BufferedImage
.
TYPE_INT_ARGB_PRE
);
Region
bufferClip
=
clip
==
null
?
null
:
clip
.
getTranslatedRegion
(-
dx
,
-
dy
);
Blit
performop
=
Blit
.
getFromCache
(
src
.
getSurfaceType
(),
CompositeType
.
Any
,
dstBuffer
.
getSurfaceType
());
performop
.
Blit
(
src
,
dstBuffer
,
comp
,
clip
,
sx
,
sy
,
0
,
0
,
w
,
h
);
performop
.
Blit
(
src
,
dstBuffer
,
comp
,
bufferClip
,
sx
,
sy
,
0
,
0
,
w
,
h
);
if
(
dstBuffer
!=
cachedDst
)
{
// cache the intermediate surface
...
...
src/share/classes/sun/java2d/pipe/DrawImage.java
浏览文件 @
95184625
...
...
@@ -510,7 +510,7 @@ public class DrawImage implements DrawImagePipe
// We need to transform to a temp image and then copy
// just the pieces that are valid data to the dest.
BufferedImage
tmpimg
=
new
BufferedImage
(
dx2
-
dx1
,
dy2
-
dy1
,
BufferedImage
.
TYPE_INT_ARGB
);
BufferedImage
.
TYPE_INT_ARGB
_PRE
);
SurfaceData
tmpData
=
SurfaceData
.
getPrimarySurfaceData
(
tmpimg
);
SurfaceType
tmpType
=
tmpData
.
getSurfaceType
();
MaskBlit
tmpmaskblit
=
...
...
src/share/classes/sun/management/Flag.java
浏览文件 @
95184625
/*
* Copyright (c) 2003, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 201
4
, 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
...
...
@@ -28,6 +28,7 @@ package sun.management;
import
java.util.*
;
import
com.sun.management.VMOption
;
import
com.sun.management.VMOption.Origin
;
import
java.security.AccessController
;
/**
* Flag class is a helper class for constructing a VMOption.
...
...
@@ -114,6 +115,13 @@ class Flag {
static
synchronized
native
void
setStringValue
(
String
name
,
String
value
);
static
{
AccessController
.
doPrivileged
(
new
java
.
security
.
PrivilegedAction
<
Void
>()
{
public
Void
run
()
{
System
.
loadLibrary
(
"management"
);
return
null
;
}
});
initialize
();
}
private
static
native
void
initialize
();
...
...
src/share/classes/sun/net/www/http/HttpClient.java
浏览文件 @
95184625
...
...
@@ -657,9 +657,10 @@ public class HttpClient extends NetworkClient {
cachedHttpClient
=
false
;
if
(!
failedOnce
&&
requests
!=
null
)
{
failedOnce
=
true
;
if
(
getRequestMethod
().
equals
(
"CONNECT"
)
||
(
httpuc
.
getRequestMethod
().
equals
(
"POST"
)
&&
(!
retryPostProp
||
streaming
)))
{
if
(
getRequestMethod
().
equals
(
"CONNECT"
)
||
streaming
||
(
httpuc
.
getRequestMethod
().
equals
(
"POST"
)
&&
!
retryPostProp
))
{
// do not retry the request
}
else
{
// try once more
...
...
@@ -769,9 +770,10 @@ public class HttpClient extends NetworkClient {
}
else
if
(
nread
!=
8
)
{
if
(!
failedOnce
&&
requests
!=
null
)
{
failedOnce
=
true
;
if
(
getRequestMethod
().
equals
(
"CONNECT"
)
||
(
httpuc
.
getRequestMethod
().
equals
(
"POST"
)
&&
(!
retryPostProp
||
streaming
)))
{
if
(
getRequestMethod
().
equals
(
"CONNECT"
)
||
streaming
||
(
httpuc
.
getRequestMethod
().
equals
(
"POST"
)
&&
!
retryPostProp
))
{
// do not retry the request
}
else
{
closeServer
();
...
...
src/solaris/classes/sun/awt/X11/XDataTransferer.java
浏览文件 @
95184625
...
...
@@ -45,6 +45,7 @@ import java.net.URISyntaxException;
import
java.util.ArrayList
;
import
java.util.Iterator
;
import
java.util.LinkedHashSet
;
import
java.util.List
;
import
javax.imageio.ImageIO
;
...
...
@@ -328,8 +329,9 @@ public class XDataTransferer extends DataTransferer {
* a valid MIME and return a list of flavors to which the data in this MIME
* type can be translated by the Data Transfer subsystem.
*/
public
List
<
DataFlavor
>
getPlatformMappingsForNative
(
String
nat
)
{
List
<
DataFlavor
>
flavors
=
new
ArrayList
();
public
LinkedHashSet
<
DataFlavor
>
getPlatformMappingsForNative
(
String
nat
)
{
LinkedHashSet
<
DataFlavor
>
flavors
=
new
LinkedHashSet
<>();
if
(
nat
==
null
)
{
return
flavors
;
...
...
@@ -389,8 +391,8 @@ public class XDataTransferer extends DataTransferer {
* MIME types to which the data in this flavor can be translated by the Data
* Transfer subsystem.
*/
public
Li
st
getPlatformMappingsForFlavor
(
DataFlavor
df
)
{
Li
st
natives
=
new
ArrayList
(
1
);
public
Li
nkedHashSet
<
String
>
getPlatformMappingsForFlavor
(
DataFlavor
df
)
{
Li
nkedHashSet
<
String
>
natives
=
new
LinkedHashSet
<>
(
1
);
if
(
df
==
null
)
{
return
natives
;
...
...
src/solaris/classes/sun/awt/X11/XWM.java
浏览文件 @
95184625
...
...
@@ -595,8 +595,13 @@ final class XWM
return
isNetWMName
(
"Mutter"
)
||
isNetWMName
(
"GNOME Shell"
);
}
static
int
awtWMNonReparenting
=
-
1
;
static
boolean
isNonReparentingWM
()
{
return
(
XWM
.
getWMID
()
==
XWM
.
COMPIZ_WM
||
XWM
.
getWMID
()
==
XWM
.
LG3D_WM
||
XWM
.
getWMID
()
==
XWM
.
CWM_WM
);
if
(
awtWMNonReparenting
==
-
1
)
{
awtWMNonReparenting
=
(
XToolkit
.
getEnv
(
"_JAVA_AWT_WM_NONREPARENTING"
)
!=
null
)
?
1
:
0
;
}
return
(
awtWMNonReparenting
==
1
||
XWM
.
getWMID
()
==
XWM
.
COMPIZ_WM
||
XWM
.
getWMID
()
==
XWM
.
LG3D_WM
||
XWM
.
getWMID
()
==
XWM
.
CWM_WM
);
}
/*
...
...
src/windows/classes/sun/java2d/d3d/D3DBlitLoops.java
浏览文件 @
95184625
/*
* Copyright (c) 2007, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 201
4
, 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
...
...
@@ -48,7 +48,7 @@ import sun.java2d.pipe.RenderQueue;
import
static
sun
.
java2d
.
pipe
.
BufferedOpCodes
.*;
import
sun.java2d.windows.GDIWindowSurfaceData
;
class
D3DBlitLoops
{
final
class
D3DBlitLoops
{
static
void
register
()
{
Blit
blitIntArgbPreToSurface
=
...
...
@@ -57,7 +57,9 @@ class D3DBlitLoops {
Blit
blitIntArgbPreToTexture
=
new
D3DSwToTextureBlit
(
SurfaceType
.
IntArgbPre
,
D3DSurfaceData
.
ST_INT_ARGB_PRE
);
TransformBlit
transformBlitIntArgbPreToSurface
=
new
D3DSwToSurfaceTransform
(
SurfaceType
.
IntArgbPre
,
D3DSurfaceData
.
ST_INT_ARGB_PRE
);
GraphicsPrimitive
[]
primitives
=
{
// prevent D3DSurface -> Screen blits
new
D3DSurfaceToGDIWindowSurfaceBlit
(),
...
...
@@ -123,8 +125,6 @@ class D3DBlitLoops {
new
D3DSwToSurfaceTransform
(
SurfaceType
.
IntArgb
,
D3DSurfaceData
.
ST_INT_ARGB
),
new
D3DSwToSurfaceTransform
(
SurfaceType
.
IntArgbPre
,
D3DSurfaceData
.
ST_INT_ARGB_PRE
),
new
D3DSwToSurfaceTransform
(
SurfaceType
.
IntRgb
,
D3DSurfaceData
.
ST_INT_RGB
),
new
D3DSwToSurfaceTransform
(
SurfaceType
.
IntBgr
,
...
...
@@ -140,6 +140,9 @@ class D3DBlitLoops {
// REMIND: we don't have a native sw loop to back this loop up
// new D3DSwToSurfaceTransform(SurfaceType.ByteIndexedBm,
// D3DSurfaceData.ST_BYTE_INDEXED_BM),
transformBlitIntArgbPreToSurface
,
new
D3DGeneralTransformedBlit
(
transformBlitIntArgbPreToSurface
),
// texture->surface ops
new
D3DTextureToSurfaceBlit
(),
...
...
@@ -712,11 +715,11 @@ class D3DTextureToSurfaceTransform extends TransformBlit {
* This general Blit implementation converts any source surface to an
* intermediate IntArgbPre surface, and then uses the more specific
* IntArgbPre->D3DSurface/Texture loop to get the intermediate
* (premultiplied) surface down to D3D.
* (premultiplied) surface down to D3D
using simple blit
.
*/
class
D3DGeneralBlit
extends
Blit
{
private
Blit
performop
;
private
final
Blit
performop
;
private
WeakReference
srcTmp
;
D3DGeneralBlit
(
SurfaceType
dstType
,
...
...
@@ -757,6 +760,49 @@ class D3DGeneralBlit extends Blit {
}
}
/**
* This general TransformedBlit implementation converts any source surface to an
* intermediate IntArgbPre surface, and then uses the more specific
* IntArgbPre->D3DSurface/Texture loop to get the intermediate
* (premultiplied) surface down to D3D using simple transformBlit.
*/
final
class
D3DGeneralTransformedBlit
extends
TransformBlit
{
private
final
TransformBlit
performop
;
private
WeakReference
<
SurfaceData
>
srcTmp
;
D3DGeneralTransformedBlit
(
final
TransformBlit
performop
)
{
super
(
SurfaceType
.
Any
,
CompositeType
.
AnyAlpha
,
D3DSurfaceData
.
D3DSurface
);
this
.
performop
=
performop
;
}
@Override
public
synchronized
void
Transform
(
SurfaceData
src
,
SurfaceData
dst
,
Composite
comp
,
Region
clip
,
AffineTransform
at
,
int
hint
,
int
srcx
,
int
srcy
,
int
dstx
,
int
dsty
,
int
width
,
int
height
){
Blit
convertsrc
=
Blit
.
getFromCache
(
src
.
getSurfaceType
(),
CompositeType
.
SrcNoEa
,
SurfaceType
.
IntArgbPre
);
// use cached intermediate surface, if available
final
SurfaceData
cachedSrc
=
srcTmp
!=
null
?
srcTmp
.
get
()
:
null
;
// convert source to IntArgbPre
src
=
convertFrom
(
convertsrc
,
src
,
srcx
,
srcy
,
width
,
height
,
cachedSrc
,
BufferedImage
.
TYPE_INT_ARGB_PRE
);
// transform IntArgbPre intermediate surface to D3D surface
performop
.
Transform
(
src
,
dst
,
comp
,
clip
,
at
,
hint
,
0
,
0
,
dstx
,
dsty
,
width
,
height
);
if
(
src
!=
cachedSrc
)
{
// cache the intermediate surface
srcTmp
=
new
WeakReference
<>(
src
);
}
}
}
/*
* The following classes prohibit copying D3DSurfaces to the screen
* (the D3D->sysmem->GDI path is known to be very very slow).
...
...
test/java/awt/datatransfer/MappingGenerationTest/MappingGenerationTest.java
0 → 100644
浏览文件 @
95184625
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import
java.awt.datatransfer.DataFlavor
;
import
java.awt.datatransfer.SystemFlavorMap
;
import
java.util.List
;
/*
@test
@bug 4512530 8027148
@summary tests that mappings for text flavors are generated properly
@author das@sparc.spb.su area=datatransfer
*/
public
class
MappingGenerationTest
{
private
static
final
SystemFlavorMap
fm
=
(
SystemFlavorMap
)
SystemFlavorMap
.
getDefaultFlavorMap
();
public
static
void
main
(
String
[]
args
)
{
test1
();
test2
();
test3
();
test4
();
test5
();
test6
();
}
/**
* Verifies that Lists returned from getNativesForFlavor() and
* getFlavorsForNative() are not modified with a subsequent call
* to addUnencodedNativeForFlavor() and addFlavorForUnencodedNative()
* respectively.
*/
public
static
void
test1
()
{
DataFlavor
df
=
new
DataFlavor
(
"text/plain-test1"
,
null
);
String
nat
=
"native1"
;
List
<
String
>
natives
=
fm
.
getNativesForFlavor
(
df
);
fm
.
addUnencodedNativeForFlavor
(
df
,
nat
);
List
<
String
>
nativesNew
=
fm
.
getNativesForFlavor
(
df
);
if
(
natives
.
equals
(
nativesNew
))
{
System
.
err
.
println
(
"orig="
+
natives
);
System
.
err
.
println
(
"new="
+
nativesNew
);
throw
new
RuntimeException
(
"Test failed"
);
}
List
<
DataFlavor
>
flavors
=
fm
.
getFlavorsForNative
(
nat
);
fm
.
addFlavorForUnencodedNative
(
nat
,
df
);
List
<
DataFlavor
>
flavorsNew
=
fm
.
getFlavorsForNative
(
nat
);
if
(
flavors
.
equals
(
flavorsNew
))
{
System
.
err
.
println
(
"orig="
+
flavors
);
System
.
err
.
println
(
"new="
+
flavorsNew
);
throw
new
RuntimeException
(
"Test failed"
);
}
}
/**
* Verifies that SystemFlavorMap is not affected by modification of
* the Lists returned from getNativesForFlavor() and
* getFlavorsForNative().
*/
public
static
void
test2
()
{
DataFlavor
df
=
new
DataFlavor
(
"text/plain-test2"
,
null
);
String
nat
=
"native2"
;
DataFlavor
extraDf
=
new
DataFlavor
(
"text/test"
,
null
);
List
<
String
>
natives
=
fm
.
getNativesForFlavor
(
df
);
natives
.
add
(
"Should not be here"
);
java
.
util
.
List
nativesNew
=
fm
.
getNativesForFlavor
(
df
);
if
(
natives
.
equals
(
nativesNew
))
{
System
.
err
.
println
(
"orig="
+
natives
);
System
.
err
.
println
(
"new="
+
nativesNew
);
throw
new
RuntimeException
(
"Test failed"
);
}
List
<
DataFlavor
>
flavors
=
fm
.
getFlavorsForNative
(
nat
);
flavors
.
add
(
extraDf
);
java
.
util
.
List
flavorsNew
=
fm
.
getFlavorsForNative
(
nat
);
if
(
flavors
.
equals
(
flavorsNew
))
{
System
.
err
.
println
(
"orig="
+
flavors
);
System
.
err
.
println
(
"new="
+
flavorsNew
);
throw
new
RuntimeException
(
"Test failed"
);
}
}
/**
* Verifies that addUnencodedNativeForFlavor() for a particular text flavor
* doesn't affect mappings for other flavors.
*/
public
static
void
test3
()
{
DataFlavor
df1
=
new
DataFlavor
(
"text/plain-test3"
,
null
);
DataFlavor
df2
=
new
DataFlavor
(
"text/plain-test3; charset=Unicode; class=java.io.Reader"
,
null
);
String
nat
=
"native3"
;
List
<
String
>
natives
=
fm
.
getNativesForFlavor
(
df2
);
fm
.
addUnencodedNativeForFlavor
(
df1
,
nat
);
List
<
String
>
nativesNew
=
fm
.
getNativesForFlavor
(
df2
);
if
(!
natives
.
equals
(
nativesNew
))
{
System
.
err
.
println
(
"orig="
+
natives
);
System
.
err
.
println
(
"new="
+
nativesNew
);
throw
new
RuntimeException
(
"Test failed"
);
}
}
/**
* Verifies that addUnencodedNativeForFlavor() really adds the specified
* flavor-to-native mapping to the existing mappings.
*/
public
static
void
test4
()
{
DataFlavor
df
=
new
DataFlavor
(
"text/plain-test4; charset=Unicode; class=java.io.Reader"
,
null
);
String
nat
=
"native4"
;
List
<
String
>
natives
=
fm
.
getNativesForFlavor
(
df
);
if
(!
natives
.
contains
(
nat
))
{
fm
.
addUnencodedNativeForFlavor
(
df
,
nat
);
List
<
String
>
nativesNew
=
fm
.
getNativesForFlavor
(
df
);
natives
.
add
(
nat
);
if
(!
natives
.
equals
(
nativesNew
))
{
System
.
err
.
println
(
"orig="
+
natives
);
System
.
err
.
println
(
"new="
+
nativesNew
);
throw
new
RuntimeException
(
"Test failed"
);
}
}
}
/**
* Verifies that a flavor doesn't have any flavor-to-native mappings after
* a call to setNativesForFlavor() with this flavor and an empty native
* array as arguments.
*/
public
static
void
test5
()
{
final
DataFlavor
flavor
=
new
DataFlavor
(
"text/plain-TEST5; charset=Unicode"
,
null
);
fm
.
getNativesForFlavor
(
flavor
);
fm
.
setNativesForFlavor
(
flavor
,
new
String
[
0
]);
List
<
String
>
natives
=
fm
.
getNativesForFlavor
(
flavor
);
if
(!
natives
.
isEmpty
())
{
System
.
err
.
println
(
"natives="
+
natives
);
throw
new
RuntimeException
(
"Test failed"
);
}
}
/**
* Verifies that a native doesn't have any native-to-flavor mappings after
* a call to setFlavorsForNative() with this native and an empty flavor
* array as arguments.
*/
public
static
void
test6
()
{
final
String
nat
=
"STRING"
;
fm
.
getFlavorsForNative
(
nat
);
fm
.
setFlavorsForNative
(
nat
,
new
DataFlavor
[
0
]);
List
<
DataFlavor
>
flavors
=
fm
.
getFlavorsForNative
(
nat
);
if
(!
flavors
.
isEmpty
())
{
System
.
err
.
println
(
"flavors="
+
flavors
);
throw
new
RuntimeException
(
"Test failed"
);
}
}
}
test/java/awt/image/DrawImage/IncorrectAlphaConversionBicubic.java
0 → 100644
浏览文件 @
95184625
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import
java.awt.AlphaComposite
;
import
java.awt.Color
;
import
java.awt.Graphics2D
;
import
java.awt.GraphicsConfiguration
;
import
java.awt.GraphicsDevice
;
import
java.awt.GraphicsEnvironment
;
import
java.awt.RenderingHints
;
import
java.awt.image.BufferedImage
;
import
java.awt.image.DataBuffer
;
import
java.awt.image.DataBufferByte
;
import
java.awt.image.DataBufferInt
;
import
java.awt.image.DataBufferShort
;
import
java.awt.image.VolatileImage
;
import
static
java
.
awt
.
Transparency
.
TRANSLUCENT
;
/**
* @test
* @bug 8062164
* @summary We should get correct alpha, when we draw to/from VolatileImage and
* bicubic interpolation is enabled
* @author Sergey Bylokhov
*/
public
final
class
IncorrectAlphaConversionBicubic
{
private
static
final
Color
RGB
=
new
Color
(
200
,
255
,
7
,
123
);
private
static
final
int
SIZE
=
100
;
public
static
void
main
(
final
String
[]
args
)
{
final
GraphicsEnvironment
ge
=
GraphicsEnvironment
.
getLocalGraphicsEnvironment
();
final
GraphicsDevice
gd
=
ge
.
getDefaultScreenDevice
();
final
GraphicsConfiguration
gc
=
gd
.
getDefaultConfiguration
();
final
VolatileImage
vi
=
gc
.
createCompatibleVolatileImage
(
SIZE
,
SIZE
,
TRANSLUCENT
);
final
BufferedImage
bi
=
makeUnmanagedBI
(
gc
,
TRANSLUCENT
);
final
int
expected
=
bi
.
getRGB
(
2
,
2
);
int
attempt
=
0
;
BufferedImage
snapshot
;
while
(
true
)
{
if
(++
attempt
>
10
)
{
throw
new
RuntimeException
(
"Too many attempts: "
+
attempt
);
}
vi
.
validate
(
gc
);
final
Graphics2D
g2d
=
vi
.
createGraphics
();
g2d
.
setComposite
(
AlphaComposite
.
Src
);
g2d
.
scale
(
2
,
2
);
g2d
.
setRenderingHint
(
RenderingHints
.
KEY_INTERPOLATION
,
RenderingHints
.
VALUE_INTERPOLATION_BICUBIC
);
g2d
.
drawImage
(
bi
,
0
,
0
,
null
);
g2d
.
dispose
();
snapshot
=
vi
.
getSnapshot
();
if
(
vi
.
contentsLost
())
{
continue
;
}
break
;
}
final
int
actual
=
snapshot
.
getRGB
(
2
,
2
);
if
(
actual
!=
expected
)
{
System
.
err
.
println
(
"Actual: "
+
Integer
.
toHexString
(
actual
));
System
.
err
.
println
(
"Expected: "
+
Integer
.
toHexString
(
expected
));
throw
new
RuntimeException
(
"Test failed"
);
}
}
private
static
BufferedImage
makeUnmanagedBI
(
GraphicsConfiguration
gc
,
int
type
)
{
BufferedImage
img
=
gc
.
createCompatibleImage
(
SIZE
,
SIZE
,
type
);
Graphics2D
g2d
=
img
.
createGraphics
();
g2d
.
setColor
(
RGB
);
g2d
.
fillRect
(
0
,
0
,
SIZE
,
SIZE
);
g2d
.
dispose
();
final
DataBuffer
db
=
img
.
getRaster
().
getDataBuffer
();
if
(
db
instanceof
DataBufferInt
)
{
((
DataBufferInt
)
db
).
getData
();
}
else
if
(
db
instanceof
DataBufferShort
)
{
((
DataBufferShort
)
db
).
getData
();
}
else
if
(
db
instanceof
DataBufferByte
)
{
((
DataBufferByte
)
db
).
getData
();
}
else
{
try
{
img
.
setAccelerationPriority
(
0.0f
);
}
catch
(
final
Throwable
ignored
)
{
}
}
return
img
;
}
}
test/java/awt/image/DrawImage/IncorrectClipXorModeSW2Surface.java
0 → 100644
浏览文件 @
95184625
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import
java.awt.Color
;
import
java.awt.Graphics2D
;
import
java.awt.GraphicsConfiguration
;
import
java.awt.GraphicsEnvironment
;
import
java.awt.Image
;
import
java.awt.Rectangle
;
import
java.awt.Shape
;
import
java.awt.geom.AffineTransform
;
import
java.awt.image.BufferedImage
;
import
java.awt.image.DataBuffer
;
import
java.awt.image.DataBufferByte
;
import
java.awt.image.DataBufferInt
;
import
java.awt.image.DataBufferShort
;
import
java.awt.image.VolatileImage
;
import
java.io.File
;
import
java.io.IOException
;
import
javax.imageio.ImageIO
;
import
static
java
.
awt
.
geom
.
Rectangle2D
.
Double
;
/**
* @test
* @bug 8061456
* @summary Tests drawing BI to volatile image using different clips + xor mode.
* Results of the blit BI to compatibleImage is used for comparison.
* @author Sergey Bylokhov
*/
public
final
class
IncorrectClipXorModeSW2Surface
{
private
static
int
[]
SIZES
=
{
2
,
10
,
100
};
private
static
final
Shape
[]
SHAPES
=
{
new
Rectangle
(
0
,
0
,
0
,
0
),
new
Rectangle
(
0
,
0
,
1
,
1
),
new
Rectangle
(
0
,
1
,
1
,
1
),
new
Rectangle
(
1
,
0
,
1
,
1
),
new
Rectangle
(
1
,
1
,
1
,
1
),
new
Double
(
0
,
0
,
0.5
,
0.5
),
new
Double
(
0
,
0.5
,
0.5
,
0.5
),
new
Double
(
0.5
,
0
,
0.5
,
0.5
),
new
Double
(
0.5
,
0.5
,
0.5
,
0.5
),
new
Double
(
0.25
,
0.25
,
0.5
,
0.5
),
new
Double
(
0
,
0.25
,
1
,
0.5
),
new
Double
(
0.25
,
0
,
0.5
,
1
),
new
Double
(.
10
,
.
10
,
.
20
,
.
20
),
new
Double
(.
75
,
.
75
,
.
20
,
.
20
),
new
Double
(.
75
,
.
10
,
.
20
,
.
20
),
new
Double
(.
10
,
.
75
,
.
20
,
.
20
),
};
public
static
void
main
(
final
String
[]
args
)
throws
IOException
{
GraphicsEnvironment
ge
=
GraphicsEnvironment
.
getLocalGraphicsEnvironment
();
GraphicsConfiguration
gc
=
ge
.
getDefaultScreenDevice
()
.
getDefaultConfiguration
();
AffineTransform
at
;
for
(
int
size
:
SIZES
)
{
at
=
AffineTransform
.
getScaleInstance
(
size
,
size
);
for
(
Shape
clip
:
SHAPES
)
{
clip
=
at
.
createTransformedShape
(
clip
);
for
(
Shape
to
:
SHAPES
)
{
to
=
at
.
createTransformedShape
(
to
);
// Prepare test images
BufferedImage
snapshot
;
BufferedImage
bi
=
getBufferedImage
(
size
);
VolatileImage
vi
=
getVolatileImage
(
gc
,
size
);
while
(
true
)
{
vi
.
validate
(
gc
);
Graphics2D
g2d
=
vi
.
createGraphics
();
g2d
.
setColor
(
Color
.
GREEN
);
g2d
.
fillRect
(
0
,
0
,
size
,
size
);
g2d
.
dispose
();
if
(
vi
.
validate
(
gc
)
!=
VolatileImage
.
IMAGE_OK
)
{
continue
;
}
draw
(
clip
,
to
,
bi
,
vi
);
snapshot
=
vi
.
getSnapshot
();
if
(
vi
.
contentsLost
())
{
continue
;
}
break
;
}
// Prepare gold images
BufferedImage
goldvi
=
getCompatibleImage
(
gc
,
size
);
BufferedImage
goldbi
=
getBufferedImage
(
size
);
draw
(
clip
,
to
,
goldbi
,
goldvi
);
validate
(
snapshot
,
goldvi
);
vi
.
flush
();
}
}
}
}
private
static
void
draw
(
Shape
clip
,
Shape
shape
,
Image
from
,
Image
to
)
{
Graphics2D
g2d
=
(
Graphics2D
)
to
.
getGraphics
();
g2d
.
setXORMode
(
Color
.
BLACK
);
g2d
.
setClip
(
clip
);
Rectangle
toBounds
=
shape
.
getBounds
();
g2d
.
drawImage
(
from
,
toBounds
.
x
,
toBounds
.
y
,
toBounds
.
width
,
toBounds
.
height
,
null
);
g2d
.
dispose
();
}
private
static
BufferedImage
getBufferedImage
(
int
sw
)
{
final
BufferedImage
bi
=
new
BufferedImage
(
sw
,
sw
,
BufferedImage
.
TYPE_INT_ARGB
);
Graphics2D
g2d
=
bi
.
createGraphics
();
g2d
.
setColor
(
Color
.
RED
);
g2d
.
fillRect
(
0
,
0
,
sw
,
sw
);
g2d
.
dispose
();
final
DataBuffer
db
=
bi
.
getRaster
().
getDataBuffer
();
if
(
db
instanceof
DataBufferInt
)
{
((
DataBufferInt
)
db
).
getData
();
}
else
if
(
db
instanceof
DataBufferShort
)
{
((
DataBufferShort
)
db
).
getData
();
}
else
if
(
db
instanceof
DataBufferByte
)
{
((
DataBufferByte
)
db
).
getData
();
}
else
{
try
{
bi
.
setAccelerationPriority
(
0.0f
);
}
catch
(
final
Throwable
ignored
)
{
}
}
return
bi
;
}
private
static
VolatileImage
getVolatileImage
(
GraphicsConfiguration
gc
,
int
size
)
{
return
gc
.
createCompatibleVolatileImage
(
size
,
size
);
}
private
static
BufferedImage
getCompatibleImage
(
GraphicsConfiguration
gc
,
int
size
)
{
BufferedImage
image
=
gc
.
createCompatibleImage
(
size
,
size
);
Graphics2D
g2d
=
image
.
createGraphics
();
g2d
.
setColor
(
Color
.
GREEN
);
g2d
.
fillRect
(
0
,
0
,
size
,
size
);
g2d
.
dispose
();
return
image
;
}
private
static
void
validate
(
BufferedImage
bi
,
BufferedImage
goldbi
)
throws
IOException
{
for
(
int
x
=
0
;
x
<
bi
.
getWidth
();
++
x
)
{
for
(
int
y
=
0
;
y
<
bi
.
getHeight
();
++
y
)
{
if
(
goldbi
.
getRGB
(
x
,
y
)
!=
bi
.
getRGB
(
x
,
y
))
{
ImageIO
.
write
(
bi
,
"png"
,
new
File
(
"actual.png"
));
ImageIO
.
write
(
goldbi
,
"png"
,
new
File
(
"expected.png"
));
throw
new
RuntimeException
(
"Test failed."
);
}
}
}
}
}
test/java/awt/image/DrawImage/IncorrectUnmanagedImageSourceOffset.java
0 → 100644
浏览文件 @
95184625
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import
java.awt.AlphaComposite
;
import
java.awt.Color
;
import
java.awt.Graphics2D
;
import
java.awt.GraphicsConfiguration
;
import
java.awt.GraphicsEnvironment
;
import
java.awt.Image
;
import
java.awt.image.BufferedImage
;
import
java.awt.image.DataBuffer
;
import
java.awt.image.DataBufferByte
;
import
java.awt.image.DataBufferInt
;
import
java.awt.image.DataBufferShort
;
import
java.awt.image.VolatileImage
;
import
java.io.File
;
import
java.io.IOException
;
import
javax.imageio.ImageIO
;
import
static
java
.
awt
.
Transparency
.*;
import
static
java
.
awt
.
image
.
BufferedImage
.*;
/**
* @test
* @bug 8029253
* @summary Tests asymmetric source offsets when unmanaged image is drawn to VI.
* Results of the blit to compatibleImage are used for comparison.
* @author Sergey Bylokhov
*/
public
final
class
IncorrectUnmanagedImageSourceOffset
{
private
static
final
int
[]
TYPES
=
{
TYPE_INT_RGB
,
TYPE_INT_ARGB
,
TYPE_INT_ARGB_PRE
,
TYPE_INT_BGR
,
TYPE_3BYTE_BGR
,
TYPE_4BYTE_ABGR
,
TYPE_4BYTE_ABGR_PRE
,
/*TYPE_USHORT_565_RGB,
TYPE_USHORT_555_RGB, TYPE_BYTE_GRAY,
TYPE_USHORT_GRAY,*/
TYPE_BYTE_BINARY
,
TYPE_BYTE_INDEXED
};
private
static
final
int
[]
TRANSPARENCIES
=
{
OPAQUE
,
BITMASK
,
TRANSLUCENT
};
public
static
void
main
(
final
String
[]
args
)
throws
IOException
{
for
(
final
int
viType
:
TRANSPARENCIES
)
{
for
(
final
int
biType
:
TYPES
)
{
BufferedImage
bi
=
makeUnmanagedBI
(
biType
);
fill
(
bi
);
test
(
bi
,
viType
);
}
}
}
private
static
void
test
(
BufferedImage
bi
,
int
type
)
throws
IOException
{
GraphicsEnvironment
ge
=
GraphicsEnvironment
.
getLocalGraphicsEnvironment
();
GraphicsConfiguration
gc
=
ge
.
getDefaultScreenDevice
()
.
getDefaultConfiguration
();
VolatileImage
vi
=
gc
.
createCompatibleVolatileImage
(
511
,
255
,
type
);
BufferedImage
gold
=
gc
.
createCompatibleImage
(
511
,
255
,
type
);
// draw to compatible Image
Graphics2D
big
=
gold
.
createGraphics
();
// force scaled blit
big
.
drawImage
(
bi
,
7
,
11
,
127
,
111
,
7
,
11
,
127
*
2
,
111
,
null
);
big
.
dispose
();
// draw to volatile image
BufferedImage
snapshot
;
while
(
true
)
{
vi
.
validate
(
gc
);
if
(
vi
.
validate
(
gc
)
!=
VolatileImage
.
IMAGE_OK
)
{
try
{
Thread
.
sleep
(
100
);
}
catch
(
final
InterruptedException
ignored
)
{
}
continue
;
}
Graphics2D
vig
=
vi
.
createGraphics
();
// force scaled blit
vig
.
drawImage
(
bi
,
7
,
11
,
127
,
111
,
7
,
11
,
127
*
2
,
111
,
null
);
vig
.
dispose
();
snapshot
=
vi
.
getSnapshot
();
if
(
vi
.
contentsLost
())
{
try
{
Thread
.
sleep
(
100
);
}
catch
(
final
InterruptedException
ignored
)
{
}
continue
;
}
break
;
}
// validate images
for
(
int
x
=
7
;
x
<
127
;
++
x
)
{
for
(
int
y
=
11
;
y
<
111
;
++
y
)
{
if
(
gold
.
getRGB
(
x
,
y
)
!=
snapshot
.
getRGB
(
x
,
y
))
{
ImageIO
.
write
(
gold
,
"png"
,
new
File
(
"gold.png"
));
ImageIO
.
write
(
snapshot
,
"png"
,
new
File
(
"bi.png"
));
throw
new
RuntimeException
(
"Test failed."
);
}
}
}
}
private
static
BufferedImage
makeUnmanagedBI
(
final
int
type
)
{
final
BufferedImage
bi
=
new
BufferedImage
(
511
,
255
,
type
);
final
DataBuffer
db
=
bi
.
getRaster
().
getDataBuffer
();
if
(
db
instanceof
DataBufferInt
)
{
((
DataBufferInt
)
db
).
getData
();
}
else
if
(
db
instanceof
DataBufferShort
)
{
((
DataBufferShort
)
db
).
getData
();
}
else
if
(
db
instanceof
DataBufferByte
)
{
((
DataBufferByte
)
db
).
getData
();
}
else
{
try
{
bi
.
setAccelerationPriority
(
0.0f
);
}
catch
(
final
Throwable
ignored
)
{
}
}
return
bi
;
}
private
static
void
fill
(
final
Image
image
)
{
final
Graphics2D
graphics
=
(
Graphics2D
)
image
.
getGraphics
();
graphics
.
setComposite
(
AlphaComposite
.
Src
);
for
(
int
i
=
0
;
i
<
image
.
getHeight
(
null
);
++
i
)
{
graphics
.
setColor
(
new
Color
(
i
,
0
,
0
));
graphics
.
fillRect
(
0
,
i
,
image
.
getWidth
(
null
),
1
);
}
graphics
.
dispose
();
}
}
test/java/awt/image/DrawImage/UnmanagedDrawImagePerformance.java
0 → 100644
浏览文件 @
95184625
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import
java.awt.AlphaComposite
;
import
java.awt.Graphics2D
;
import
java.awt.GraphicsConfiguration
;
import
java.awt.GraphicsDevice
;
import
java.awt.GraphicsEnvironment
;
import
java.awt.Image
;
import
java.awt.Polygon
;
import
java.awt.geom.AffineTransform
;
import
java.awt.image.BufferedImage
;
import
java.awt.image.DataBuffer
;
import
java.awt.image.DataBufferByte
;
import
java.awt.image.DataBufferInt
;
import
java.awt.image.DataBufferShort
;
import
java.awt.image.VolatileImage
;
import
static
java
.
awt
.
Transparency
.*;
import
static
java
.
awt
.
image
.
BufferedImage
.*;
/*
* @test
* @bug 8029253 8059941
* @summary Unmanaged images should be drawn fast.
* @author Sergey Bylokhov
*/
public
final
class
UnmanagedDrawImagePerformance
{
private
static
final
int
[]
TYPES
=
{
TYPE_INT_RGB
,
TYPE_INT_ARGB
,
TYPE_INT_ARGB_PRE
,
TYPE_INT_BGR
,
TYPE_3BYTE_BGR
,
TYPE_4BYTE_ABGR
,
TYPE_4BYTE_ABGR_PRE
,
TYPE_USHORT_565_RGB
,
TYPE_USHORT_555_RGB
,
TYPE_BYTE_GRAY
,
TYPE_USHORT_GRAY
,
TYPE_BYTE_BINARY
,
TYPE_BYTE_INDEXED
};
private
static
final
int
[]
TRANSPARENCIES
=
{
OPAQUE
,
BITMASK
,
TRANSLUCENT
};
private
static
final
int
SIZE
=
1000
;
private
static
final
AffineTransform
[]
TRANSFORMS
=
{
AffineTransform
.
getScaleInstance
(.
5
,
.
5
),
AffineTransform
.
getScaleInstance
(
1
,
1
),
AffineTransform
.
getScaleInstance
(
2
,
2
),
AffineTransform
.
getShearInstance
(
7
,
11
)};
public
static
void
main
(
final
String
[]
args
)
{
for
(
final
AffineTransform
atfm
:
TRANSFORMS
)
{
for
(
final
int
viType
:
TRANSPARENCIES
)
{
for
(
final
int
biType
:
TYPES
)
{
final
BufferedImage
bi
=
makeUnmanagedBI
(
biType
);
final
VolatileImage
vi
=
makeVI
(
viType
);
final
long
time
=
test
(
bi
,
vi
,
atfm
)
/
1000000000
;
if
(
time
>
1
)
{
throw
new
RuntimeException
(
String
.
format
(
"drawImage is slow: %d seconds"
,
time
));
}
}
}
}
}
private
static
long
test
(
Image
bi
,
Image
vi
,
AffineTransform
atfm
)
{
final
Polygon
p
=
new
Polygon
();
p
.
addPoint
(
0
,
0
);
p
.
addPoint
(
SIZE
,
0
);
p
.
addPoint
(
0
,
SIZE
);
p
.
addPoint
(
SIZE
,
SIZE
);
p
.
addPoint
(
0
,
0
);
Graphics2D
g2d
=
(
Graphics2D
)
vi
.
getGraphics
();
g2d
.
clip
(
p
);
g2d
.
transform
(
atfm
);
g2d
.
setComposite
(
AlphaComposite
.
SrcOver
);
final
long
start
=
System
.
nanoTime
();
g2d
.
drawImage
(
bi
,
0
,
0
,
null
);
final
long
time
=
System
.
nanoTime
()
-
start
;
g2d
.
dispose
();
return
time
;
}
private
static
VolatileImage
makeVI
(
final
int
type
)
{
final
GraphicsEnvironment
ge
=
GraphicsEnvironment
.
getLocalGraphicsEnvironment
();
final
GraphicsDevice
gd
=
ge
.
getDefaultScreenDevice
();
final
GraphicsConfiguration
gc
=
gd
.
getDefaultConfiguration
();
return
gc
.
createCompatibleVolatileImage
(
SIZE
,
SIZE
,
type
);
}
private
static
BufferedImage
makeUnmanagedBI
(
final
int
type
)
{
final
BufferedImage
img
=
new
BufferedImage
(
SIZE
,
SIZE
,
type
);
final
DataBuffer
db
=
img
.
getRaster
().
getDataBuffer
();
if
(
db
instanceof
DataBufferInt
)
{
((
DataBufferInt
)
db
).
getData
();
}
else
if
(
db
instanceof
DataBufferShort
)
{
((
DataBufferShort
)
db
).
getData
();
}
else
if
(
db
instanceof
DataBufferByte
)
{
((
DataBufferByte
)
db
).
getData
();
}
else
{
try
{
img
.
setAccelerationPriority
(
0.0f
);
}
catch
(
final
Throwable
ignored
)
{
}
}
return
img
;
}
}
test/java/beans/Introspector/Test4168833.java
浏览文件 @
95184625
/*
* Copyright (c) 2003, 20
07
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
14
, 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
...
...
@@ -23,10 +23,11 @@
/*
* @test
* @bug 4168833
* @bug 4168833
8034085
* @summary Tests that Introspector does not create IndexedPropertyDescriptor
* from non-indexed PropertyDescriptor
* @author Mark Davidson
* @author Sergey Malenkov
*/
import
java.awt.Color
;
...
...
@@ -42,10 +43,6 @@ import java.beans.PropertyDescriptor;
*/
public
class
Test4168833
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
IndexedPropertyDescriptor
ipd
=
BeanUtils
.
getIndexedPropertyDescriptor
(
Base
.
class
,
"prop"
);
if
(!
ipd
.
getIndexedPropertyType
().
equals
(
Dimension
.
class
))
{
error
(
ipd
,
"Base.prop property should a Dimension"
);
}
// When the Sub class is introspected,
// the property type should be color.
// The complete "classic" set of properties
...
...
test/java/beans/Introspector/Test8034085.java
0 → 100644
浏览文件 @
95184625
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import
java.awt.Window
;
import
java.beans.IndexedPropertyDescriptor
;
import
java.beans.PropertyDescriptor
;
/*
* @test
* @bug 8034085
* @summary Tests that Introspector ignores indexed getter and setter for incorrect types
* @author Sergey Malenkov
*/
public
class
Test8034085
{
public
static
final
StringBuilder
ERROR
=
new
StringBuilder
();
public
static
void
main
(
String
[]
args
)
{
test
(
Window
.
class
,
false
,
true
,
false
,
false
);
test
(
Bean0000
.
class
,
false
,
false
,
false
,
false
);
test
(
Bean0001
.
class
,
false
,
false
,
false
,
true
);
test
(
Bean0010
.
class
,
false
,
false
,
true
,
false
);
test
(
Bean0011
.
class
,
false
,
false
,
true
,
true
);
test
(
Bean0100
.
class
,
false
,
true
,
false
,
false
);
test
(
Bean0101
.
class
,
false
,
true
,
false
,
false
);
test
(
Bean0110
.
class
,
false
,
true
,
false
,
false
);
test
(
Bean0111
.
class
,
false
,
true
,
false
,
false
);
test
(
Bean1000
.
class
,
true
,
false
,
false
,
false
);
test
(
Bean1001
.
class
,
true
,
false
,
false
,
false
);
test
(
Bean1010
.
class
,
true
,
false
,
false
,
false
);
test
(
Bean1011
.
class
,
true
,
false
,
false
,
false
);
test
(
Bean1100
.
class
,
true
,
true
,
false
,
false
);
test
(
Bean1101
.
class
,
true
,
true
,
false
,
false
);
test
(
Bean1110
.
class
,
true
,
true
,
false
,
false
);
test
(
Bean1111
.
class
,
true
,
true
,
false
,
false
);
if
(
0
<
ERROR
.
length
())
{
throw
new
Error
(
ERROR
.
toString
());
}
}
private
static
void
test
(
Class
<?>
type
,
boolean
read
,
boolean
write
,
boolean
readIndexed
,
boolean
writeIndexed
)
{
PropertyDescriptor
pd
=
BeanUtils
.
findPropertyDescriptor
(
type
,
"size"
);
if
(
pd
!=
null
)
{
test
(
type
,
"read"
,
read
,
null
!=
pd
.
getReadMethod
());
test
(
type
,
"write"
,
write
,
null
!=
pd
.
getWriteMethod
());
if
(
pd
instanceof
IndexedPropertyDescriptor
)
{
IndexedPropertyDescriptor
ipd
=
(
IndexedPropertyDescriptor
)
pd
;
test
(
type
,
"indexed read"
,
readIndexed
,
null
!=
ipd
.
getIndexedReadMethod
());
test
(
type
,
"indexed write"
,
writeIndexed
,
null
!=
ipd
.
getIndexedWriteMethod
());
}
else
if
(
readIndexed
||
writeIndexed
)
{
error
(
type
,
"indexed property does not exist"
);
}
}
else
if
(
read
||
write
||
readIndexed
||
writeIndexed
)
{
error
(
type
,
"property does not exist"
);
}
}
private
static
void
test
(
Class
<?>
type
,
String
name
,
boolean
expected
,
boolean
actual
)
{
if
(
expected
&&
!
actual
)
{
error
(
type
,
name
+
" method does not exist"
);
}
else
if
(!
expected
&&
actual
)
{
error
(
type
,
name
+
" method is not expected"
);
}
}
private
static
void
error
(
Class
<?>
type
,
String
message
)
{
ERROR
.
append
(
"\n\t\t"
).
append
(
type
.
getSimpleName
()).
append
(
".size: "
).
append
(
message
);
}
public
static
class
Bean0000
{
}
public
static
class
Bean0001
{
public
void
setSize
(
int
index
,
int
value
)
{
}
}
public
static
class
Bean0010
{
public
int
getSize
(
int
index
)
{
return
0
;
}
}
public
static
class
Bean0011
{
public
int
getSize
(
int
index
)
{
return
0
;
}
public
void
setSize
(
int
index
,
int
value
)
{
}
}
public
static
class
Bean0100
{
public
void
setSize
(
int
value
)
{
}
}
public
static
class
Bean0101
{
public
void
setSize
(
int
value
)
{
}
public
void
setSize
(
int
index
,
int
value
)
{
}
}
public
static
class
Bean0110
{
public
void
setSize
(
int
value
)
{
}
public
int
getSize
(
int
index
)
{
return
0
;
}
}
public
static
class
Bean0111
{
public
void
setSize
(
int
value
)
{
}
public
int
getSize
(
int
index
)
{
return
0
;
}
public
void
setSize
(
int
index
,
int
value
)
{
}
}
public
static
class
Bean1000
{
public
int
getSize
()
{
return
0
;
}
}
public
static
class
Bean1001
{
public
int
getSize
()
{
return
0
;
}
public
void
setSize
(
int
index
,
int
value
)
{
}
}
public
static
class
Bean1010
{
public
int
getSize
()
{
return
0
;
}
public
int
getSize
(
int
index
)
{
return
0
;
}
}
public
static
class
Bean1011
{
public
int
getSize
()
{
return
0
;
}
public
int
getSize
(
int
index
)
{
return
0
;
}
public
void
setSize
(
int
index
,
int
value
)
{
}
}
public
static
class
Bean1100
{
public
int
getSize
()
{
return
0
;
}
public
void
setSize
(
int
value
)
{
}
}
public
static
class
Bean1101
{
public
int
getSize
()
{
return
0
;
}
public
void
setSize
(
int
value
)
{
}
public
void
setSize
(
int
index
,
int
value
)
{
}
}
public
static
class
Bean1110
{
public
int
getSize
()
{
return
0
;
}
public
void
setSize
(
int
value
)
{
}
public
int
getSize
(
int
index
)
{
return
0
;
}
}
public
static
class
Bean1111
{
public
int
getSize
()
{
return
0
;
}
public
void
setSize
(
int
value
)
{
}
public
int
getSize
(
int
index
)
{
return
0
;
}
public
void
setSize
(
int
index
,
int
value
)
{
}
}
}
test/java/beans/Introspector/Test8034164.java
0 → 100644
浏览文件 @
95184625
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import
java.beans.IndexedPropertyDescriptor
;
import
java.beans.PropertyDescriptor
;
/*
* @test
* @bug 8034164
* @summary Tests that Introspector does not ignore indexed getter and setter for correct types
* @author Sergey Malenkov
*/
public
class
Test8034164
{
public
static
final
StringBuilder
ERROR
=
new
StringBuilder
();
public
static
void
main
(
String
[]
args
)
{
test
(
Bean0000
.
class
,
false
,
false
,
false
,
false
);
test
(
Bean0001
.
class
,
false
,
false
,
false
,
true
);
test
(
Bean0010
.
class
,
false
,
false
,
true
,
false
);
test
(
Bean0011
.
class
,
false
,
false
,
true
,
true
);
test
(
Bean0100
.
class
,
false
,
true
,
false
,
false
);
test
(
Bean0101
.
class
,
false
,
true
,
false
,
true
);
test
(
Bean0110
.
class
,
false
,
true
,
true
,
false
);
test
(
Bean0111
.
class
,
false
,
true
,
true
,
true
);
test
(
Bean1000
.
class
,
true
,
false
,
false
,
false
);
test
(
Bean1001
.
class
,
true
,
false
,
false
,
true
);
test
(
Bean1010
.
class
,
true
,
false
,
true
,
false
);
test
(
Bean1011
.
class
,
true
,
false
,
true
,
true
);
test
(
Bean1100
.
class
,
true
,
true
,
false
,
false
);
test
(
Bean1101
.
class
,
true
,
true
,
false
,
true
);
test
(
Bean1110
.
class
,
true
,
true
,
true
,
false
);
test
(
Bean1111
.
class
,
true
,
true
,
true
,
true
);
if
(
0
<
ERROR
.
length
())
{
throw
new
Error
(
ERROR
.
toString
());
}
}
private
static
void
test
(
Class
<?>
type
,
boolean
read
,
boolean
write
,
boolean
readIndexed
,
boolean
writeIndexed
)
{
PropertyDescriptor
pd
=
BeanUtils
.
findPropertyDescriptor
(
type
,
"size"
);
if
(
pd
!=
null
)
{
test
(
type
,
"read"
,
read
,
null
!=
pd
.
getReadMethod
());
test
(
type
,
"write"
,
write
,
null
!=
pd
.
getWriteMethod
());
if
(
pd
instanceof
IndexedPropertyDescriptor
)
{
IndexedPropertyDescriptor
ipd
=
(
IndexedPropertyDescriptor
)
pd
;
test
(
type
,
"indexed read"
,
readIndexed
,
null
!=
ipd
.
getIndexedReadMethod
());
test
(
type
,
"indexed write"
,
writeIndexed
,
null
!=
ipd
.
getIndexedWriteMethod
());
}
else
if
(
readIndexed
||
writeIndexed
)
{
error
(
type
,
"indexed property does not exist"
);
}
}
else
if
(
read
||
write
||
readIndexed
||
writeIndexed
)
{
error
(
type
,
"property does not exist"
);
}
}
private
static
void
test
(
Class
<?>
type
,
String
name
,
boolean
expected
,
boolean
actual
)
{
if
(
expected
&&
!
actual
)
{
error
(
type
,
name
+
" method does not exist"
);
}
else
if
(!
expected
&&
actual
)
{
error
(
type
,
name
+
" method is not expected"
);
}
}
private
static
void
error
(
Class
<?>
type
,
String
message
)
{
ERROR
.
append
(
"\n\t\t"
).
append
(
type
.
getSimpleName
()).
append
(
".size: "
).
append
(
message
);
}
public
static
class
Bean0000
{
}
public
static
class
Bean0001
{
public
void
setSize
(
int
index
,
int
value
)
{
}
}
public
static
class
Bean0010
{
public
int
getSize
(
int
index
)
{
return
0
;
}
}
public
static
class
Bean0011
{
public
int
getSize
(
int
index
)
{
return
0
;
}
public
void
setSize
(
int
index
,
int
value
)
{
}
}
public
static
class
Bean0100
{
public
void
setSize
(
int
[]
value
)
{
}
}
public
static
class
Bean0101
{
public
void
setSize
(
int
[]
value
)
{
}
public
void
setSize
(
int
index
,
int
value
)
{
}
}
public
static
class
Bean0110
{
public
void
setSize
(
int
[]
value
)
{
}
public
int
getSize
(
int
index
)
{
return
0
;
}
}
public
static
class
Bean0111
{
public
void
setSize
(
int
[]
value
)
{
}
public
int
getSize
(
int
index
)
{
return
0
;
}
public
void
setSize
(
int
index
,
int
value
)
{
}
}
public
static
class
Bean1000
{
public
int
[]
getSize
()
{
return
null
;
}
}
public
static
class
Bean1001
{
public
int
[]
getSize
()
{
return
null
;
}
public
void
setSize
(
int
index
,
int
value
)
{
}
}
public
static
class
Bean1010
{
public
int
[]
getSize
()
{
return
null
;
}
public
int
getSize
(
int
index
)
{
return
0
;
}
}
public
static
class
Bean1011
{
public
int
[]
getSize
()
{
return
null
;
}
public
int
getSize
(
int
index
)
{
return
0
;
}
public
void
setSize
(
int
index
,
int
value
)
{
}
}
public
static
class
Bean1100
{
public
int
[]
getSize
()
{
return
null
;
}
public
void
setSize
(
int
[]
value
)
{
}
}
public
static
class
Bean1101
{
public
int
[]
getSize
()
{
return
null
;
}
public
void
setSize
(
int
[]
value
)
{
}
public
void
setSize
(
int
index
,
int
value
)
{
}
}
public
static
class
Bean1110
{
public
int
[]
getSize
()
{
return
null
;
}
public
void
setSize
(
int
[]
value
)
{
}
public
int
getSize
(
int
index
)
{
return
0
;
}
}
public
static
class
Bean1111
{
public
int
[]
getSize
()
{
return
null
;
}
public
void
setSize
(
int
[]
value
)
{
}
public
int
getSize
(
int
index
)
{
return
0
;
}
public
void
setSize
(
int
index
,
int
value
)
{
}
}
}
test/java/lang/instrument/DaemonThread/TestDaemonThread.java
浏览文件 @
95184625
...
...
@@ -28,7 +28,7 @@
*
* @build jdk.testlibrary.* DummyAgent DummyClass TestDaemonThreadLauncher TestDaemonThread
* @run shell ../MakeJAR3.sh DummyAgent
* @run main
TestDaemonThreadLauncher /timeout=240
* @run main
/timeout=240 TestDaemonThreadLauncher
*
*/
import
java.io.File
;
...
...
test/java/lang/invoke/LFCaching/LFGarbageCollectedTest.java
浏览文件 @
95184625
...
...
@@ -31,7 +31,7 @@
* @build TestMethods
* @build LambdaFormTestCase
* @build LFGarbageCollectedTest
* @run main/othervm/timeout=600 -D
java.lang.invoke.MethodHandle.USE_LF_EDITOR=true -D
testLimit=150 LFGarbageCollectedTest
* @run main/othervm/timeout=600 -DtestLimit=150 LFGarbageCollectedTest
*/
import
java.lang.invoke.MethodHandle
;
...
...
test/java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java
浏览文件 @
95184625
...
...
@@ -31,7 +31,7 @@
* @build LambdaFormTestCase
* @build LFCachingTestCase
* @build LFMultiThreadCachingTest
* @run main/othervm/timeout=300
-Djava.lang.invoke.MethodHandle.USE_LF_EDITOR=true
LFMultiThreadCachingTest
* @run main/othervm/timeout=300 LFMultiThreadCachingTest
*/
import
java.lang.invoke.MethodHandle
;
...
...
test/java/lang/invoke/LFCaching/LFSingleThreadCachingTest.java
浏览文件 @
95184625
...
...
@@ -31,7 +31,7 @@
* @build LambdaFormTestCase
* @build LFCachingTestCase
* @build LFSingleThreadCachingTest
* @run main/othervm/timeout=300
-Djava.lang.invoke.MethodHandle.USE_LF_EDITOR=true
LFSingleThreadCachingTest
* @run main/othervm/timeout=300 LFSingleThreadCachingTest
*/
import
java.lang.invoke.MethodHandle
;
...
...
test/javax/swing/DataTransfer/8059739/bug8059739.java
0 → 100644
浏览文件 @
95184625
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/* @test
@bug 8059739
@summary Dragged and Dropped data is corrupted for two data types
@author Anton Nashatyrev
*/
import
javax.swing.*
;
import
java.awt.datatransfer.Clipboard
;
import
java.awt.datatransfer.DataFlavor
;
import
java.io.BufferedReader
;
import
java.io.InputStream
;
import
java.io.InputStreamReader
;
public
class
bug8059739
{
private
static
boolean
passed
=
true
;
public
static
void
main
(
String
[]
args
)
throws
Exception
{
SwingUtilities
.
invokeAndWait
(
new
Runnable
()
{
@Override
public
void
run
()
{
try
{
runTest
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
passed
=
false
;
}
}
});
if
(!
passed
)
{
throw
new
RuntimeException
(
"Test FAILED."
);
}
else
{
System
.
out
.
println
(
"Passed."
);
}
}
private
static
void
runTest
()
throws
Exception
{
String
testString
=
"my string"
;
JTextField
tf
=
new
JTextField
(
testString
);
tf
.
selectAll
();
Clipboard
clipboard
=
new
Clipboard
(
"clip"
);
tf
.
getTransferHandler
().
exportToClipboard
(
tf
,
clipboard
,
TransferHandler
.
COPY
);
DataFlavor
[]
dfs
=
clipboard
.
getAvailableDataFlavors
();
for
(
DataFlavor
df:
dfs
)
{
String
charset
=
df
.
getParameter
(
"charset"
);
if
(
InputStream
.
class
.
isAssignableFrom
(
df
.
getRepresentationClass
())
&&
charset
!=
null
)
{
BufferedReader
br
=
new
BufferedReader
(
new
InputStreamReader
(
(
InputStream
)
clipboard
.
getData
(
df
),
charset
));
String
s
=
br
.
readLine
();
System
.
out
.
println
(
"Content: '"
+
s
+
"'"
);
passed
&=
s
.
contains
(
testString
);
}
}
}
}
test/javax/swing/JComboBox/Consumed
EscTest/ConsumedEsc
Test.java
→
test/javax/swing/JComboBox/Consumed
KeyTest/ConsumedKey
Test.java
浏览文件 @
95184625
...
...
@@ -24,22 +24,28 @@
import
javax.swing.*
;
import
java.awt.event.ActionEvent
;
import
java.awt.event.KeyEvent
;
import
java.awt.Robot
;
import
java.awt.Toolkit
;
import
java.awt.Robot
;
import
sun.awt.SunToolkit
;
/*
@test
@bug 8031485
@bug 8031485
8058193
@summary Combo box consuming escape and enter key events
@author Petr Pchelko
@run main Consumed
Esc
Test
@run main Consumed
Key
Test
*/
public
class
Consumed
Esc
Test
{
public
class
Consumed
Key
Test
{
private
static
volatile
JFrame
frame
;
private
static
volatile
boolean
passed
=
false
;
private
static
volatile
boolean
passed
;
public
static
void
main
(
String
...
args
)
throws
Exception
{
test
(
KeyEvent
.
VK_ESCAPE
);
test
(
KeyEvent
.
VK_ENTER
);
}
private
static
void
test
(
final
int
key
)
throws
Exception
{
passed
=
false
;
try
{
SwingUtilities
.
invokeAndWait
(()
->
{
frame
=
new
JFrame
();
...
...
@@ -48,7 +54,7 @@ public class ConsumedEscTest {
panel
.
add
(
combo
);
combo
.
requestFocusInWindow
();
frame
.
setBounds
(
100
,
150
,
300
,
100
);
addAction
(
panel
);
addAction
(
panel
,
key
);
frame
.
add
(
panel
);
frame
.
setVisible
(
true
);
});
...
...
@@ -56,24 +62,25 @@ public class ConsumedEscTest {
Robot
robot
=
new
Robot
();
robot
.
waitForIdle
();
((
SunToolkit
)
Toolkit
.
getDefaultToolkit
()).
realSync
();
robot
.
keyPress
(
KeyEvent
.
VK_ESCAPE
);
robot
.
keyPress
(
key
);
robot
.
waitForIdle
();
((
SunToolkit
)
Toolkit
.
getDefaultToolkit
()).
realSync
();
robot
.
keyRelease
(
KeyEvent
.
VK_ESCAPE
);
robot
.
keyRelease
(
key
);
robot
.
waitForIdle
();
((
SunToolkit
)
Toolkit
.
getDefaultToolkit
()).
realSync
();
if
(!
passed
)
{
throw
new
RuntimeException
(
"FAILED:
ESC
was consumed by combo box"
);
throw
new
RuntimeException
(
"FAILED:
"
+
KeyEvent
.
getKeyText
(
key
)
+
"
was consumed by combo box"
);
}
}
finally
{
if
(
frame
!=
null
)
{
frame
.
dispose
();
}
}
}
private
static
void
addAction
(
JComponent
comp
)
{
KeyStroke
k
=
KeyStroke
.
getKeyStroke
(
KeyEvent
.
VK_ESCAPE
,
0
);
private
static
void
addAction
(
JComponent
comp
,
final
int
key
)
{
KeyStroke
k
=
KeyStroke
.
getKeyStroke
(
key
,
0
);
Object
actionKey
=
"cancel"
;
comp
.
getInputMap
(
JComponent
.
WHEN_ANCESTOR_OF_FOCUSED_COMPONENT
).
put
(
k
,
actionKey
);
Action
cancelAction
=
new
AbstractAction
()
{
...
...
@@ -84,5 +91,4 @@ public class ConsumedEscTest {
};
comp
.
getActionMap
().
put
(
actionKey
,
cancelAction
);
}
}
test/sun/java2d/DirectX/OnScreenRenderingResizeTest/OnScreenRenderingResizeTest.java
浏览文件 @
95184625
/*
* Copyright (c) 2007, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 201
4
, 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
...
...
@@ -89,8 +89,13 @@ public class OnScreenRenderingResizeTest {
public
void
update
(
Graphics
g
)
{}
};
frame
.
setBackground
(
bgColor
);
frame
.
setUndecorated
(
true
);
frame
.
pack
();
frame
.
setSize
(
FRAME_W
,
FRAME_H
);
GraphicsConfiguration
gc
=
frame
.
getGraphicsConfiguration
();
Rectangle
gcBounds
=
gc
.
getBounds
();
frame
.
setBounds
(
gcBounds
.
width
/
4
,
gcBounds
.
height
/
4
,
FRAME_W
,
FRAME_H
);
frame
.
addWindowListener
(
new
WindowAdapter
()
{
public
void
windowClosing
(
WindowEvent
e
)
{
done
=
true
;
...
...
@@ -108,9 +113,8 @@ public class OnScreenRenderingResizeTest {
ex
.
printStackTrace
();
}
GraphicsConfiguration
gc
=
frame
.
getGraphicsConfiguration
();
int
maxW
=
gc
.
getBounds
().
width
/
2
;
int
maxH
=
gc
.
getBounds
().
height
/
2
;
int
maxW
=
gcBounds
.
width
/
2
;
int
maxH
=
gcBounds
.
height
/
2
;
int
minW
=
frame
.
getWidth
();
int
minH
=
frame
.
getHeight
();
int
incW
=
10
,
incH
=
10
,
cnt
=
0
;
...
...
@@ -155,6 +159,7 @@ public class OnScreenRenderingResizeTest {
Insets
in
=
frame
.
getInsets
();
frame
.
getGraphics
().
drawImage
(
output
,
in
.
left
,
in
.
top
,
null
);
if
(
cnt
==
90
&&
robot
!=
null
)
{
robot
.
waitForIdle
();
// area where we blitted to should be either white or green
Point
p
=
frame
.
getLocationOnScreen
();
p
.
translate
(
in
.
left
+
10
,
in
.
top
+
10
);
...
...
@@ -172,7 +177,7 @@ public class OnScreenRenderingResizeTest {
frame
.
getWidth
()-
in
.
left
-
in
.
right
,
frame
.
getHeight
()-
in
.
top
-
in
.
bottom
-
5
-
IMAGE_H
));
int
accepted2
[]
=
{
Color
.
white
.
getRGB
()
};
checkBI
(
bi
,
accepted
1
);
checkBI
(
bi
,
accepted
2
);
}
Thread
.
yield
();
...
...
test/sun/net/www/http/HttpClient/StreamingRetry.java
浏览文件 @
95184625
...
...
@@ -23,8 +23,8 @@
/*
* @test
* @bug 6672144
* @summary
HttpURLConnection.getInputStream sends POST request after failed chunked send
* @bug 6672144
8050983
* @summary
Do not retry failed request with a streaming body.
*/
import
java.net.HttpURLConnection
;
...
...
@@ -33,6 +33,7 @@ import java.net.URL;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.OutputStream
;
import
static
java
.
lang
.
System
.
out
;
public
class
StreamingRetry
implements
Runnable
{
static
final
int
ACCEPT_TIMEOUT
=
20
*
1000
;
// 20 seconds
...
...
@@ -43,11 +44,17 @@ public class StreamingRetry implements Runnable {
}
void
instanceMain
()
throws
IOException
{
test
();
out
.
println
(
"Test with default method"
);
test
(
null
);
out
.
println
(
"Test with POST method"
);
test
(
"POST"
);
out
.
println
(
"Test with PUT method"
);
test
(
"PUT"
);
if
(
failed
>
0
)
throw
new
RuntimeException
(
"Some tests failed"
);
}
void
test
()
throws
IOException
{
void
test
(
String
method
)
throws
IOException
{
ss
=
new
ServerSocket
(
0
);
ss
.
setSoTimeout
(
ACCEPT_TIMEOUT
);
int
port
=
ss
.
getLocalPort
();
...
...
@@ -58,6 +65,8 @@ public class StreamingRetry implements Runnable {
URL
url
=
new
URL
(
"http://localhost:"
+
port
+
"/"
);
HttpURLConnection
uc
=
(
HttpURLConnection
)
url
.
openConnection
();
uc
.
setDoOutput
(
true
);
if
(
method
!=
null
)
uc
.
setRequestMethod
(
method
);
uc
.
setChunkedStreamingMode
(
4096
);
OutputStream
os
=
uc
.
getOutputStream
();
os
.
write
(
"Hello there"
.
getBytes
());
...
...
@@ -79,7 +88,7 @@ public class StreamingRetry implements Runnable {
ss
.
close
();
fail
(
"The server shouldn't accept a second connection"
);
}
catch
(
IOException
e
)
{
//OK, the clien
will close the server socket if successful
l
//OK, the clien
t will close the server socket if successfu
l
}
}
...
...
test/sun/util/calendar/zi/tzdata/VERSION
浏览文件 @
95184625
...
...
@@ -21,4 +21,4 @@
# or visit www.oracle.com if you need additional information or have any
# questions.
#
tzdata2014
g
tzdata2014
j
test/sun/util/calendar/zi/tzdata/africa
浏览文件 @
95184625
...
...
@@ -29,20 +29,19 @@
# tz@iana.org for general use in the future). For more, please see
# the file CONTRIBUTING in the tz distribution.
# From Paul Eggert (201
3-02-2
1):
# From Paul Eggert (201
4-10-3
1):
#
#
A good source for time zone historical data outside the U.S. is
#
Unless otherwise specified, the source for data through 1990 is:
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
# San Diego: ACS Publications, Inc. (2003).
# Unfortunately this book contains many errors and cites no sources.
#
# 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),
# published semiannually. Law sent in several helpful summaries
# of the IATA's data after 1990.
#
# Except where otherwise noted, Shanks & Pottenger is the source for
# entries through 1990, and IATA SSIM is the source for entries afterwards.
# of the IATA's data after 1990. Except where otherwise noted,
# IATA SSIM is the source for entries after 1990.
#
# Another source occasionally used is Edward W. Whitman, World Time Differences,
# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which
...
...
@@ -88,7 +87,6 @@
# 3:00 CAST Central Africa Summer Time (no longer used)
# 3:00 SAST South Africa Summer Time (no longer used)
# 3:00 EAT East Africa Time
# 4:00 EAST East Africa Summer Time (no longer used)
# Algeria
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
...
...
@@ -133,23 +131,13 @@ Zone Africa/Algiers 0:12:12 - LMT 1891 Mar 15 0:01
# See Africa/Lagos.
# 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
# See Africa/Maputo.
# Burkina Faso
# See Africa/Abidjan.
# Burundi
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Bujumbura 1:57:28 - LMT 1890
2:00 - CAT
# See Africa/Maputo.
# Cameroon
# See Africa/Lagos.
...
...
@@ -179,15 +167,10 @@ Zone Africa/Ndjamena 1:00:12 - LMT 1912 # N'Djamena
1:00 - WAT
# Comoros
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Indian/Comoro 2:53:04 - LMT 1911 Jul # Moroni, Gran Comoro
3:00 - EAT
# See Africa/Nairobi.
# Democratic Republic of the Congo
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Lubumbashi 1:49:52 - LMT 1897 Nov 9
2:00 - CAT
# The above is for the eastern part; see Africa/Lagos for the western part.
# See Africa/Lagos for the western part and Africa/Maputo for the eastern.
# Republic of the Congo
# See Africa/Lagos.
...
...
@@ -208,9 +191,7 @@ Link Africa/Abidjan Africa/Sao_Tome # São Tomé and Príncipe
Link Africa/Abidjan Atlantic/St_Helena # St Helena
# Djibouti
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Djibouti 2:52:36 - LMT 1911 Jul
3:00 - EAT
# See Africa/Nairobi.
###############################################################################
...
...
@@ -339,7 +320,7 @@ Rule Egypt 2007 only - Sep Thu>=1 24:00 0 -
# Egypt is to change back to Daylight system on May 15
# http://english.ahram.org.eg/NewsContent/1/64/100735/Egypt/Politics-/Egypts-government-to-reapply-daylight-saving-time-.aspx
# From Gunther Vermier (201
5
-05-13):
# From Gunther Vermier (201
4
-05-13):
# our Egypt office confirms that the change will be at 15 May "midnight" (24:00)
# From Imed Chihi (2014-06-04):
...
...
@@ -423,27 +404,8 @@ Zone Africa/Cairo 2:05:09 - LMT 1900 Oct
# See Africa/Lagos.
# Eritrea
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Asmara 2:35:32 - LMT 1870
2:35:32 - AMT 1890 # Asmara Mean Time
2:35:20 - ADMT 1936 May 5 # Adis Dera MT
3:00 - EAT
# Ethiopia
# From Paul Eggert (2014-07-31):
# Like the Swahili of Kenya and Tanzania, many Ethiopians keep a
# 12-hour clock starting at our 06:00, so their "8 o'clock" is our
# 02:00 or 14:00. Keep this in mind when you ask the time in Amharic.
#
# Shanks & Pottenger write that Ethiopia had six narrowly-spaced time
# zones between 1870 and 1890, that they merged to 38E50 (2:35:20) in
# 1890, and that they switched to 3:00 on 1936-05-05. Perhaps 38E50
# was for Adis Dera. Quite likely the Shanks data entries are wrong
# anyway.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Addis_Ababa 2:34:48 - LMT 1870
2:35:20 - ADMT 1936 May 5 # Adis Dera MT
3:00 - EAT
# See Africa/Nairobi.
# Gabon
# See Africa/Lagos.
...
...
@@ -487,13 +449,18 @@ Zone Africa/Nairobi 2:27:16 - LMT 1928 Jul
2:30 - BEAT 1940
2:45 - BEAUT 1960
3:00 - EAT
Link Africa/Nairobi Africa/Addis_Ababa # Ethiopia
Link Africa/Nairobi Africa/Asmara # Eritrea
Link Africa/Nairobi Africa/Dar_es_Salaam # Tanzania
Link Africa/Nairobi Africa/Djibouti
Link Africa/Nairobi Africa/Kampala # Uganda
Link Africa/Nairobi Africa/Mogadishu # Somalia
Link Africa/Nairobi Indian/Antananarivo # Madagascar
Link Africa/Nairobi Indian/Comoro
Link Africa/Nairobi Indian/Mayotte
# Lesotho
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Maseru 1:50:00 - LMT 1903 Mar
2:00 - SAST 1943 Sep 19 2:00
2:00 1:00 SAST 1944 Mar 19 2:00
2:00 - SAST
# See Africa/Johannesburg.
# Liberia
# From Paul Eggert (2006-03-22):
...
...
@@ -568,16 +535,10 @@ Zone Africa/Tripoli 0:52:44 - LMT 1920
2:00 - EET
# Madagascar
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Indian/Antananarivo 3:10:04 - LMT 1911 Jul
3:00 - EAT 1954 Feb 27 23:00s
3:00 1:00 EAST 1954 May 29 23:00s
3:00 - EAT
# See Africa/Nairobi.
# Malawi
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Blantyre 2:20:00 - LMT 1903 Mar
2:00 - CAT
# See Africa/Maputo.
# Mali
# Mauritania
...
...
@@ -677,9 +638,7 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis
# no information; probably like Indian/Mauritius
# Mayotte
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou
3:00 - EAT
# See Africa/Nairobi.
# Morocco
# See the 'europe' file for Spanish Morocco (Africa/Ceuta).
...
...
@@ -987,6 +946,13 @@ Zone Africa/El_Aaiun -0:52:48 - LMT 1934 Jan # El Aaiún
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Maputo 2:10:20 - LMT 1903 Mar
2:00 - CAT
Link Africa/Maputo Africa/Blantyre # Malawi
Link Africa/Maputo Africa/Bujumbura # Burundi
Link Africa/Maputo Africa/Gaborone # Botswana
Link Africa/Maputo Africa/Harare # Zimbabwe
Link Africa/Maputo Africa/Kigali # Rwanda
Link Africa/Maputo Africa/Lubumbashi # E Dem. Rep. of Congo
Link Africa/Maputo Africa/Lusaka # Zambia
# Namibia
# The 1994-04-03 transition is from Shanks & Pottenger.
...
...
@@ -1054,9 +1020,7 @@ Zone Indian/Reunion 3:41:52 - LMT 1911 Jun # Saint-Denis
# Tromelin - inhabited until at least 1958
# Rwanda
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Kigali 2:00:16 - LMT 1935 Jun
2:00 - CAT
# See Africa/Maputo.
# St Helena
# See Africa/Abidjan.
...
...
@@ -1086,11 +1050,7 @@ Zone Indian/Mahe 3:41:48 - LMT 1906 Jun # Victoria
# See Africa/Abidjan.
# Somalia
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Mogadishu 3:01:28 - LMT 1893 Nov
3:00 - EAT 1931
2:30 - BEAT 1957
3:00 - EAT
# See Africa/Nairobi.
# South Africa
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
...
...
@@ -1100,6 +1060,9 @@ Rule SA 1943 1944 - Mar Sun>=15 2:00 0 -
Zone Africa/Johannesburg 1:52:00 - LMT 1892 Feb 8
1:30 - SAST 1903 Mar
2:00 SA SAST
Link Africa/Johannesburg Africa/Maseru # Lesotho
Link Africa/Johannesburg Africa/Mbabane # Swaziland
#
# Marion and Prince Edward Is
# scientific station since 1947
# no information
...
...
@@ -1127,16 +1090,10 @@ Zone Africa/Khartoum 2:10:08 - LMT 1931
Link Africa/Khartoum Africa/Juba
# Swaziland
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Mbabane 2:04:24 - LMT 1903 Mar
2:00 - SAST
# See Africa/Johannesburg.
# Tanzania
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Dar_es_Salaam 2:37:08 - LMT 1931
3:00 - EAT 1948
2:45 - BEAUT 1961
3:00 - EAT
# See Africa/Nairobi.
# Togo
# See Africa/Abidjan.
...
...
@@ -1242,19 +1199,8 @@ Zone Africa/Tunis 0:40:44 - LMT 1881 May 12
1:00 Tunisia CE%sT
# Uganda
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Kampala 2:09:40 - LMT 1928 Jul
3:00 - EAT 1930
2:30 - BEAT 1948
2:45 - BEAUT 1957
3:00 - EAT
# See Africa/Nairobi.
# Zambia
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Lusaka 1:53:08 - LMT 1903 Mar
2:00 - CAT
# Zimbabwe
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Harare 2:04:12 - LMT 1903 Mar
2:00 - CAT
# See Africa/Maputo.
test/sun/util/calendar/zi/tzdata/asia
浏览文件 @
95184625
...
...
@@ -29,20 +29,19 @@
# tz@iana.org for general use in the future). For more, please see
# the file CONTRIBUTING in the tz distribution.
# From Paul Eggert (201
3-08-1
1):
# From Paul Eggert (201
4-10-3
1):
#
#
A good source for time zone historical data outside the U.S. is
#
Unless otherwise specified, the source for data through 1990 is:
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
# San Diego: ACS Publications, Inc. (2003).
# Unfortunately this book contains many errors and cites no sources.
#
# 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),
# published semiannually. Law sent in several helpful summaries
# of the IATA's data after 1990.
#
# Except where otherwise noted, Shanks & Pottenger is the source for
# entries through 1990, and IATA SSIM is the source for entries afterwards.
# of the IATA's data after 1990. Except where otherwise noted,
# IATA SSIM is the source for entries after 1990.
#
# Another source occasionally used is Edward W. Whitman, World Time Differences,
# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which
...
...
@@ -70,10 +69,11 @@
# 3:30 IRST IRDT Iran
# 4:00 GST Gulf*
# 5:30 IST India
# 7:00 ICT Indochina*
# 7:00 ICT Indochina
, most times and locations
*
# 7:00 WIB west Indonesia (Waktu Indonesia Barat)
# 8:00 WITA central Indonesia (Waktu Indonesia Tengah)
# 8:00 CST China
# 8:00 IDT Indochina, 1943-45, 1947-55, 1960-75 (some locations)*
# 8:00 JWST Western Standard Time (Japan, 1896/1937)*
# 9:00 JCST Central Standard Time (Japan, 1896/1937)
# 9:00 WIT east Indonesia (Waktu Indonesia Timur)
...
...
@@ -294,12 +294,8 @@ Zone Asia/Rangoon 6:24:40 - LMT 1880 # or Yangon
6:30 - MMT # Myanmar Time
# Cambodia
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Phnom_Penh 6:59:40 - LMT 1906 Jun 9
7:06:20 - SMT 1911 Mar 11 0:01 # Saigon MT?
7:00 - ICT 1912 May
8:00 - ICT 1931 May
7:00 - ICT
# See Asia/Bangkok.
# China
...
...
@@ -916,6 +912,10 @@ Zone Asia/Kolkata 5:53:28 - LMT 1880 # Kolkata
# Indonesia
#
# From Paul Eggert (2014-09-06):
# The 1876 Report of the Secretary of the [US] Navy, p 306 says that Batavia
# civil time was 7:07:12.5; round to even for Jakarta.
#
# From Gwillim Law (2001-05-28), overriding Shanks & Pottenger:
# http://www.sumatera-inc.com/go_to_invest/about_indonesia.asp#standtime
# says that Indonesia's time zones changed on 1988-01-01. Looking at some
...
...
@@ -1685,44 +1685,70 @@ Zone Asia/Bishkek 4:58:24 - LMT 1924 May 2
# Korea (North and South)
# From Annie I. Bang (2006-07-10):
# http://www.koreaherald.co.kr/SITE/data/html_dir/2006/07/10/200607100012.asp
# The Ministry of Commerce, Industry and Energy has already
# commissioned a research project [to reintroduce DST] and has said
# the system may begin as early as 2008.... Korea ran a daylight
# saving program from 1949-61 but stopped it during the 1950-53 Korean War.
# http://www.koreaherald.com/view.php?ud=200607100012
# Korea ran a daylight saving program from 1949-61 but stopped it
# during the 1950-53 Korean War. The system was temporarily enforced
# between 1987 and 1988 ...
# From Sanghyuk Jung (2014-10-29):
# http://mm.icann.org/pipermail/tz/2014-October/021830.html
# According to the Korean Wikipedia
# http://ko.wikipedia.org/wiki/한국_표준시
# [oldid=12896437 2014-09-04 08:03 UTC]
# DST in Republic of Korea was as follows.... And I checked old
# newspapers in Korean, all articles correspond with data in Wikipedia.
# For example, the article in 1948 (Korean Language) proved that DST
# started at June 1 in that year. For another example, the article in
# 1988 said that DST started at 2:00 AM in that year.
# From Shanks & Pottenger:
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule ROK 1960 only - May 15 0:00 1:00 D
Rule ROK 1960 only - Sep 13 0:00 0 S
Rule ROK 1987 1988 - May Sun>=8 0:00 1:00 D
Rule ROK 1987 1988 - Oct Sun>=8 0:00 0 S
# From Paul Eggert (2014-07-01):
# The following entries are from Shanks & Pottenger, except that I
# guessed that time zone abbreviations through 1945 followed the same
Rule ROK 1948 only - Jun 1 0:00 1:00 D
Rule ROK 1948 only - Sep 13 0:00 0 S
Rule ROK 1949 only - Apr 3 0:00 1:00 D
Rule ROK 1949 1951 - Sep Sun>=8 0:00 0 S
Rule ROK 1950 only - Apr 1 0:00 1:00 D
Rule ROK 1951 only - May 6 0:00 1:00 D
Rule ROK 1955 only - May 5 0:00 1:00 D
Rule ROK 1955 only - Sep 9 0:00 0 S
Rule ROK 1956 only - May 20 0:00 1:00 D
Rule ROK 1956 only - Sep 30 0:00 0 S
Rule ROK 1957 1960 - May Sun>=1 0:00 1:00 D
Rule ROK 1957 1960 - Sep Sun>=18 0:00 0 S
Rule ROK 1987 1988 - May Sun>=8 2:00 1:00 D
Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S
# From Paul Eggert (2014-10-30):
# The Korean Wikipedia entry gives the following sources for UT offsets:
#
# 1908: Official Journal Article No. 3994 (Edict No. 5)
# 1912: Governor-General of Korea Official Gazette Issue No. 367
# (Announcement No. 338)
# 1954: Presidential Decree No. 876 (1954-03-17)
# 1961: Law No. 676 (1961-08-07)
# 1987: Law No. 3919 (1986-12-31)
#
# The Wikipedia entry also has confusing information about a change
# to UT+9 in April 1910, but then what would be the point of the later change
# to UT+9 on 1912-01-01? Omit the 1910 change for now.
#
# I guessed that time zone abbreviations through 1945 followed the same
# rules as discussed under Taiwan, with nominal switches from JST to KST
# when the respective cities were taken over by the Allies after WWII.
#
# For Pyongyang we have no information; guess no changes since World War II.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Seoul 8:27:52 - LMT 1890
8:30 - KST 1904 Dec
9:00 - JCST 1928
8:30 - KST 1932
Zone Asia/Seoul 8:27:52 - LMT 1908 Apr 1
8:30 - KST 1912 Jan 1
9:00 - JCST 1937 Oct 1
9:00 - JST 1945 Sep 8
9:00 - KST 1954 Mar 21
8:00 ROK K%sT 1961 Aug 10
8:30 - KST 1968 Oct
8:30 ROK K%sT 1961 Aug 10
9:00 ROK K%sT
Zone Asia/Pyongyang 8:23:00 - LMT 1890
8:30 - KST 1904 Dec
9:00 - JCST 1928
8:30 - KST 1932
Zone Asia/Pyongyang 8:23:00 - LMT 1908 Apr 1
8:30 - KST 1912 Jan 1
9:00 - JCST 1937 Oct 1
9:00 - JST 1945 Aug 24
9:00 - KST 1954 Mar 21
8:00 - KST 1961 Aug 10
9:00 - KST
###############################################################################
...
...
@@ -1733,12 +1759,8 @@ Zone Asia/Kuwait 3:11:56 - LMT 1950
3:00 - AST
# Laos
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Vientiane 6:50:24 - LMT 1906 Jun 9 # or Viangchan
7:06:20 - SMT 1911 Mar 11 0:01 # Saigon MT?
7:00 - ICT 1912 May
8:00 - ICT 1931 May
7:00 - ICT
# See Asia/Bangkok.
# Lebanon
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
...
...
@@ -2751,6 +2773,8 @@ Zone Asia/Dushanbe 4:35:12 - LMT 1924 May 2
Zone Asia/Bangkok 6:42:04 - LMT 1880
6:42:04 - BMT 1920 Apr # Bangkok Mean Time
7:00 - ICT
Link Asia/Bangkok Asia/Phnom_Penh # Cambodia
Link Asia/Bangkok Asia/Vientiane # Laos
# Turkmenistan
# From Shanks & Pottenger.
...
...
@@ -2788,22 +2812,65 @@ Zone Asia/Tashkent 4:37:11 - LMT 1924 May 2
# Vietnam
# From Paul Eggert (201
3-02-21
):
# From Paul Eggert (201
4-10-04
):
# 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.
# and Pottenger
for LMT before 1906
.
# From Arthur David Olson (2008-03-18):
# The English-language name of Vietnam's most populous city is "Ho Chi Minh
# City"; use Ho_Chi_Minh below to avoid a name of more than 14 characters.
# From Shanks & Pottenger:
# From Paul Eggert (2014-10-21) after a heads-up from Trần Ngọc Quân:
# Trần Tiến Bình's authoritative book "Lịch Việt Nam: thế kỷ XX-XXI (1901-2100)"
# (Nhà xuất bản Văn Hoá - Thông Tin, Hanoi, 2005), pp 49-50,
# is quoted verbatim in:
# http://www.thoigian.com.vn/?mPage=P80D01
# is translated by Brian Inglis in:
# http://mm.icann.org/pipermail/tz/2014-October/021654.html
# and is the basis for the information below.
#
# The 1906 transition was effective July 1 and standardized Indochina to
# Phù Liễn Observatory, legally 104 deg. 17'17" east of Paris.
# It's unclear whether this meant legal Paris Mean Time (00:09:21) or
# the Paris Meridian (2 deg. 20'14.03" E); the former yields 07:06:30.1333...
# and the latter 07:06:29.333... so either way it rounds to 07:06:30,
# which is used below even though the modern-day Phù Liễn Observatory
# is closer to 07:06:31. Abbreviate Phù Liễn Mean Time as PLMT.
#
# The following transitions occurred in Indochina in general (before 1954)
# and in South Vietnam in particular (after 1954):
# To 07:00 on 1911-05-01.
# To 08:00 on 1942-12-31 at 23:00.
# To 09:00 in 1945-03-14 at 23:00.
# To 07:00 on 1945-09-02 in Vietnam.
# To 08:00 on 1947-04-01 in French-controlled Indochina.
# To 07:00 on 1955-07-01 in South Vietnam.
# To 08:00 on 1959-12-31 at 23:00 in South Vietnam.
# To 07:00 on 1975-06-13 in South Vietnam.
#
# Trần cites the following sources; it's unclear which supplied the info above.
#
# Hoàng Xuân Hãn: "Lịch và lịch Việt Nam". Tập san Khoa học Xã hội,
# No. 9, Paris, February 1982.
#
# Lê Thành Lân: "Lịch và niên biểu lịch sử hai mươi thế kỷ (0001-2010)",
# NXB Thống kê, Hanoi, 2000.
#
# Lê Thành Lân: "Lịch hai thế kỷ (1802-2010) và các lịch vĩnh cửu",
# NXB Thuận Hoá, Huế, 1995.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Ho_Chi_Minh 7:06:40 - LMT 1906 Jun 9
7:06:20 - SMT 1911 Mar 11 0:01 # Saigon MT?
7:00 - ICT 1912 May
8:00 - ICT 1931 May
Zone Asia/Ho_Chi_Minh 7:06:40 - LMT 1906 Jul 1
7:06:30 - PLMT 1911 May 1
7:00 - ICT 1942 Dec 31 23:00
8:00 - IDT 1945 Mar 14 23:00
9:00 - JST 1945 Sep 2
7:00 - ICT 1947 Apr 1
8:00 - IDT 1955 Jul 1
7:00 - ICT 1959 Dec 31 23:00
8:00 - IDT 1975 Jun 13
7:00 - ICT
# Yemen
...
...
test/sun/util/calendar/zi/tzdata/australasia
浏览文件 @
95184625
...
...
@@ -354,20 +354,27 @@ Zone Indian/Cocos 6:27:40 - LMT 1900
# Fiji will end DST on 2014-01-19 02:00:
# http://www.fiji.gov.fj/Media-Center/Press-Releases/DAYLIGHT-SAVINGS-TO-END-THIS-MONTH-%281%29.aspx
# From Paul Eggert (2014-01-10):
# For now, guess that Fiji springs forward the Sunday before the fourth
# Monday in October, and springs back the penultimate Sunday in January.
# This is ad hoc, but matches recent practice.
# From Ken Rylander (2014-10-20):
# DST will start Nov. 2 this year.
# http://www.fiji.gov.fj/Media-Center/Press-Releases/DAYLIGHT-SAVING-STARTS-ON-SUNDAY,-NOVEMBER-2ND.aspx
# From Paul Eggert (2014-10-20):
# For now, guess DST from 02:00 the first Sunday in November to
# 03:00 the first Sunday on or after January 18. Although ad hoc, it
# matches this year's plan and seems more likely to match future
# practice than guessing no DST.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Fiji 1998 1999 - Nov Sun>=1 2:00 1:00 S
Rule Fiji 1999 2000 - Feb lastSun 3:00 0 -
Rule Fiji 2009 only - Nov 29 2:00 1:00 S
Rule Fiji 2010 only - Mar lastSun 3:00 0 -
Rule Fiji 2010
max
- Oct Sun>=21 2:00 1:00 S
Rule Fiji 2010
2013
- Oct Sun>=21 2:00 1:00 S
Rule Fiji 2011 only - Mar Sun>=1 3:00 0 -
Rule Fiji 2012 2013 - Jan Sun>=18 3:00 0 -
Rule Fiji 2014 max - Jan Sun>=18 2:00 0 -
Rule Fiji 2014 only - Jan Sun>=18 2:00 0 -
Rule Fiji 2014 max - Nov Sun>=1 2:00 1:00 S
Rule Fiji 2015 max - Jan Sun>=18 3:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva
12:00 Fiji FJ%sT # Fiji Time
...
...
@@ -542,6 +549,30 @@ Zone Pacific/Palau 8:57:56 - LMT 1901 # Koror
Zone Pacific/Port_Moresby 9:48:40 - LMT 1880
9:48:32 - PMMT 1895 # Port Moresby Mean Time
10:00 - PGT # Papua New Guinea Time
#
# From Paul Eggert (2014-10-13):
# Base the Bougainville entry on the Arawa-Kieta region, which appears to have
# the most people even though it was devastated in the Bougainville Civil War.
#
# Although Shanks gives 1942-03-15 / 1943-11-01 for JST, these dates
# are apparently rough guesswork from the starts of military campaigns.
# The World War II entries below are instead based on Arawa-Kieta.
# The Japanese occupied Kieta in July 1942,
# according to the Pacific War Online Encyclopedia
# http://pwencycl.kgbudge.com/B/o/Bougainville.htm
# and seem to have controlled it until their 1945-08-21 surrender.
#
# The Autonomous Region of Bougainville plans to switch from UTC+10 to UTC+11
# on 2014-12-28 at 02:00. They call UTC+11 "Bougainville Standard Time";
# abbreviate this as BST. See:
# http://www.bougainville24.com/bougainville-issues/bougainville-gets-own-timezone/
#
Zone Pacific/Bougainville 10:22:16 - LMT 1880
9:48:32 - PMMT 1895
10:00 - PGT 1942 Jul
9:00 - JST 1945 Aug 21
10:00 - PGT 2014 Dec 28 2:00
11:00 - BST
# Pitcairn
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
...
...
@@ -789,19 +820,19 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# tz@iana.org for general use in the future). For more, please see
# the file CONTRIBUTING in the tz distribution.
# From Paul Eggert (2013-02-21):
# A good source for time zone historical data outside the U.S. is
# From Paul Eggert (2014-10-31):
#
# Unless otherwise specified, the source for data through 1990 is:
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
# San Diego: ACS Publications, Inc. (2003).
# Unfortunately this book contains many errors and cites no sources.
#
# 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),
# published semiannually. Law sent in several helpful summaries
# of the IATA's data after 1990.
#
# Except where otherwise noted, Shanks & Pottenger is the source for
# entries through 1990, and IATA SSIM is the source for entries afterwards.
# of the IATA's data after 1990. Except where otherwise noted,
# IATA SSIM is the source for entries after 1990.
#
# Another source occasionally used is Edward W. Whitman, World Time Differences,
# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which
...
...
@@ -826,6 +857,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# 10:00 AEST AEDT Eastern Australia
# 10:00 ChST Chamorro
# 10:30 LHST LHDT Lord Howe*
# 11:00 BST Bougainville*
# 11:30 NZMT NZST New Zealand through 1945
# 12:00 NZST NZDT New Zealand 1946-present
# 12:15 CHAST Chatham through 1945*
...
...
test/sun/util/calendar/zi/tzdata/europe
浏览文件 @
95184625
...
...
@@ -29,16 +29,19 @@
# tz@iana.org for general use in the future). For more, please see
# the file CONTRIBUTING in the tz distribution.
# From Paul Eggert (2014-05-31):
# A good source for time zone historical data outside the U.S. is
# From Paul Eggert (2014-10-31):
#
# Unless otherwise specified, the source for data through 1990 is:
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
# San Diego: ACS Publications, Inc. (2003).
# Unfortunately this book contains many errors and cites no sources.
#
# 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),
# published semiannually. Law sent in several helpful summaries
# of the IATA's data after 1990.
# of the IATA's data after 1990. Except where otherwise noted,
# IATA SSIM is the source for entries after 1990.
#
# A reliable and entertaining source about time zones is
# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
...
...
@@ -91,10 +94,11 @@
# 0:00 WET WEST WEMT Western Europe
# 0:19:32.13 AMT NST Amsterdam, Netherlands Summer (1835-1937)*
# 0:20 NET NEST Netherlands (1937-1940)*
# 1:00 BST British Standard (1968-1971)
# 1:00 CET CEST CEMT Central Europe
# 1:00:14 SET Swedish (1879-1899)*
# 2:00 EET EEST Eastern Europe
# 3:00 FET Further-eastern Europe*
# 3:00 FET Further-eastern Europe
(2011-2014)
*
# 3:00 MSK MSD MSM* Moscow
# From Peter Ilieve (1994-12-04),
...
...
@@ -309,6 +313,14 @@
# "Timeball on the ballast office is down. Dunsink time."
# -- James Joyce, Ulysses
# "Countess Markievicz ... claimed that the [1916] abolition of Dublin Mean Time
# was among various actions undertaken by the 'English' government that
# would 'put the whole country into the SF (Sinn Féin) camp'. She claimed
# Irish 'public feeling (was) outraged by forcing of English time on us'."
# -- Parsons M. Dublin lost its time zone - and 25 minutes - after 1916 Rising.
# Irish Times 2014-10-27.
# http://www.irishtimes.com/news/politics/dublin-lost-its-time-zone-and-25-minutes-after-1916-rising-1.1977411
# From Joseph S. Myers (2005-01-26):
# Irish laws are available online at <http://www.irishstatutebook.ie>.
# These include various relating to legal time, for example:
...
...
@@ -616,6 +628,7 @@ Rule Russia 1992 only - Sep lastSat 23:00 0 -
Rule Russia 1993 2010 - Mar lastSun 2:00s 1:00 S
Rule Russia 1993 1995 - Sep lastSun 2:00s 0 -
Rule Russia 1996 2010 - Oct lastSun 2:00s 0 -
# As described below, Russia's 2014 change affects Zone data, not Rule data.
# From Alexander Krivenyshev (2011-06-14):
# According to Kremlin press service, Russian President Dmitry Medvedev
...
...
@@ -746,6 +759,13 @@ Zone Europe/Vienna 1:05:21 - LMT 1893 Apr
# http://www.belta.by/ru/all_news/society/V-Belarusi-otmenjaetsja-perexod-na-sezonnoe-vremja_i_572952.html
# http://naviny.by/rubrics/society/2011/09/16/ic_articles_116_175144/
# http://news.tut.by/society/250578.html
#
# From Alexander Bokovoy (2014-10-09):
# Belarussian government decided against changing to winter time....
# http://eng.belta.by/all_news/society/Belarus-decides-against-adjusting-time-in-Russias-wake_i_76335.html
# From Paul Eggert (2014-10-08):
# Hence Belarus can share time zone abbreviations with Moscow again.
#
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Europe/Minsk 1:50:16 - LMT 1880
1:50 - MMT 1924 May 2 # Minsk Mean Time
...
...
@@ -758,7 +778,8 @@ Zone Europe/Minsk 1:50:16 - LMT 1880
2:00 - EET 1992 Mar 29 0:00s
2:00 1:00 EEST 1992 Sep 27 0:00s
2:00 Russia EE%sT 2011 Mar 27 2:00s
3:00 - FET
3:00 - FET 2014 Oct 26 1:00s
3:00 - MSK
# Belgium
#
...
...
@@ -2524,7 +2545,7 @@ Zone Asia/Novosibirsk 5:31:40 - LMT 1919 Dec 14 6:00
# The Kemerovo region will remain at UTC+7 through the 2014-10-26 change, thus
# realigning itself with KRAT.
Zone Asia/Novokuznetsk 5:48:48 -
NMT 1920 Jan 6
Zone Asia/Novokuznetsk 5:48:48 -
LMT 1924 May 1
6:00 - KRAT 1930 Jun 21 # Krasnoyarsk Time
7:00 Russia KRA%sT 1991 Mar 31 2:00s
6:00 Russia KRA%sT 1992 Jan 19 2:00s
...
...
test/sun/util/calendar/zi/tzdata/leapseconds
浏览文件 @
95184625
...
...
@@ -33,8 +33,8 @@
# The NTP Timescale and Leap Seconds
# http://www.eecis.udel.edu/~mills/leap.html
# The International Earth Rotation
Service periodically uses leap seconds
# to keep UTC to within 0.9 s of UT1
# The International Earth Rotation
and Reference Systems Service
#
periodically uses leap seconds
to keep UTC to within 0.9 s of UT1
# (which measures the true angular orientation of the earth in space); see
# Terry J Quinn, The BIPM and the accurate measure of time,
# Proc IEEE 79, 7 (July 1991), 894-905 <http://dx.doi.org/10.1109/5.84965>.
...
...
test/sun/util/calendar/zi/tzdata/northamerica
浏览文件 @
95184625
...
...
@@ -300,6 +300,12 @@ Zone PST8PDT -8:00 US P%sT
# time zone, but we do go by the Eastern time zone because so many people work
# in Columbus."
# From Paul Eggert (2014-09-06):
# Monthly Notices of the Royal Astronomical Society 44, 4 (1884-02-08), 208
# says that New York City Hall time was 3 minutes 58.4 seconds fast of
# Eastern time (i.e., -4:56:01.6) just before the 1883 switch. Round to the
# nearest second.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER
Rule NYC 1920 only - Mar lastSun 2:00 1:00 D
Rule NYC 1920 only - Oct lastSun 2:00 0 S
...
...
@@ -1008,19 +1014,19 @@ Zone America/Menominee -5:50:27 - LMT 1885 Sep 18 12:00
################################################################################
# From Paul Eggert (2006-03-22):
# A good source for time zone historical data outside the U.S. is
# From Paul Eggert (2014-10-31):
#
# Unless otherwise specified, the source for data through 1990 is:
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
# San Diego: ACS Publications, Inc. (2003).
# Unfortunately this book contains many errors and cites no sources.
#
# 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),
# published semiannually. Law sent in several helpful summaries
# of the IATA's data after 1990.
#
# Except where otherwise noted, Shanks & Pottenger is the source for
# entries through 1990, and IATA SSIM is the source for entries afterwards.
# of the IATA's data after 1990. Except where otherwise noted,
# IATA SSIM is the source for entries after 1990.
#
# Other sources occasionally used include:
#
...
...
@@ -1118,17 +1124,16 @@ Zone America/Menominee -5:50:27 - LMT 1885 Sep 18 12:00
# An amendment to the Interpretation Act was registered on February 19/2007....
# http://action.attavik.ca/home/justice-gn/attach/2007/gaz02part2.pdf
# From Paul Eggert (20
06-04-25
):
# From Paul Eggert (20
14-10-18
):
# H. David Matthews and Mary Vincent's map
# "It's about TIME", _Canadian Geographic_ (September-October 1998)
# http://www.canadiangeographic.ca/Magazine/SO98/
geomap
.asp
# http://www.canadiangeographic.ca/Magazine/SO98/
alacarte
.asp
# contains detailed boundaries for regions observing nonstandard
# time and daylight saving time arrangements in Canada circa 1998.
#
# INMS, the Institute for National Measurement Standards in Ottawa, has
# information about standard and daylight saving time zones in Canada.
# http://inms-ienm.nrc-cnrc.gc.ca/en/time_services/daylight_saving_e.php
# (updated periodically).
# National Research Council Canada maintains info about time zones and DST.
# http://www.nrc-cnrc.gc.ca/eng/services/time/time_zones.html
# http://www.nrc-cnrc.gc.ca/eng/services/time/faq/index.html#Q5
# Its unofficial information is often taken from Matthews and Vincent.
# From Paul Eggert (2006-06-27):
...
...
@@ -1993,10 +1998,7 @@ Zone America/Creston -7:46:04 - LMT 1884
# [Also see <http://www.nunatsiaq.com/nunavut/nvt10309_06.html> (2001-03-09).]
# From Gwillim Law (2005-05-21):
# According to maps at
# http://inms-ienm.nrc-cnrc.gc.ca/images/time_services/TZ01SWE.jpg
# http://inms-ienm.nrc-cnrc.gc.ca/images/time_services/TZ01SSE.jpg
# (both dated 2003), and
# According to ...
# http://www.canadiangeographic.ca/Magazine/SO98/geomap.asp
# (from a 1998 Canadian Geographic article), the de facto and de jure time
# for Southampton Island (at the north end of Hudson Bay) is UTC-5 all year
...
...
@@ -2005,9 +2007,11 @@ Zone America/Creston -7:46:04 - LMT 1884
# predates the creation of Nunavut, it probably goes back many years....
# The Inuktitut name of Coral Harbour is Sallit, but it's rarely used.
#
# From Paul Eggert (20
05-07-26
):
# From Paul Eggert (20
14-10-17
):
# For lack of better information, assume that Southampton Island observed
# daylight saving only during wartime.
# daylight saving only during wartime. Gwillim Law's email also
# mentioned maps now maintained by National Research Council Canada;
# see above for an up-to-date link.
# From Chris Walton (2007-03-01):
# ... the community of Resolute (located on Cornwallis Island in
...
...
@@ -3008,10 +3012,21 @@ Zone America/Tegucigalpa -5:48:52 - LMT 1921 Apr
# Shanks & Pottenger give -5:07:12, but Milne records -5:07:10.41 from an
# unspecified official document, and says "This time is used throughout the
# island". Go with Milne. Round to the nearest second as required by zic.
#
# Shanks & Pottenger give April 28 for the 1974 spring-forward transition, but
# Lance Neita writes that Prime Minister Michael Manley decreed it January 5.
# Assume Neita meant Jan 6 02:00, the same as the US. Neita also writes that
# Manley's supporters associated this act with Manley's nickname "Joshua"
# (recall that in the Bible the sun stood still at Joshua's request),
# and with the Rod of Correction which Manley said he had received from
# Haile Selassie, Emperor of Ethiopia. See:
# Neita L. The politician in all of us. Jamaica Observer 2014-09-20
# http://www.jamaicaobserver.com/columns/The-politician-in-all-of-us_17573647
#
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Jamaica -5:07:11 - LMT 1890 # Kingston
-5:07:11 - KMT 1912 Feb # Kingston Mean Time
-5:00 - EST 1974
Apr 28 2:00
-5:00 - EST 1974
-5:00 US E%sT 1984
-5:00 - EST
...
...
@@ -3139,13 +3154,17 @@ Zone America/Miquelon -3:44:40 - LMT 1911 May 15 # St Pierre
# From Paul Eggert (2014-08-19):
# The 2014-08-13 Cabinet meeting decided to stay on UTC-4 year-round. See:
# http://tcweeklynews.com/daylight-savings-time-to-be-maintained-p5353-127.htm
# Model this as a switch from EST/EDT to AST on 2014-11-02 at 02:00.
# Model this as a switch from EST/EDT to AST ...
# From Chris Walton (2014-11-04):
# ... the TCI government appears to have delayed the switch to
# "permanent daylight saving time" by one year....
# http://tcweeklynews.com/time-change-to-go-ahead-this-november-p5437-127.htm
#
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Grand_Turk -4:44:32 - LMT 1890
-5:07:11 - KMT 1912 Feb # Kingston Mean Time
-5:00 - EST 1979
-5:00 US E%sT 201
4 Nov 2
2:00
-5:00 US E%sT 201
5 Nov Sun>=1
2:00
-4:00 - AST
# British Virgin Is
...
...
test/sun/util/calendar/zi/tzdata/southamerica
浏览文件 @
95184625
此差异已折叠。
点击以展开。
test/sun/util/calendar/zi/tzdata/zone.tab
浏览文件 @
95184625
...
...
@@ -330,7 +330,8 @@ PE -1203-07703 America/Lima
PF -1732-14934 Pacific/Tahiti Society Islands
PF -0900-13930 Pacific/Marquesas Marquesas Islands
PF -2308-13457 Pacific/Gambier Gambier Islands
PG -0930+14710 Pacific/Port_Moresby
PG -0930+14710 Pacific/Port_Moresby most locations
PG -0613+15534 Pacific/Bougainville Bougainville
PH +1435+12100 Asia/Manila
PK +2452+06703 Asia/Karachi
PL +5215+02100 Europe/Warsaw
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录