Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
dc0440a8
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看板
提交
dc0440a8
编写于
3月 01, 2011
作者:
L
lana
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
7137c71c
398aa098
变更
112
展开全部
隐藏空白更改
内联
并排
Showing
112 changed file
with
2881 addition
and
817 deletion
+2881
-817
make/java/security/Makefile
make/java/security/Makefile
+10
-3
make/sun/javazic/tzdata/VERSION
make/sun/javazic/tzdata/VERSION
+1
-1
make/sun/javazic/tzdata/australasia
make/sun/javazic/tzdata/australasia
+6
-7
make/sun/javazic/tzdata/northamerica
make/sun/javazic/tzdata/northamerica
+65
-14
make/sun/javazic/tzdata/zone.tab
make/sun/javazic/tzdata/zone.tab
+3
-2
make/sun/jpeg/Makefile
make/sun/jpeg/Makefile
+13
-0
make/sun/jpeg/reorder-i586
make/sun/jpeg/reorder-i586
+23
-23
make/sun/jpeg/reorder-sparc
make/sun/jpeg/reorder-sparc
+10
-10
make/sun/jpeg/reorder-sparcv9
make/sun/jpeg/reorder-sparcv9
+9
-9
src/share/classes/com/sun/media/sound/services/javax.sound.sampled.spi.FormatConversionProvider
...services/javax.sound.sampled.spi.FormatConversionProvider
+1
-1
src/share/classes/java/io/Console.java
src/share/classes/java/io/Console.java
+16
-4
src/share/classes/java/lang/System.java
src/share/classes/java/lang/System.java
+18
-14
src/share/classes/java/lang/Thread.java
src/share/classes/java/lang/Thread.java
+9
-35
src/share/classes/java/util/Hashtable.java
src/share/classes/java/util/Hashtable.java
+28
-16
src/share/classes/java/util/SimpleTimeZone.java
src/share/classes/java/util/SimpleTimeZone.java
+16
-5
src/share/classes/java/util/TimeZone.java
src/share/classes/java/util/TimeZone.java
+60
-22
src/share/classes/java/util/Vector.java
src/share/classes/java/util/Vector.java
+14
-6
src/share/classes/java/util/jar/JarFile.java
src/share/classes/java/util/jar/JarFile.java
+192
-3
src/share/classes/java/util/jar/JarVerifier.java
src/share/classes/java/util/jar/JarVerifier.java
+432
-3
src/share/classes/java/util/jar/JavaUtilJarAccessImpl.java
src/share/classes/java/util/jar/JavaUtilJarAccessImpl.java
+29
-1
src/share/classes/javax/script/ScriptEngineFactory.java
src/share/classes/javax/script/ScriptEngineFactory.java
+11
-11
src/share/classes/javax/sound/sampled/AudioSystem.java
src/share/classes/javax/sound/sampled/AudioSystem.java
+6
-6
src/share/classes/javax/sql/rowset/serial/SerialClob.java
src/share/classes/javax/sql/rowset/serial/SerialClob.java
+36
-27
src/share/classes/javax/sql/rowset/spi/SyncFactory.java
src/share/classes/javax/sql/rowset/spi/SyncFactory.java
+14
-4
src/share/classes/javax/swing/JComponent.java
src/share/classes/javax/swing/JComponent.java
+20
-4
src/share/classes/javax/swing/JLayer.java
src/share/classes/javax/swing/JLayer.java
+25
-13
src/share/classes/javax/swing/LookAndFeel.java
src/share/classes/javax/swing/LookAndFeel.java
+7
-6
src/share/classes/javax/swing/RepaintManager.java
src/share/classes/javax/swing/RepaintManager.java
+0
-11
src/share/classes/javax/swing/SwingUtilities.java
src/share/classes/javax/swing/SwingUtilities.java
+11
-0
src/share/classes/javax/swing/plaf/LayerUI.java
src/share/classes/javax/swing/plaf/LayerUI.java
+10
-12
src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java
src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java
+4
-4
src/share/classes/javax/swing/plaf/synth/SynthGraphicsUtils.java
...re/classes/javax/swing/plaf/synth/SynthGraphicsUtils.java
+0
-1
src/share/classes/sun/awt/image/ImageFetcher.java
src/share/classes/sun/awt/image/ImageFetcher.java
+26
-6
src/share/classes/sun/awt/image/InputStreamImageSource.java
src/share/classes/sun/awt/image/InputStreamImageSource.java
+7
-2
src/share/classes/sun/font/FontUtilities.java
src/share/classes/sun/font/FontUtilities.java
+18
-2
src/share/classes/sun/misc/JarIndex.java
src/share/classes/sun/misc/JarIndex.java
+13
-0
src/share/classes/sun/misc/JavaUtilJarAccess.java
src/share/classes/sun/misc/JavaUtilJarAccess.java
+12
-1
src/share/classes/sun/net/www/protocol/jar/URLJarFile.java
src/share/classes/sun/net/www/protocol/jar/URLJarFile.java
+15
-27
src/share/classes/sun/nio/ch/FileChannelImpl.java
src/share/classes/sun/nio/ch/FileChannelImpl.java
+4
-1
src/share/classes/sun/security/jgss/wrapper/SunNativeProvider.java
.../classes/sun/security/jgss/wrapper/SunNativeProvider.java
+1
-0
src/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java
...sun/security/provider/certpath/PKIXCertPathValidator.java
+0
-7
src/share/classes/sun/security/util/SignatureFileVerifier.java
...hare/classes/sun/security/util/SignatureFileVerifier.java
+11
-6
src/share/classes/sun/tools/jps/Jps.java
src/share/classes/sun/tools/jps/Jps.java
+46
-30
src/share/classes/sun/util/resources/TimeZoneNames.java
src/share/classes/sun/util/resources/TimeZoneNames.java
+1
-0
src/share/classes/sun/util/resources/TimeZoneNames_de.java
src/share/classes/sun/util/resources/TimeZoneNames_de.java
+1
-0
src/share/classes/sun/util/resources/TimeZoneNames_es.java
src/share/classes/sun/util/resources/TimeZoneNames_es.java
+1
-0
src/share/classes/sun/util/resources/TimeZoneNames_fr.java
src/share/classes/sun/util/resources/TimeZoneNames_fr.java
+1
-0
src/share/classes/sun/util/resources/TimeZoneNames_it.java
src/share/classes/sun/util/resources/TimeZoneNames_it.java
+1
-0
src/share/classes/sun/util/resources/TimeZoneNames_ja.java
src/share/classes/sun/util/resources/TimeZoneNames_ja.java
+1
-0
src/share/classes/sun/util/resources/TimeZoneNames_ko.java
src/share/classes/sun/util/resources/TimeZoneNames_ko.java
+1
-0
src/share/classes/sun/util/resources/TimeZoneNames_pt_BR.java
...share/classes/sun/util/resources/TimeZoneNames_pt_BR.java
+1
-0
src/share/classes/sun/util/resources/TimeZoneNames_sv.java
src/share/classes/sun/util/resources/TimeZoneNames_sv.java
+1
-0
src/share/classes/sun/util/resources/TimeZoneNames_zh_CN.java
...share/classes/sun/util/resources/TimeZoneNames_zh_CN.java
+1
-0
src/share/classes/sun/util/resources/TimeZoneNames_zh_TW.java
...share/classes/sun/util/resources/TimeZoneNames_zh_TW.java
+1
-0
src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystemProvider.java
...io/zipfs/src/com/sun/nio/zipfs/ZipFileSystemProvider.java
+43
-21
src/share/native/sun/awt/image/jpeg/imageioJPEG.c
src/share/native/sun/awt/image/jpeg/imageioJPEG.c
+38
-30
src/share/native/sun/awt/image/jpeg/jdmarker.c
src/share/native/sun/awt/image/jpeg/jdmarker.c
+2
-2
src/share/native/sun/awt/image/jpeg/jmemmgr.c
src/share/native/sun/awt/image/jpeg/jmemmgr.c
+7
-5
src/share/native/sun/awt/image/jpeg/jmemnobs.c
src/share/native/sun/awt/image/jpeg/jmemnobs.c
+4
-4
src/share/native/sun/awt/image/jpeg/jmemsys.h
src/share/native/sun/awt/image/jpeg/jmemsys.h
+5
-5
src/share/native/sun/awt/image/jpeg/jpegdecoder.c
src/share/native/sun/awt/image/jpeg/jpegdecoder.c
+2
-2
src/share/native/sun/awt/image/jpeg/jpeglib.h
src/share/native/sun/awt/image/jpeg/jpeglib.h
+2
-2
src/solaris/classes/sun/awt/X11/XDesktopPeer.java
src/solaris/classes/sun/awt/X11/XDesktopPeer.java
+28
-7
src/solaris/classes/sun/java2d/xr/XRSurfaceData.java
src/solaris/classes/sun/java2d/xr/XRSurfaceData.java
+1
-2
src/solaris/classes/sun/nio/fs/UnixChannelFactory.java
src/solaris/classes/sun/nio/fs/UnixChannelFactory.java
+1
-1
src/solaris/native/sun/java2d/x11/X11SurfaceData.c
src/solaris/native/sun/java2d/x11/X11SurfaceData.c
+39
-13
src/solaris/native/sun/java2d/x11/X11SurfaceData.h
src/solaris/native/sun/java2d/x11/X11SurfaceData.h
+8
-2
src/solaris/native/sun/xawt/awt_Desktop.c
src/solaris/native/sun/xawt/awt_Desktop.c
+7
-1
src/windows/classes/sun/awt/windows/WPathGraphics.java
src/windows/classes/sun/awt/windows/WPathGraphics.java
+24
-2
src/windows/classes/sun/awt/windows/WPrinterJob.java
src/windows/classes/sun/awt/windows/WPrinterJob.java
+3
-2
src/windows/classes/sun/print/Win32PrintService.java
src/windows/classes/sun/print/Win32PrintService.java
+133
-69
src/windows/native/sun/java2d/windows/GDIBlitLoops.cpp
src/windows/native/sun/java2d/windows/GDIBlitLoops.cpp
+8
-7
test/ProblemList.txt
test/ProblemList.txt
+11
-14
test/demo/zipfs/ZipFSTester.java
test/demo/zipfs/ZipFSTester.java
+12
-0
test/demo/zipfs/basic.sh
test/demo/zipfs/basic.sh
+1
-1
test/java/awt/PrintJob/Text/StringWidth.java
test/java/awt/PrintJob/Text/StringWidth.java
+2
-1
test/java/awt/font/StyledMetrics/BoldSpace.java
test/java/awt/font/StyledMetrics/BoldSpace.java
+102
-0
test/java/awt/print/PrinterJob/ImagePrinting/ImageTypes.java
test/java/awt/print/PrinterJob/ImagePrinting/ImageTypes.java
+272
-0
test/java/lang/Thread/StopBeforeStart.java
test/java/lang/Thread/StopBeforeStart.java
+0
-132
test/java/nio/channels/FileChannel/Position.java
test/java/nio/channels/FileChannel/Position.java
+42
-33
test/java/nio/file/Files/walkFileTree/PrintFileTree.java
test/java/nio/file/Files/walkFileTree/PrintFileTree.java
+7
-5
test/java/util/Hashtable/SerializationDeadlock.java
test/java/util/Hashtable/SerializationDeadlock.java
+156
-0
test/java/util/Hashtable/SimpleSerialization.java
test/java/util/Hashtable/SimpleSerialization.java
+86
-0
test/java/util/TimeZone/DaylightTimeTest.java
test/java/util/TimeZone/DaylightTimeTest.java
+103
-0
test/java/util/Vector/SerializationDeadlock.java
test/java/util/Vector/SerializationDeadlock.java
+157
-0
test/java/util/Vector/SimpleSerialization.java
test/java/util/Vector/SimpleSerialization.java
+87
-0
test/java/util/concurrent/BlockingQueue/CancelledProducerConsumerLoops.java
...current/BlockingQueue/CancelledProducerConsumerLoops.java
+2
-2
test/javax/print/attribute/ServiceDialogTest.java
test/javax/print/attribute/ServiceDialogTest.java
+1
-1
test/javax/swing/JComponent/6989617/bug6989617.java
test/javax/swing/JComponent/6989617/bug6989617.java
+82
-51
test/javax/swing/JFileChooser/6798062/bug6798062.html
test/javax/swing/JFileChooser/6798062/bug6798062.html
+2
-0
test/javax/swing/JFileChooser/6798062/bug6798062.java
test/javax/swing/JFileChooser/6798062/bug6798062.java
+15
-4
test/javax/swing/JScrollBar/6542335/bug6542335.java
test/javax/swing/JScrollBar/6542335/bug6542335.java
+2
-2
test/javax/swing/LookAndFeel/6474153/bug6474153.java
test/javax/swing/LookAndFeel/6474153/bug6474153.java
+53
-0
test/sun/java2d/pipe/RegionOps.java
test/sun/java2d/pipe/RegionOps.java
+23
-0
test/sun/security/krb5/auto/BadKdc1.java
test/sun/security/krb5/auto/BadKdc1.java
+2
-2
test/sun/security/krb5/auto/BadKdc2.java
test/sun/security/krb5/auto/BadKdc2.java
+2
-2
test/sun/security/krb5/auto/BadKdc3.java
test/sun/security/krb5/auto/BadKdc3.java
+2
-2
test/sun/security/krb5/auto/BadKdc4.java
test/sun/security/krb5/auto/BadKdc4.java
+2
-2
test/sun/security/krb5/auto/CleanState.java
test/sun/security/krb5/auto/CleanState.java
+2
-1
test/sun/security/krb5/auto/CrossRealm.java
test/sun/security/krb5/auto/CrossRealm.java
+2
-1
test/sun/security/krb5/auto/HttpNegotiateServer.java
test/sun/security/krb5/auto/HttpNegotiateServer.java
+2
-1
test/sun/security/krb5/auto/IgnoreChannelBinding.java
test/sun/security/krb5/auto/IgnoreChannelBinding.java
+2
-1
test/sun/security/krb5/auto/KerberosHashEqualsTest.java
test/sun/security/krb5/auto/KerberosHashEqualsTest.java
+2
-1
test/sun/security/krb5/auto/LifeTimeInSeconds.java
test/sun/security/krb5/auto/LifeTimeInSeconds.java
+2
-1
test/sun/security/krb5/auto/LoginModuleOptions.java
test/sun/security/krb5/auto/LoginModuleOptions.java
+2
-1
test/sun/security/krb5/auto/MaxRetries.java
test/sun/security/krb5/auto/MaxRetries.java
+2
-2
test/sun/security/krb5/auto/MoreKvno.java
test/sun/security/krb5/auto/MoreKvno.java
+2
-1
test/sun/security/krb5/auto/NewSalt.java
test/sun/security/krb5/auto/NewSalt.java
+2
-2
test/sun/security/krb5/auto/NonMutualSpnego.java
test/sun/security/krb5/auto/NonMutualSpnego.java
+2
-1
test/sun/security/krb5/auto/SSL.java
test/sun/security/krb5/auto/SSL.java
+11
-11
test/sun/security/krb5/auto/SpnegoReqFlags.java
test/sun/security/krb5/auto/SpnegoReqFlags.java
+2
-1
test/sun/security/krb5/auto/Test5653.java
test/sun/security/krb5/auto/Test5653.java
+2
-1
未找到文件。
make/java/security/Makefile
浏览文件 @
dc0440a8
#
#
# Copyright (c) 1996, 201
0
Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1996, 201
1
Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
#
# This code is free software; you can redistribute it and/or modify it
# This code is free software; you can redistribute it and/or modify it
...
@@ -65,6 +65,8 @@ CACERTS_BUILD = $(LIBDIR)/security/cacerts
...
@@ -65,6 +65,8 @@ CACERTS_BUILD = $(LIBDIR)/security/cacerts
ifndef
OPENJDK
ifndef
OPENJDK
BLACKLIST_SRC
=
$(CLOSED_SHARE_SRC)
/lib/security/blacklist
BLACKLIST_SRC
=
$(CLOSED_SHARE_SRC)
/lib/security/blacklist
BLACKLIST_BUILD
=
$(LIBDIR)
/security/blacklist
BLACKLIST_BUILD
=
$(LIBDIR)
/security/blacklist
TRUSTEDLIBS_SRC
=
$(CLOSED_SHARE_SRC)
/lib/security/trusted.libraries
TRUSTEDLIBS_BUILD
=
$(LIBDIR)
/security/trusted.libraries
endif
endif
FILES_class
=
$
(
FILES_java:%.java
=
$(CLASSBINDIR)
/%.class
)
FILES_class
=
$
(
FILES_java:%.java
=
$(CLASSBINDIR)
/%.class
)
...
@@ -77,7 +79,7 @@ include $(BUILDDIR)/common/Rules.gmk
...
@@ -77,7 +79,7 @@ include $(BUILDDIR)/common/Rules.gmk
ifdef
OPENJDK
ifdef
OPENJDK
build
:
properties policy cacerts
build
:
properties policy cacerts
else
else
build
:
properties policy cacerts blacklist
build
:
properties policy cacerts blacklist
trustedlibs
endif
endif
install
:
all
install
:
all
...
@@ -90,6 +92,8 @@ cacerts: classes $(CACERTS_BUILD)
...
@@ -90,6 +92,8 @@ cacerts: classes $(CACERTS_BUILD)
blacklist
:
classes $(BLACKLIST_BUILD)
blacklist
:
classes $(BLACKLIST_BUILD)
trustedlibs
:
classes $(TRUSTEDLIBS_BUILD)
$(PROPS_BUILD)
:
$(PROPS_SRC)
$(PROPS_BUILD)
:
$(PROPS_SRC)
$
(
install-file
)
$
(
install-file
)
...
@@ -102,9 +106,12 @@ $(CACERTS_BUILD): $(CACERTS_SRC)
...
@@ -102,9 +106,12 @@ $(CACERTS_BUILD): $(CACERTS_SRC)
$(BLACKLIST_BUILD)
:
$(BLACKLIST_SRC)
$(BLACKLIST_BUILD)
:
$(BLACKLIST_SRC)
$
(
install-file
)
$
(
install-file
)
$(TRUSTEDLIBS_BUILD)
:
$(TRUSTEDLIBS_SRC)
$
(
install-file
)
clean clobber
::
.delete.classlist
clean clobber
::
.delete.classlist
$(RM)
-r
$(CLASSBINDIR)
/java/security
$(RM)
-r
$(CLASSBINDIR)
/java/security
$(RM)
$(PROPS_BUILD)
$(POLICY_BUILD)
$(CACERTS_BUILD)
$(BLACKLIST_BUILD)
$(RM)
$(PROPS_BUILD)
$(POLICY_BUILD)
$(CACERTS_BUILD)
$(BLACKLIST_BUILD)
$(TRUSTEDLIBS_BUILD)
# Additional Rule for building sun.security.util
# Additional Rule for building sun.security.util
$(CLASSBINDIR)/%.class
:
$(SHARE_SRC)/sun/%.java
$(CLASSBINDIR)/%.class
:
$(SHARE_SRC)/sun/%.java
...
...
make/sun/javazic/tzdata/VERSION
浏览文件 @
dc0440a8
...
@@ -21,4 +21,4 @@
...
@@ -21,4 +21,4 @@
# or visit www.oracle.com if you need additional information or have any
# or visit www.oracle.com if you need additional information or have any
# questions.
# questions.
#
#
tzdata201
0o
tzdata201
1b
make/sun/javazic/tzdata/australasia
浏览文件 @
dc0440a8
...
@@ -106,14 +106,13 @@ Rule AS 1986 only - Oct 19 2:00s 1:00 -
...
@@ -106,14 +106,13 @@ Rule AS 1986 only - Oct 19 2:00s 1:00 -
Rule AS 1987 2007 - Oct lastSun 2:00s 1:00 -
Rule AS 1987 2007 - Oct lastSun 2:00s 1:00 -
Rule AS 1972 only - Feb 27 2:00s 0 -
Rule AS 1972 only - Feb 27 2:00s 0 -
Rule AS 1973 1985 - Mar Sun>=1 2:00s 0 -
Rule AS 1973 1985 - Mar Sun>=1 2:00s 0 -
Rule AS 1986 1989 - Mar Sun>=15 2:00s 0 -
Rule AS 1986 1990 - Mar Sun>=15 2:00s 0 -
Rule AS 1990 only - Mar Sun>=18 2:00s 0 -
Rule AS 1991 only - Mar 3 2:00s 0 -
Rule AS 1991 only - Mar Sun>=1 2:00s 0 -
Rule AS 1992 only - Mar 22 2:00s 0 -
Rule AS 1992 only - Mar Sun>=18 2:00s 0 -
Rule AS 1993 only - Mar 7 2:00s 0 -
Rule AS 1993 only - Mar Sun>=1 2:00s 0 -
Rule AS 1994 only - Mar 20 2:00s 0 -
Rule AS 1994 only - Mar Sun>=18 2:00s 0 -
Rule AS 1995 2005 - Mar lastSun 2:00s 0 -
Rule AS 1995 2005 - Mar lastSun 2:00s 0 -
Rule AS 2006 only - Apr
Sun>=1
2:00s 0 -
Rule AS 2006 only - Apr
2
2:00s 0 -
Rule AS 2007 only - Mar lastSun 2:00s 0 -
Rule AS 2007 only - Mar lastSun 2:00s 0 -
Rule AS 2008 max - Apr Sun>=1 2:00s 0 -
Rule AS 2008 max - Apr Sun>=1 2:00s 0 -
Rule AS 2008 max - Oct Sun>=1 2:00s 1:00 -
Rule AS 2008 max - Oct Sun>=1 2:00s 1:00 -
...
...
make/sun/javazic/tzdata/northamerica
浏览文件 @
dc0440a8
...
@@ -368,6 +368,27 @@ Zone America/North_Dakota/New_Salem -6:45:39 - LMT 1883 Nov 18 12:14:21
...
@@ -368,6 +368,27 @@ Zone America/North_Dakota/New_Salem -6:45:39 - LMT 1883 Nov 18 12:14:21
-7:00 US M%sT 2003 Oct 26 02:00
-7:00 US M%sT 2003 Oct 26 02:00
-6:00 US C%sT
-6:00 US C%sT
# From Josh Findley (2011-01-21):
# ...it appears that Mercer County, North Dakota, changed from the
# mountain time zone to the central time zone at the last transition from
# daylight-saving to standard time (on Nov. 7, 2010):
# <a href="http://www.gpo.gov/fdsys/pkg/FR-2010-09-29/html/2010-24376.htm">
# http://www.gpo.gov/fdsys/pkg/FR-2010-09-29/html/2010-24376.htm
# </a>
# <a href="http://www.bismarcktribune.com/news/local/article_1eb1b588-c758-11df-b472-001cc4c03286.html">
# http://www.bismarcktribune.com/news/local/article_1eb1b588-c758-11df-b472-001cc4c03286.html
# </a>
# From Andy Lipscomb (2011-01-24):
# ...according to the Census Bureau, the largest city is Beulah (although
# it's commonly referred to as Beulah-Hazen, with Hazen being the next
# largest city in Mercer County). Google Maps places Beulah's city hall
# at 4715'51" north, 10146'40" west, which yields an offset of 6h47'07".
Zone America/North_Dakota/Beulah -6:47:07 - LMT 1883 Nov 18 12:12:53
-7:00 US M%sT 2010 Nov 7 2:00
-6:00 US C%sT
# US mountain time, represented by Denver
# US mountain time, represented by Denver
#
#
# Colorado, far western Kansas, Montana, western
# Colorado, far western Kansas, Montana, western
...
@@ -493,20 +514,50 @@ Zone America/Adak 12:13:21 - LMT 1867 Oct 18
...
@@ -493,20 +514,50 @@ Zone America/Adak 12:13:21 - LMT 1867 Oct 18
# three votes for and one against."
# three votes for and one against."
# Hawaii
# Hawaii
#
# From Arthur David Olson:
# From Arthur David Olson (2010-12-09):
# And then there's Hawaii.
# "Hawaiian Time" by Robert C. Schmitt and Doak C. Cox appears on pages 207-225
# DST was observed for one day in 1933;
# of volume 26 of The Hawaiian Journal of History (1992). As of 2010-12-09,
# standard time was changed by half an hour in 1947;
# the article is available at
# it's always standard as of 1986.
# <a href="http://evols.library.manoa.hawaii.edu/bitstream/10524/239/2/JL26215.pdf">
#
# http://evols.library.manoa.hawaii.edu/bitstream/10524/239/2/JL26215.pdf
# From Paul Eggert:
# </a>
# Shanks says the 1933 experiment lasted for three weeks. Go with Shanks.
# and indicates that standard time was adopted effective noon, January
#
# 13, 1896 (page 218), that in "1933, the Legislature decreed daylight
Zone Pacific/Honolulu -10:31:26 - LMT 1900 Jan 1 12:00
# saving for the period between the last Sunday of each April and the
-10:30 - HST 1933 Apr 30 2:00
# last Sunday of each September, but less than a month later repealed the
-10:30 1:00 HDT 1933 May 21 2:00
# act," (page 220), that year-round daylight saving time was in effect
-10:30 US H%sT 1947 Jun 8 2:00
# from 1942-02-09 to 1945-09-30 (page 221, with no time of day given for
# when clocks changed) and that clocks were changed by 30 minutes
# effective the second Sunday of June, 1947 (page 219, with no time of
# day given for when clocks changed). A footnote for the 1933 changes
# cites Session Laws of Hawaii 1933, "Act. 90 (approved 26 Apr. 1933)
# and Act 163 (approved 21 May 1933)."
# From Arthur David Olson (2011-01-19):
# The following is from "Laws of the Territory of Hawaii Passed by the
# Seventeenth Legislature: Regular Session 1933," available (as of
# 2011-01-19) at American University's Pence Law Library. Page 85: "Act
# 90...At 2 o'clock ante meridian of the last Sunday in April of each
# year, the standard time of this Territory shall be advanced one
# hour...This Act shall take effect upon its approval. Approved this 26th
# day of April, A. D. 1933. LAWRENCE M JUDD, Governor of the Territory of
# Hawaii." Page 172: "Act 163...Act 90 of the Session Laws of 1933 is
# hereby repealed...This Act shall take effect upon its approval, upon
# which date the standard time of this Territory shall be restored to
# that existing immediately prior to the taking effect of said Act 90.
# Approved this 21st day of May, A. D. 1933. LAWRENCE M. JUDD, Governor
# of the Territory of Hawaii."
#
# Note that 1933-05-21 was a Sunday.
# We're left to guess the time of day when Act 163 was approved; guess noon.
Zone Pacific/Honolulu -10:31:26 - LMT 1896 Jan 13 12:00 #Schmitt&Cox
-10:30 - HST 1933 Apr 30 2:00 #Laws 1933
-10:30 1:00 HDT 1933 May 21 12:00 #Laws 1933+12
-10:30 - HST 1942 Feb 09 2:00 #Schmitt&Cox+2
-10:30 1:00 HDT 1945 Sep 30 2:00 #Schmitt&Fox+2
-10:30 US H%sT 1947 Jun 8 2:00 #Schmitt&Fox+2
-10:00 - HST
-10:00 - HST
# Now we turn to US areas that have diverged from the consensus since 1970.
# Now we turn to US areas that have diverged from the consensus since 1970.
...
...
make/sun/javazic/tzdata/zone.tab
浏览文件 @
dc0440a8
...
@@ -233,8 +233,8 @@ HT +1832-07220 America/Port-au-Prince
...
@@ -233,8 +233,8 @@ HT +1832-07220 America/Port-au-Prince
HU +4730+01905 Europe/Budapest
HU +4730+01905 Europe/Budapest
ID -0610+10648 Asia/Jakarta Java & Sumatra
ID -0610+10648 Asia/Jakarta Java & Sumatra
ID -0002+10920 Asia/Pontianak west & central Borneo
ID -0002+10920 Asia/Pontianak west & central Borneo
ID -0507+11924 Asia/Makassar east & south Borneo,
Celebes
, Bali, Nusa Tengarra, west Timor
ID -0507+11924 Asia/Makassar east & south Borneo,
Sulawesi (Celebes)
, Bali, Nusa Tengarra, west Timor
ID -0232+14042 Asia/Jayapura
Irian Jaya & the Moluccas
ID -0232+14042 Asia/Jayapura
west New Guinea (Irian Jaya) & Malukus (Moluccas)
IE +5320-00615 Europe/Dublin
IE +5320-00615 Europe/Dublin
IL +3146+03514 Asia/Jerusalem
IL +3146+03514 Asia/Jerusalem
IM +5409-00428 Europe/Isle_of_Man
IM +5409-00428 Europe/Isle_of_Man
...
@@ -426,6 +426,7 @@ US +411745-0863730 America/Indiana/Knox Central Time - Indiana - Starke County
...
@@ -426,6 +426,7 @@ US +411745-0863730 America/Indiana/Knox Central Time - Indiana - Starke County
US +450628-0873651 America/Menominee Central Time - Michigan - Dickinson, Gogebic, Iron & Menominee Counties
US +450628-0873651 America/Menominee Central Time - Michigan - Dickinson, Gogebic, Iron & Menominee Counties
US +470659-1011757 America/North_Dakota/Center Central Time - North Dakota - Oliver County
US +470659-1011757 America/North_Dakota/Center Central Time - North Dakota - Oliver County
US +465042-1012439 America/North_Dakota/New_Salem Central Time - North Dakota - Morton County (except Mandan area)
US +465042-1012439 America/North_Dakota/New_Salem Central Time - North Dakota - Morton County (except Mandan area)
US +471551-1014640 America/North_Dakota/Beulah Central Time - North Dakota - Mercer County
US +394421-1045903 America/Denver Mountain Time
US +394421-1045903 America/Denver Mountain Time
US +433649-1161209 America/Boise Mountain Time - south Idaho & east Oregon
US +433649-1161209 America/Boise Mountain Time - south Idaho & east Oregon
US +364708-1084111 America/Shiprock Mountain Time - Navajo
US +364708-1084111 America/Shiprock Mountain Time - Navajo
...
...
make/sun/jpeg/Makefile
浏览文件 @
dc0440a8
...
@@ -65,6 +65,19 @@ ifeq ($(PLATFORM), solaris)
...
@@ -65,6 +65,19 @@ ifeq ($(PLATFORM), solaris)
FILES_reorder
+=
reorder-
$(ARCH)
FILES_reorder
+=
reorder-
$(ARCH)
endif
endif
endif
endif
ifeq
($(PLATFORM), linux)
# Suppress gcc warnings like "variable might be clobbered by 'longjmp'
# or 'vfork'": this warning indicates that some variable is placed to
# a register by optimized compiler and it's value might be lost on longjmp().
# Recommended way to avoid such warning is to declare the variable as
# volatile to prevent the optimization. However, this approach does not
# work because we have to declare all variables as volatile in result.
OTHER_CFLAGS
+=
-Wno-clobbered
endif
include
$(BUILDDIR)/common/Mapfile-vers.gmk
include
$(BUILDDIR)/common/Mapfile-vers.gmk
include
$(BUILDDIR)/common/Library.gmk
include
$(BUILDDIR)/common/Library.gmk
...
...
make/sun/jpeg/reorder-i586
浏览文件 @
dc0440a8
...
@@ -22,7 +22,7 @@ text: .text%jIMReader;
...
@@ -22,7 +22,7 @@ text: .text%jIMReader;
text: .text%alloc_small: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jmemmgr.o;
text: .text%alloc_small: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jmemmgr.o;
text: .text%reset_marker_reader: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%reset_marker_reader: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%jIInCtlr;
text: .text%jIInCtlr;
text: .text%GET_ARRAYS: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jpegdecoder.o;
#
text: .text%GET_ARRAYS: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jpegdecoder.o;
text: .text%jReadHeader;
text: .text%jReadHeader;
text: .text%jConsumeInput;
text: .text%jConsumeInput;
text: .text%reset_input_controller: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdinput.o;
text: .text%reset_input_controller: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdinput.o;
...
@@ -30,36 +30,36 @@ text: .text%reset_error_mgr: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jerror.o;
...
@@ -30,36 +30,36 @@ text: .text%reset_error_mgr: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jerror.o;
text: .text%sun_jpeg_init_source;
text: .text%sun_jpeg_init_source;
text: .text%consume_markers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdinput.o;
text: .text%consume_markers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdinput.o;
text: .text%read_markers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%read_markers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%first_marker: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
#
text: .text%first_marker: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%sun_jpeg_fill_input_buffer;
text: .text%sun_jpeg_fill_input_buffer;
text: .text%RELEASE_ARRAYS: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jpegdecoder.o;
#
text: .text%RELEASE_ARRAYS: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jpegdecoder.o;
text: .text%get_soi: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
#
text: .text%get_soi: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%emit_message: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jerror.o;
text: .text%emit_message: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jerror.o;
text: .text%next_marker: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
#
text: .text%next_marker: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%get_interesting_appn: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%get_interesting_appn: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%examine_app0: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
#
text: .text%examine_app0: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%skip_variable: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%skip_variable: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%sun_jpeg_skip_input_data;
text: .text%sun_jpeg_skip_input_data;
text: .text%examine_app14: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
#
text: .text%examine_app14: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%get_dqt: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%get_dqt: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%jAlcQTable;
text: .text%jAlcQTable;
text: .text%get_sof: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%get_sof: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%get_dri: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
#
text: .text%get_dri: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%get_dht: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%get_dht: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%jAlcHTable;
text: .text%jAlcHTable;
text: .text%get_sos: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%get_sos: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%initial_setup: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdinput.o;
#
text: .text%initial_setup: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdinput.o;
text: .text%jDivRound;
text: .text%jDivRound;
text: .text%default_decompress_parms: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdapimin.o;
#
text: .text%default_decompress_parms: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdapimin.o;
text: .text%jHasMultScn;
text: .text%jHasMultScn;
text: .text%jStrtDecompress;
text: .text%jStrtDecompress;
text: .text%jIDMaster;
text: .text%jIDMaster;
text: .text%master_selection: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmaster.o;
#
text: .text%master_selection: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmaster.o;
text: .text%jCalcDimensions;
text: .text%jCalcDimensions;
text: .text%use_merged_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmaster.o;
#
text: .text%use_merged_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmaster.o;
text: .text%prepare_range_limit_table: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmaster.o;
#
text: .text%prepare_range_limit_table: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmaster.o;
text: .text%jIDColor;
text: .text%jIDColor;
text: .text%build_ycc_rgb_table: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcolor.o;
#
text: .text%build_ycc_rgb_table: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcolor.o;
text: .text%jIUpsampler;
text: .text%jIUpsampler;
text: .text%jRound;
text: .text%jRound;
text: .text%alloc_sarray: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jmemmgr.o;
text: .text%alloc_sarray: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jmemmgr.o;
...
@@ -70,16 +70,16 @@ text: .text%jIIDCT;
...
@@ -70,16 +70,16 @@ text: .text%jIIDCT;
text: .text%jIHDecoder;
text: .text%jIHDecoder;
text: .text%jIDCoefC;
text: .text%jIDCoefC;
text: .text%jIDMainC;
text: .text%jIDMainC;
text: .text%alloc_funny_pointers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmainct.o;
#
text: .text%alloc_funny_pointers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmainct.o;
text: .text%realize_virt_arrays: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jmemmgr.o;
text: .text%realize_virt_arrays: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jmemmgr.o;
text: .text%start_input_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdinput.o;
text: .text%start_input_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdinput.o;
text: .text%per_scan_setup: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdinput.o;
#
text: .text%per_scan_setup: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdinput.o;
text: .text%latch_quant_tables: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdinput.o;
#
text: .text%latch_quant_tables: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdinput.o;
text: .text%start_pass_huff_decoder: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdhuff.o;
text: .text%start_pass_huff_decoder: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdhuff.o;
text: .text%jMkDDerived;
text: .text%jMkDDerived;
text: .text%start_input_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcoefct.o;
text: .text%start_input_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcoefct.o;
text: .text%start_iMCU_row: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcoefct.o;
#
text: .text%start_iMCU_row: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcoefct.o;
text: .text%output_pass_setup: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdapistd.o;
#
text: .text%output_pass_setup: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdapistd.o;
text: .text%prepare_for_output_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmaster.o;
text: .text%prepare_for_output_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmaster.o;
text: .text%start_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jddctmgr.o;
text: .text%start_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jddctmgr.o;
text: .text%start_output_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcoefct.o;
text: .text%start_output_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcoefct.o;
...
@@ -87,7 +87,7 @@ text: .text%start_pass_dcolor: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcolor.o;
...
@@ -87,7 +87,7 @@ text: .text%start_pass_dcolor: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcolor.o;
text: .text%start_pass_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdsample.o;
text: .text%start_pass_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdsample.o;
text: .text%start_pass_dpost: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdpostct.o;
text: .text%start_pass_dpost: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdpostct.o;
text: .text%start_pass_main: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmainct.o;
text: .text%start_pass_main: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmainct.o;
text: .text%make_funny_pointers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmainct.o;
#
text: .text%make_funny_pointers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmainct.o;
text: .text%jReadScanlines;
text: .text%jReadScanlines;
text: .text%process_data_context_main: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmainct.o;
text: .text%process_data_context_main: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmainct.o;
text: .text%decompress_onepass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcoefct.o;
text: .text%decompress_onepass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcoefct.o;
...
@@ -100,11 +100,11 @@ text: .text%sep_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdsample.o;
...
@@ -100,11 +100,11 @@ text: .text%sep_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdsample.o;
text: .text%fullsize_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdsample.o;
text: .text%fullsize_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdsample.o;
text: .text%h2v2_fancy_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdsample.o;
text: .text%h2v2_fancy_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdsample.o;
text: .text%ycc_rgb_convert: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcolor.o;
text: .text%ycc_rgb_convert: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcolor.o;
text: .text%set_wraparound_pointers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmainct.o;
#
text: .text%set_wraparound_pointers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmainct.o;
text: .text%process_restart: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdhuff.o;
#
text: .text%process_restart: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdhuff.o;
text: .text%read_restart_marker: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%read_restart_marker: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%finish_input_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdinput.o;
text: .text%finish_input_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdinput.o;
text: .text%set_bottom_pointers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmainct.o;
#
text: .text%set_bottom_pointers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmainct.o;
text: .text%jFinDecompress;
text: .text%jFinDecompress;
text: .text%finish_output_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmaster.o;
text: .text%finish_output_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmaster.o;
text: .text%sun_jpeg_term_source;
text: .text%sun_jpeg_term_source;
...
...
make/sun/jpeg/reorder-sparc
浏览文件 @
dc0440a8
...
@@ -30,10 +30,10 @@ text: .text%reset_error_mgr: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jerror.o;
...
@@ -30,10 +30,10 @@ text: .text%reset_error_mgr: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jerror.o;
text: .text%sun_jpeg_init_source;
text: .text%sun_jpeg_init_source;
text: .text%consume_markers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdinput.o;
text: .text%consume_markers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdinput.o;
text: .text%read_markers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%read_markers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%first_marker: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
#
text: .text%first_marker: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%sun_jpeg_fill_input_buffer;
text: .text%sun_jpeg_fill_input_buffer;
text: .text%RELEASE_ARRAYS: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jpegdecoder.o;
text: .text%RELEASE_ARRAYS: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jpegdecoder.o;
text: .text%get_soi: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
#
text: .text%get_soi: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%emit_message: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jerror.o;
text: .text%emit_message: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jerror.o;
text: .text%next_marker: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%next_marker: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%get_interesting_appn: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%get_interesting_appn: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
...
@@ -44,7 +44,7 @@ text: .text%examine_app14: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
...
@@ -44,7 +44,7 @@ text: .text%examine_app14: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%get_dqt: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%get_dqt: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%jAlcQTable;
text: .text%jAlcQTable;
text: .text%get_sof: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%get_sof: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%get_dri: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
#
text: .text%get_dri: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%get_dht: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%get_dht: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%jAlcHTable;
text: .text%jAlcHTable;
text: .text%get_sos: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%get_sos: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
...
@@ -56,10 +56,10 @@ text: .text%jStrtDecompress;
...
@@ -56,10 +56,10 @@ text: .text%jStrtDecompress;
text: .text%jIDMaster;
text: .text%jIDMaster;
text: .text%master_selection: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmaster.o;
text: .text%master_selection: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmaster.o;
text: .text%jCalcDimensions;
text: .text%jCalcDimensions;
text: .text%use_merged_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmaster.o;
#
text: .text%use_merged_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmaster.o;
text: .text%prepare_range_limit_table: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmaster.o;
#
text: .text%prepare_range_limit_table: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmaster.o;
text: .text%jIDColor;
text: .text%jIDColor;
text: .text%build_ycc_rgb_table: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcolor.o;
#
text: .text%build_ycc_rgb_table: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcolor.o;
text: .text%jIUpsampler;
text: .text%jIUpsampler;
text: .text%jRound;
text: .text%jRound;
text: .text%alloc_sarray: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jmemmgr.o;
text: .text%alloc_sarray: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jmemmgr.o;
...
@@ -78,7 +78,7 @@ text: .text%latch_quant_tables: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdinput.o;
...
@@ -78,7 +78,7 @@ text: .text%latch_quant_tables: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdinput.o;
text: .text%start_pass_huff_decoder: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdhuff.o;
text: .text%start_pass_huff_decoder: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdhuff.o;
text: .text%jMkDDerived;
text: .text%jMkDDerived;
text: .text%start_input_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcoefct.o;
text: .text%start_input_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcoefct.o;
text: .text%start_iMCU_row: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcoefct.o;
#
text: .text%start_iMCU_row: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcoefct.o;
text: .text%output_pass_setup: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdapistd.o;
text: .text%output_pass_setup: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdapistd.o;
text: .text%prepare_for_output_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmaster.o;
text: .text%prepare_for_output_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmaster.o;
text: .text%start_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jddctmgr.o;
text: .text%start_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jddctmgr.o;
...
@@ -100,11 +100,11 @@ text: .text%sep_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdsample.o;
...
@@ -100,11 +100,11 @@ text: .text%sep_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdsample.o;
text: .text%fullsize_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdsample.o;
text: .text%fullsize_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdsample.o;
text: .text%h2v2_fancy_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdsample.o;
text: .text%h2v2_fancy_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdsample.o;
text: .text%ycc_rgb_convert: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcolor.o;
text: .text%ycc_rgb_convert: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcolor.o;
text: .text%set_wraparound_pointers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmainct.o;
#
text: .text%set_wraparound_pointers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmainct.o;
text: .text%process_restart: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdhuff.o;
#
text: .text%process_restart: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdhuff.o;
text: .text%read_restart_marker: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%read_restart_marker: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%finish_input_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdinput.o;
text: .text%finish_input_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdinput.o;
text: .text%set_bottom_pointers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmainct.o;
#
text: .text%set_bottom_pointers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmainct.o;
text: .text%jFinDecompress;
text: .text%jFinDecompress;
text: .text%finish_output_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmaster.o;
text: .text%finish_output_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmaster.o;
text: .text%sun_jpeg_term_source;
text: .text%sun_jpeg_term_source;
...
...
make/sun/jpeg/reorder-sparcv9
浏览文件 @
dc0440a8
...
@@ -30,10 +30,10 @@ text: .text%reset_error_mgr: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jerror.o;
...
@@ -30,10 +30,10 @@ text: .text%reset_error_mgr: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jerror.o;
text: .text%sun_jpeg_init_source;
text: .text%sun_jpeg_init_source;
text: .text%consume_markers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdinput.o;
text: .text%consume_markers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdinput.o;
text: .text%read_markers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
text: .text%read_markers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
text: .text%first_marker: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
#
text: .text%first_marker: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
text: .text%sun_jpeg_fill_input_buffer;
text: .text%sun_jpeg_fill_input_buffer;
text: .text%RELEASE_ARRAYS: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jpegdecoder.o;
text: .text%RELEASE_ARRAYS: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jpegdecoder.o;
text: .text%get_soi: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
#
text: .text%get_soi: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
text: .text%emit_message: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jerror.o;
text: .text%emit_message: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jerror.o;
text: .text%next_marker: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
text: .text%next_marker: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
text: .text%get_interesting_appn: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
text: .text%get_interesting_appn: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
...
@@ -44,7 +44,7 @@ text: .text%examine_app14: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
...
@@ -44,7 +44,7 @@ text: .text%examine_app14: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
text: .text%get_dqt: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
text: .text%get_dqt: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
text: .text%jAlcQTable;
text: .text%jAlcQTable;
text: .text%get_sof: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
text: .text%get_sof: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
text: .text%get_dri: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
#
text: .text%get_dri: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
text: .text%get_dht: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
text: .text%get_dht: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
text: .text%jAlcHTable;
text: .text%jAlcHTable;
text: .text%get_sos: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
text: .text%get_sos: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
...
@@ -56,10 +56,10 @@ text: .text%jStrtDecompress;
...
@@ -56,10 +56,10 @@ text: .text%jStrtDecompress;
text: .text%jIDMaster;
text: .text%jIDMaster;
text: .text%master_selection: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmaster.o;
text: .text%master_selection: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmaster.o;
text: .text%jCalcDimensions;
text: .text%jCalcDimensions;
text: .text%use_merged_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmaster.o;
#
text: .text%use_merged_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmaster.o;
text: .text%prepare_range_limit_table: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmaster.o;
#
text: .text%prepare_range_limit_table: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmaster.o;
text: .text%jIDColor;
text: .text%jIDColor;
text: .text%build_ycc_rgb_table: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdcolor.o;
#
text: .text%build_ycc_rgb_table: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdcolor.o;
text: .text%jIUpsampler;
text: .text%jIUpsampler;
text: .text%jRound;
text: .text%jRound;
text: .text%alloc_sarray: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jmemmgr.o;
text: .text%alloc_sarray: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jmemmgr.o;
...
@@ -78,7 +78,7 @@ text: .text%latch_quant_tables: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdinput.o;
...
@@ -78,7 +78,7 @@ text: .text%latch_quant_tables: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdinput.o;
text: .text%start_pass_huff_decoder: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdhuff.o;
text: .text%start_pass_huff_decoder: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdhuff.o;
text: .text%jMkDDerived;
text: .text%jMkDDerived;
text: .text%start_input_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdcoefct.o;
text: .text%start_input_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdcoefct.o;
text: .text%start_iMCU_row: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdcoefct.o;
#
text: .text%start_iMCU_row: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdcoefct.o;
text: .text%output_pass_setup: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdapistd.o;
text: .text%output_pass_setup: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdapistd.o;
text: .text%prepare_for_output_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmaster.o;
text: .text%prepare_for_output_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmaster.o;
text: .text%start_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jddctmgr.o;
text: .text%start_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jddctmgr.o;
...
@@ -100,11 +100,11 @@ text: .text%sep_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdsample.o;
...
@@ -100,11 +100,11 @@ text: .text%sep_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdsample.o;
text: .text%fullsize_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdsample.o;
text: .text%fullsize_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdsample.o;
text: .text%h2v2_fancy_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdsample.o;
text: .text%h2v2_fancy_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdsample.o;
text: .text%ycc_rgb_convert: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdcolor.o;
text: .text%ycc_rgb_convert: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdcolor.o;
text: .text%set_wraparound_pointers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmainct.o;
#
text: .text%set_wraparound_pointers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmainct.o;
text: .text%process_restart: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdhuff.o;
text: .text%process_restart: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdhuff.o;
text: .text%read_restart_marker: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
text: .text%read_restart_marker: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
text: .text%finish_input_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdinput.o;
text: .text%finish_input_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdinput.o;
text: .text%set_bottom_pointers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmainct.o;
#
text: .text%set_bottom_pointers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmainct.o;
text: .text%jFinDecompress;
text: .text%jFinDecompress;
text: .text%finish_output_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmaster.o;
text: .text%finish_output_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmaster.o;
text: .text%sun_jpeg_term_source;
text: .text%sun_jpeg_term_source;
...
...
src/share/classes/com/sun/media/sound/services/javax.sound.sampled.spi.FormatConversionProvider
浏览文件 @
dc0440a8
# Providers for FormatConversion
# Providers for FormatConversion
com.sun.media.sound.AudioFloatFormatConverter
com.sun.media.sound.UlawCodec
com.sun.media.sound.UlawCodec
com.sun.media.sound.AlawCodec
com.sun.media.sound.AlawCodec
com.sun.media.sound.PCMtoPCMCodec
com.sun.media.sound.PCMtoPCMCodec
com.sun.media.sound.AudioFloatFormatConverter
src/share/classes/java/io/Console.java
浏览文件 @
dc0440a8
...
@@ -308,17 +308,29 @@ public final class Console implements Flushable
...
@@ -308,17 +308,29 @@ public final class Console implements Flushable
char
[]
passwd
=
null
;
char
[]
passwd
=
null
;
synchronized
(
writeLock
)
{
synchronized
(
writeLock
)
{
synchronized
(
readLock
)
{
synchronized
(
readLock
)
{
if
(
fmt
.
length
()
!=
0
)
pw
.
format
(
fmt
,
args
);
try
{
try
{
echoOff
=
echo
(
false
);
echoOff
=
echo
(
false
);
passwd
=
readline
(
true
);
}
catch
(
IOException
x
)
{
}
catch
(
IOException
x
)
{
throw
new
IOError
(
x
);
throw
new
IOError
(
x
);
}
IOError
ioe
=
null
;
try
{
if
(
fmt
.
length
()
!=
0
)
pw
.
format
(
fmt
,
args
);
passwd
=
readline
(
true
);
}
catch
(
IOException
x
)
{
ioe
=
new
IOError
(
x
);
}
finally
{
}
finally
{
try
{
try
{
echoOff
=
echo
(
true
);
echoOff
=
echo
(
true
);
}
catch
(
IOException
xx
)
{}
}
catch
(
IOException
x
)
{
if
(
ioe
==
null
)
ioe
=
new
IOError
(
x
);
else
ioe
.
addSuppressed
(
x
);
}
if
(
ioe
!=
null
)
throw
ioe
;
}
}
pw
.
println
();
pw
.
println
();
}
}
...
...
src/share/classes/java/lang/System.java
浏览文件 @
dc0440a8
...
@@ -1102,6 +1102,18 @@ public final class System {
...
@@ -1102,6 +1102,18 @@ public final class System {
* Initialize the system class. Called after thread initialization.
* Initialize the system class. Called after thread initialization.
*/
*/
private
static
void
initializeSystemClass
()
{
private
static
void
initializeSystemClass
()
{
// VM might invoke JNU_NewStringPlatform() to set those encoding
// sensitive properties (user.home, user.name, boot.class.path, etc.)
// during "props" initialization, in which it may need access, via
// System.getProperty(), to the related system encoding property that
// have been initialized (put into "props") at early stage of the
// initialization. So make sure the "props" is available at the
// very beginning of the initialization and all system properties to
// be put into it directly.
props
=
new
Properties
();
initProperties
(
props
);
// initialized by the VM
// There are certain system configurations that may be controlled by
// There are certain system configurations that may be controlled by
// VM options such as the maximum amount of direct memory and
// VM options such as the maximum amount of direct memory and
// Integer cache size used to support the object identity semantics
// Integer cache size used to support the object identity semantics
...
@@ -1112,7 +1124,12 @@ public final class System {
...
@@ -1112,7 +1124,12 @@ public final class System {
//
//
// See java.lang.Integer.IntegerCache and the
// See java.lang.Integer.IntegerCache and the
// sun.misc.VM.saveAndRemoveProperties method for example.
// sun.misc.VM.saveAndRemoveProperties method for example.
props
=
initSystemProperties
();
//
// Save a private copy of the system properties object that
// can only be accessed by the internal implementation. Remove
// certain system properties that are not intended for public access.
sun
.
misc
.
VM
.
saveAndRemoveProperties
(
props
);
lineSeparator
=
props
.
getProperty
(
"line.separator"
);
lineSeparator
=
props
.
getProperty
(
"line.separator"
);
sun
.
misc
.
Version
.
init
();
sun
.
misc
.
Version
.
init
();
...
@@ -1123,7 +1140,6 @@ public final class System {
...
@@ -1123,7 +1140,6 @@ public final class System {
setIn0
(
new
BufferedInputStream
(
fdIn
));
setIn0
(
new
BufferedInputStream
(
fdIn
));
setOut0
(
new
PrintStream
(
new
BufferedOutputStream
(
fdOut
,
128
),
true
));
setOut0
(
new
PrintStream
(
new
BufferedOutputStream
(
fdOut
,
128
),
true
));
setErr0
(
new
PrintStream
(
new
BufferedOutputStream
(
fdErr
,
128
),
true
));
setErr0
(
new
PrintStream
(
new
BufferedOutputStream
(
fdErr
,
128
),
true
));
// Load the zip library now in order to keep java.util.zip.ZipFile
// Load the zip library now in order to keep java.util.zip.ZipFile
// from trying to use itself to load this library later.
// from trying to use itself to load this library later.
loadLibrary
(
"zip"
);
loadLibrary
(
"zip"
);
...
@@ -1151,18 +1167,6 @@ public final class System {
...
@@ -1151,18 +1167,6 @@ public final class System {
setJavaLangAccess
();
setJavaLangAccess
();
}
}
private
static
Properties
initSystemProperties
()
{
Properties
props
=
new
Properties
();
initProperties
(
props
);
// initialized by the VM
// Save a private copy of the system properties object that
// can only be accessed by the internal implementation. Remove
// certain system properties that are not intended for public access.
sun
.
misc
.
VM
.
saveAndRemoveProperties
(
props
);
return
props
;
}
private
static
void
setJavaLangAccess
()
{
private
static
void
setJavaLangAccess
()
{
// Allow privileged classes outside of java.lang
// Allow privileged classes outside of java.lang
sun
.
misc
.
SharedSecrets
.
setJavaLangAccess
(
new
sun
.
misc
.
JavaLangAccess
(){
sun
.
misc
.
SharedSecrets
.
setJavaLangAccess
(
new
sun
.
misc
.
JavaLangAccess
(){
...
...
src/share/classes/java/lang/Thread.java
浏览文件 @
dc0440a8
...
@@ -254,12 +254,6 @@ class Thread implements Runnable {
...
@@ -254,12 +254,6 @@ class Thread implements Runnable {
*/
*/
public
final
static
int
MAX_PRIORITY
=
10
;
public
final
static
int
MAX_PRIORITY
=
10
;
/* If stop was called before start */
private
boolean
stopBeforeStart
;
/* Remembered Throwable from stop before start */
private
Throwable
throwableFromStop
;
/**
/**
* Returns a reference to the currently executing thread object.
* Returns a reference to the currently executing thread object.
*
*
...
@@ -706,10 +700,6 @@ class Thread implements Runnable {
...
@@ -706,10 +700,6 @@ class Thread implements Runnable {
it will be passed up the call stack */
it will be passed up the call stack */
}
}
}
}
if
(
stopBeforeStart
)
{
stop0
(
throwableFromStop
);
}
}
}
private
native
void
start0
();
private
native
void
start0
();
...
@@ -820,12 +810,7 @@ class Thread implements Runnable {
...
@@ -820,12 +810,7 @@ class Thread implements Runnable {
*/
*/
@Deprecated
@Deprecated
public
final
void
stop
()
{
public
final
void
stop
()
{
// If the thread is already dead, return.
stop
(
new
ThreadDeath
());
// A zero status value corresponds to "NEW".
if
((
threadStatus
!=
0
)
&&
!
isAlive
())
{
return
;
}
stop1
(
new
ThreadDeath
());
}
}
/**
/**
...
@@ -879,36 +864,25 @@ class Thread implements Runnable {
...
@@ -879,36 +864,25 @@ class Thread implements Runnable {
*/
*/
@Deprecated
@Deprecated
public
final
synchronized
void
stop
(
Throwable
obj
)
{
public
final
synchronized
void
stop
(
Throwable
obj
)
{
stop1
(
obj
);
if
(
obj
==
null
)
}
throw
new
NullPointerException
();
/**
* Common impl for stop() and stop(Throwable).
*/
private
final
synchronized
void
stop1
(
Throwable
th
)
{
SecurityManager
security
=
System
.
getSecurityManager
();
SecurityManager
security
=
System
.
getSecurityManager
();
if
(
security
!=
null
)
{
if
(
security
!=
null
)
{
checkAccess
();
checkAccess
();
if
((
this
!=
Thread
.
currentThread
())
||
if
((
this
!=
Thread
.
currentThread
())
||
(!(
th
instanceof
ThreadDeath
)))
{
(!(
obj
instanceof
ThreadDeath
)))
{
security
.
checkPermission
(
SecurityConstants
.
STOP_THREAD_PERMISSION
);
security
.
checkPermission
(
SecurityConstants
.
STOP_THREAD_PERMISSION
);
}
}
}
}
// A zero status value corresponds to "NEW"
// A zero status value corresponds to "NEW", it can't change to
// not-NEW because we hold the lock.
if
(
threadStatus
!=
0
)
{
if
(
threadStatus
!=
0
)
{
resume
();
// Wake up thread if it was suspended; no-op otherwise
resume
();
// Wake up thread if it was suspended; no-op otherwise
stop0
(
th
);
}
else
{
// Must do the null arg check that the VM would do with stop0
if
(
th
==
null
)
{
throw
new
NullPointerException
();
}
// Remember this stop attempt for if/when start is used
stopBeforeStart
=
true
;
throwableFromStop
=
th
;
}
}
// The VM can handle all thread states
stop0
(
obj
);
}
}
/**
/**
...
...
src/share/classes/java/util/Hashtable.java
浏览文件 @
dc0440a8
...
@@ -845,24 +845,36 @@ public class Hashtable<K,V>
...
@@ -845,24 +845,36 @@ public class Hashtable<K,V>
* for each key-value mapping represented by the Hashtable
* for each key-value mapping represented by the Hashtable
* The key-value mappings are emitted in no particular order.
* The key-value mappings are emitted in no particular order.
*/
*/
private
synchronized
void
writeObject
(
java
.
io
.
ObjectOutputStream
s
)
private
void
writeObject
(
java
.
io
.
ObjectOutputStream
s
)
throws
IOException
throws
IOException
{
{
Entry
<
Object
,
Object
>
entryStack
=
null
;
// Write out the length, threshold, loadfactor
s
.
defaultWriteObject
();
synchronized
(
this
)
{
// Write out the length, threshold, loadfactor
// Write out length, count of elements and then the key/value objects
s
.
defaultWriteObject
();
s
.
writeInt
(
table
.
length
);
s
.
writeInt
(
count
);
// Write out length, count of elements
for
(
int
index
=
table
.
length
-
1
;
index
>=
0
;
index
--)
{
s
.
writeInt
(
table
.
length
);
Entry
entry
=
table
[
index
];
s
.
writeInt
(
count
);
while
(
entry
!=
null
)
{
// Stack copies of the entries in the table
s
.
writeObject
(
entry
.
key
);
for
(
int
index
=
0
;
index
<
table
.
length
;
index
++)
{
s
.
writeObject
(
entry
.
value
);
Entry
entry
=
table
[
index
];
entry
=
entry
.
next
;
while
(
entry
!=
null
)
{
entryStack
=
new
Entry
<>(
0
,
entry
.
key
,
entry
.
value
,
entryStack
);
entry
=
entry
.
next
;
}
}
}
}
}
// Write out the key/value objects from the stacked entries
while
(
entryStack
!=
null
)
{
s
.
writeObject
(
entryStack
.
key
);
s
.
writeObject
(
entryStack
.
value
);
entryStack
=
entryStack
.
next
;
}
}
}
/**
/**
...
...
src/share/classes/java/util/SimpleTimeZone.java
浏览文件 @
dc0440a8
/*
/*
* Copyright (c) 1996, 20
06
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 20
11
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -825,10 +825,7 @@ public class SimpleTimeZone extends TimeZone {
...
@@ -825,10 +825,7 @@ public class SimpleTimeZone extends TimeZone {
* @since 1.2
* @since 1.2
*/
*/
public
int
getDSTSavings
()
{
public
int
getDSTSavings
()
{
if
(
useDaylight
)
{
return
useDaylight
?
dstSavings
:
0
;
return
dstSavings
;
}
return
0
;
}
}
/**
/**
...
@@ -841,6 +838,20 @@ public class SimpleTimeZone extends TimeZone {
...
@@ -841,6 +838,20 @@ public class SimpleTimeZone extends TimeZone {
return
useDaylight
;
return
useDaylight
;
}
}
/**
* Returns {@code true} if this {@code SimpleTimeZone} observes
* Daylight Saving Time. This method is equivalent to {@link
* #useDaylightTime()}.
*
* @return {@code true} if this {@code SimpleTimeZone} observes
* Daylight Saving Time; {@code false} otherwise.
* @since 1.7
*/
@Override
public
boolean
observesDaylightTime
()
{
return
useDaylightTime
();
}
/**
/**
* Queries if the given date is in daylight saving time.
* Queries if the given date is in daylight saving time.
* @return true if daylight saving time is in effective at the
* @return true if daylight saving time is in effective at the
...
...
src/share/classes/java/util/TimeZone.java
浏览文件 @
dc0440a8
/*
/*
* Copyright (c) 1996, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 201
1
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -455,17 +455,28 @@ abstract public class TimeZone implements Serializable, Cloneable {
...
@@ -455,17 +455,28 @@ abstract public class TimeZone implements Serializable, Cloneable {
/**
/**
* Returns the amount of time to be added to local standard time
* Returns the amount of time to be added to local standard time
* to get local wall clock time.
* to get local wall clock time.
* <p>
*
* The default implementation always returns 3600000 milliseconds
* <p>The default implementation returns 3600000 milliseconds
* (i.e., one hour) if this time zone observes Daylight Saving
* (i.e., one hour) if a call to {@link #useDaylightTime()}
* Time. Otherwise, 0 (zero) is returned.
* returns {@code true}. Otherwise, 0 (zero) is returned.
* <p>
*
* If an underlying TimeZone implementation subclass supports
* <p>If an underlying {@code TimeZone} implementation subclass
* historical Daylight Saving Time changes, this method returns
* supports historical and future Daylight Saving Time schedule
* the known latest daylight saving value.
* changes, this method returns the amount of saving time of the
* last known Daylight Saving Time rule that can be a future
* prediction.
*
* <p>If the amount of saving time at any given time stamp is
* required, construct a {@link Calendar} with this {@code
* TimeZone} and the time stamp, and call {@link Calendar#get(int)
* Calendar.get}{@code (}{@link Calendar#DST_OFFSET}{@code )}.
*
*
* @return the amount of saving time in milliseconds
* @return the amount of saving time in milliseconds
* @since 1.4
* @since 1.4
* @see #inDaylightTime(Date)
* @see #getOffset(long)
* @see #getOffset(int,int,int,int,int,int)
* @see Calendar#ZONE_OFFSET
*/
*/
public
int
getDSTSavings
()
{
public
int
getDSTSavings
()
{
if
(
useDaylightTime
())
{
if
(
useDaylightTime
())
{
...
@@ -475,24 +486,51 @@ abstract public class TimeZone implements Serializable, Cloneable {
...
@@ -475,24 +486,51 @@ abstract public class TimeZone implements Serializable, Cloneable {
}
}
/**
/**
* Queries if this time zone uses daylight savings time.
* Queries if this {@code TimeZone} uses Daylight Saving Time.
* <p>
*
* If an underlying <code>TimeZone</code> implementation subclass
* <p>If an underlying {@code TimeZone} implementation subclass
* supports historical Daylight Saving Time schedule changes, the
* supports historical and future Daylight Saving Time schedule
* method refers to the latest Daylight Saving Time schedule
* changes, this method refers to the last known Daylight Saving Time
* information.
* rule that can be a future prediction and may not be the same as
* the current rule. Consider calling {@link #observesDaylightTime()}
* if the current rule should also be taken into account.
*
*
* @return true if this time zone uses daylight savings time,
* @return {@code true} if this {@code TimeZone} uses Daylight Saving Time,
* false, otherwise.
* {@code false}, otherwise.
* @see #inDaylightTime(Date)
* @see Calendar#DST_OFFSET
*/
*/
public
abstract
boolean
useDaylightTime
();
public
abstract
boolean
useDaylightTime
();
/**
/**
* Queries if the given date is in daylight savings time in
* Returns {@code true} if this {@code TimeZone} is currently in
* this time zone.
* Daylight Saving Time, or if a transition from Standard Time to
* @param date the given Date.
* Daylight Saving Time occurs at any future time.
* @return true if the given date is in daylight savings time,
*
* false, otherwise.
* <p>The default implementation returns {@code true} if
* {@code useDaylightTime()} or {@code inDaylightTime(new Date())}
* returns {@code true}.
*
* @return {@code true} if this {@code TimeZone} is currently in
* Daylight Saving Time, or if a transition from Standard Time to
* Daylight Saving Time occurs at any future time; {@code false}
* otherwise.
* @since 1.7
* @see #useDaylightTime()
* @see #inDaylightTime(Date)
* @see Calendar#DST_OFFSET
*/
public
boolean
observesDaylightTime
()
{
return
useDaylightTime
()
||
inDaylightTime
(
new
Date
());
}
/**
* Queries if the given {@code date} is in Daylight Saving Time in
* this {@code TimeZone}.
*
* @param date the given {@code Date}.
* @return {@code true} if the given {@code date} is in Daylight Saving Time,
* {@code false}, otherwise.
*/
*/
abstract
public
boolean
inDaylightTime
(
Date
date
);
abstract
public
boolean
inDaylightTime
(
Date
date
);
...
...
src/share/classes/java/util/Vector.java
浏览文件 @
dc0440a8
...
@@ -1050,13 +1050,21 @@ public class Vector<E>
...
@@ -1050,13 +1050,21 @@ public class Vector<E>
/**
/**
* Save the state of the {@code Vector} instance to a stream (that
* Save the state of the {@code Vector} instance to a stream (that
* is, serialize it). This method is present merely for synchronization.
* is, serialize it).
* It just calls the default writeObject method.
* This method performs synchronization to ensure the consistency
* of the serialized data.
*/
*/
private
synchronized
void
writeObject
(
java
.
io
.
ObjectOutputStream
s
)
private
void
writeObject
(
java
.
io
.
ObjectOutputStream
s
)
throws
java
.
io
.
IOException
throws
java
.
io
.
IOException
{
{
final
java
.
io
.
ObjectOutputStream
.
PutField
fields
=
s
.
putFields
();
s
.
defaultWriteObject
();
final
Object
[]
data
;
synchronized
(
this
)
{
fields
.
put
(
"capacityIncrement"
,
capacityIncrement
);
fields
.
put
(
"elementCount"
,
elementCount
);
data
=
elementData
.
clone
();
}
fields
.
put
(
"elementData"
,
data
);
s
.
writeFields
();
}
}
/**
/**
...
...
src/share/classes/java/util/jar/JarFile.java
浏览文件 @
dc0440a8
/*
/*
* Copyright (c) 1997, 20
09
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 20
11
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -27,11 +27,13 @@ package java.util.jar;
...
@@ -27,11 +27,13 @@ package java.util.jar;
import
java.io.*
;
import
java.io.*
;
import
java.lang.ref.SoftReference
;
import
java.lang.ref.SoftReference
;
import
java.net.URL
;
import
java.util.*
;
import
java.util.*
;
import
java.util.zip.*
;
import
java.util.zip.*
;
import
java.security.CodeSigner
;
import
java.security.CodeSigner
;
import
java.security.cert.Certificate
;
import
java.security.cert.Certificate
;
import
java.security.AccessController
;
import
java.security.AccessController
;
import
java.security.CodeSource
;
import
sun.security.action.GetPropertyAction
;
import
sun.security.action.GetPropertyAction
;
import
sun.security.util.ManifestEntryVerifier
;
import
sun.security.util.ManifestEntryVerifier
;
import
sun.misc.SharedSecrets
;
import
sun.misc.SharedSecrets
;
...
@@ -262,7 +264,7 @@ class JarFile extends ZipFile {
...
@@ -262,7 +264,7 @@ class JarFile extends ZipFile {
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
}
if
(
certs
==
null
&&
jv
!=
null
)
{
if
(
certs
==
null
&&
jv
!=
null
)
{
certs
=
jv
.
getCerts
(
getName
()
);
certs
=
jv
.
getCerts
(
JarFile
.
this
,
this
);
}
}
return
certs
==
null
?
null
:
certs
.
clone
();
return
certs
==
null
?
null
:
certs
.
clone
();
}
}
...
@@ -273,7 +275,7 @@ class JarFile extends ZipFile {
...
@@ -273,7 +275,7 @@ class JarFile extends ZipFile {
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
}
if
(
signers
==
null
&&
jv
!=
null
)
{
if
(
signers
==
null
&&
jv
!=
null
)
{
signers
=
jv
.
getCodeSigners
(
getName
()
);
signers
=
jv
.
getCodeSigners
(
JarFile
.
this
,
this
);
}
}
return
signers
==
null
?
null
:
signers
.
clone
();
return
signers
==
null
?
null
:
signers
.
clone
();
}
}
...
@@ -544,4 +546,191 @@ class JarFile extends ZipFile {
...
@@ -544,4 +546,191 @@ class JarFile extends ZipFile {
}
}
return
false
;
return
false
;
}
}
private
synchronized
void
ensureInitialization
()
{
try
{
maybeInstantiateVerifier
();
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
}
if
(
jv
!=
null
&&
!
jvInitialized
)
{
initializeVerifier
();
jvInitialized
=
true
;
}
}
JarEntry
newEntry
(
ZipEntry
ze
)
{
return
new
JarFileEntry
(
ze
);
}
Enumeration
<
String
>
entryNames
(
CodeSource
[]
cs
)
{
ensureInitialization
();
if
(
jv
!=
null
)
{
return
jv
.
entryNames
(
this
,
cs
);
}
/*
* JAR file has no signed content. Is there a non-signing
* code source?
*/
boolean
includeUnsigned
=
false
;
for
(
int
i
=
0
;
i
<
cs
.
length
;
i
++)
{
if
(
cs
[
i
].
getCodeSigners
()
==
null
)
{
includeUnsigned
=
true
;
break
;
}
}
if
(
includeUnsigned
)
{
return
unsignedEntryNames
();
}
else
{
return
new
Enumeration
<
String
>()
{
public
boolean
hasMoreElements
()
{
return
false
;
}
public
String
nextElement
()
{
throw
new
NoSuchElementException
();
}
};
}
}
/**
* Returns an enumeration of the zip file entries
* excluding internal JAR mechanism entries and including
* signed entries missing from the ZIP directory.
*/
Enumeration
<
JarEntry
>
entries2
()
{
ensureInitialization
();
if
(
jv
!=
null
)
{
return
jv
.
entries2
(
this
,
super
.
entries
());
}
// screen out entries which are never signed
final
Enumeration
enum_
=
super
.
entries
();
return
new
Enumeration
<
JarEntry
>()
{
ZipEntry
entry
;
public
boolean
hasMoreElements
()
{
if
(
entry
!=
null
)
{
return
true
;
}
while
(
enum_
.
hasMoreElements
())
{
ZipEntry
ze
=
(
ZipEntry
)
enum_
.
nextElement
();
if
(
JarVerifier
.
isSigningRelated
(
ze
.
getName
()))
{
continue
;
}
entry
=
ze
;
return
true
;
}
return
false
;
}
public
JarFileEntry
nextElement
()
{
if
(
hasMoreElements
())
{
ZipEntry
ze
=
entry
;
entry
=
null
;
return
new
JarFileEntry
(
ze
);
}
throw
new
NoSuchElementException
();
}
};
}
CodeSource
[]
getCodeSources
(
URL
url
)
{
ensureInitialization
();
if
(
jv
!=
null
)
{
return
jv
.
getCodeSources
(
this
,
url
);
}
/*
* JAR file has no signed content. Is there a non-signing
* code source?
*/
Enumeration
unsigned
=
unsignedEntryNames
();
if
(
unsigned
.
hasMoreElements
())
{
return
new
CodeSource
[]{
JarVerifier
.
getUnsignedCS
(
url
)};
}
else
{
return
null
;
}
}
private
Enumeration
<
String
>
unsignedEntryNames
()
{
final
Enumeration
entries
=
entries
();
return
new
Enumeration
<
String
>()
{
String
name
;
/*
* Grab entries from ZIP directory but screen out
* metadata.
*/
public
boolean
hasMoreElements
()
{
if
(
name
!=
null
)
{
return
true
;
}
while
(
entries
.
hasMoreElements
())
{
String
value
;
ZipEntry
e
=
(
ZipEntry
)
entries
.
nextElement
();
value
=
e
.
getName
();
if
(
e
.
isDirectory
()
||
JarVerifier
.
isSigningRelated
(
value
))
{
continue
;
}
name
=
value
;
return
true
;
}
return
false
;
}
public
String
nextElement
()
{
if
(
hasMoreElements
())
{
String
value
=
name
;
name
=
null
;
return
value
;
}
throw
new
NoSuchElementException
();
}
};
}
CodeSource
getCodeSource
(
URL
url
,
String
name
)
{
ensureInitialization
();
if
(
jv
!=
null
)
{
if
(
jv
.
eagerValidation
)
{
CodeSource
cs
=
null
;
JarEntry
je
=
getJarEntry
(
name
);
if
(
je
!=
null
)
{
cs
=
jv
.
getCodeSource
(
url
,
this
,
je
);
}
else
{
cs
=
jv
.
getCodeSource
(
url
,
name
);
}
return
cs
;
}
else
{
return
jv
.
getCodeSource
(
url
,
name
);
}
}
return
JarVerifier
.
getUnsignedCS
(
url
);
}
void
setEagerValidation
(
boolean
eager
)
{
try
{
maybeInstantiateVerifier
();
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
}
if
(
jv
!=
null
)
{
jv
.
setEagerValidation
(
eager
);
}
}
List
getManifestDigests
()
{
ensureInitialization
();
if
(
jv
!=
null
)
{
return
jv
.
getManifestDigests
();
}
return
new
ArrayList
();
}
}
}
src/share/classes/java/util/jar/JarVerifier.java
浏览文件 @
dc0440a8
/*
/*
* Copyright (c) 1997, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
1
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -26,9 +26,11 @@
...
@@ -26,9 +26,11 @@
package
java.util.jar
;
package
java.util.jar
;
import
java.io.*
;
import
java.io.*
;
import
java.net.URL
;
import
java.util.*
;
import
java.util.*
;
import
java.security.*
;
import
java.security.*
;
import
java.security.cert.CertificateException
;
import
java.security.cert.CertificateException
;
import
java.util.zip.ZipEntry
;
import
sun.security.util.ManifestDigester
;
import
sun.security.util.ManifestDigester
;
import
sun.security.util.ManifestEntryVerifier
;
import
sun.security.util.ManifestEntryVerifier
;
...
@@ -81,6 +83,15 @@ class JarVerifier {
...
@@ -81,6 +83,15 @@ class JarVerifier {
/** the bytes for the manDig object */
/** the bytes for the manDig object */
byte
manifestRawBytes
[]
=
null
;
byte
manifestRawBytes
[]
=
null
;
/** controls eager signature validation */
boolean
eagerValidation
;
/** makes code source singleton instances unique to us */
private
Object
csdomain
=
new
Object
();
/** collect -DIGEST-MANIFEST values for blacklist */
private
List
manifestDigests
;
public
JarVerifier
(
byte
rawBytes
[])
{
public
JarVerifier
(
byte
rawBytes
[])
{
manifestRawBytes
=
rawBytes
;
manifestRawBytes
=
rawBytes
;
sigFileSigners
=
new
Hashtable
();
sigFileSigners
=
new
Hashtable
();
...
@@ -88,6 +99,7 @@ class JarVerifier {
...
@@ -88,6 +99,7 @@ class JarVerifier {
sigFileData
=
new
Hashtable
(
11
);
sigFileData
=
new
Hashtable
(
11
);
pendingBlocks
=
new
ArrayList
();
pendingBlocks
=
new
ArrayList
();
baos
=
new
ByteArrayOutputStream
();
baos
=
new
ByteArrayOutputStream
();
manifestDigests
=
new
ArrayList
();
}
}
/**
/**
...
@@ -247,7 +259,7 @@ class JarVerifier {
...
@@ -247,7 +259,7 @@ class JarVerifier {
}
}
sfv
.
setSignatureFile
(
bytes
);
sfv
.
setSignatureFile
(
bytes
);
sfv
.
process
(
sigFileSigners
);
sfv
.
process
(
sigFileSigners
,
manifestDigests
);
}
}
}
}
return
;
return
;
...
@@ -290,7 +302,7 @@ class JarVerifier {
...
@@ -290,7 +302,7 @@ class JarVerifier {
sfv
.
setSignatureFile
(
bytes
);
sfv
.
setSignatureFile
(
bytes
);
}
}
}
}
sfv
.
process
(
sigFileSigners
);
sfv
.
process
(
sigFileSigners
,
manifestDigests
);
}
catch
(
IOException
ioe
)
{
}
catch
(
IOException
ioe
)
{
// e.g. sun.security.pkcs.ParsingException
// e.g. sun.security.pkcs.ParsingException
...
@@ -312,12 +324,18 @@ class JarVerifier {
...
@@ -312,12 +324,18 @@ class JarVerifier {
/**
/**
* Return an array of java.security.cert.Certificate objects for
* Return an array of java.security.cert.Certificate objects for
* the given file in the jar.
* the given file in the jar.
* @deprecated
*/
*/
public
java
.
security
.
cert
.
Certificate
[]
getCerts
(
String
name
)
public
java
.
security
.
cert
.
Certificate
[]
getCerts
(
String
name
)
{
{
return
mapSignersToCertArray
(
getCodeSigners
(
name
));
return
mapSignersToCertArray
(
getCodeSigners
(
name
));
}
}
public
java
.
security
.
cert
.
Certificate
[]
getCerts
(
JarFile
jar
,
JarEntry
entry
)
{
return
mapSignersToCertArray
(
getCodeSigners
(
jar
,
entry
));
}
/**
/**
* return an array of CodeSigner objects for
* return an array of CodeSigner objects for
* the given file in the jar. this array is not cloned.
* the given file in the jar. this array is not cloned.
...
@@ -328,6 +346,28 @@ class JarVerifier {
...
@@ -328,6 +346,28 @@ class JarVerifier {
return
(
CodeSigner
[])
verifiedSigners
.
get
(
name
);
return
(
CodeSigner
[])
verifiedSigners
.
get
(
name
);
}
}
public
CodeSigner
[]
getCodeSigners
(
JarFile
jar
,
JarEntry
entry
)
{
String
name
=
entry
.
getName
();
if
(
eagerValidation
&&
sigFileSigners
.
get
(
name
)
!=
null
)
{
/*
* Force a read of the entry data to generate the
* verification hash.
*/
try
{
InputStream
s
=
jar
.
getInputStream
(
entry
);
byte
[]
buffer
=
new
byte
[
1024
];
int
n
=
buffer
.
length
;
while
(
n
!=
-
1
)
{
n
=
s
.
read
(
buffer
,
0
,
buffer
.
length
);
}
s
.
close
();
}
catch
(
IOException
e
)
{
}
}
return
getCodeSigners
(
name
);
}
/*
/*
* Convert an array of signers into an array of concatenated certificate
* Convert an array of signers into an array of concatenated certificate
* arrays.
* arrays.
...
@@ -444,4 +484,393 @@ class JarVerifier {
...
@@ -444,4 +484,393 @@ class JarVerifier {
}
}
}
}
// Extended JavaUtilJarAccess CodeSource API Support
private
Map
urlToCodeSourceMap
=
new
HashMap
();
private
Map
signerToCodeSource
=
new
HashMap
();
private
URL
lastURL
;
private
Map
lastURLMap
;
/*
* Create a unique mapping from codeSigner cache entries to CodeSource.
* In theory, multiple URLs origins could map to a single locally cached
* and shared JAR file although in practice there will be a single URL in use.
*/
private
synchronized
CodeSource
mapSignersToCodeSource
(
URL
url
,
CodeSigner
[]
signers
)
{
Map
map
;
if
(
url
==
lastURL
)
{
map
=
lastURLMap
;
}
else
{
map
=
(
Map
)
urlToCodeSourceMap
.
get
(
url
);
if
(
map
==
null
)
{
map
=
new
HashMap
();
urlToCodeSourceMap
.
put
(
url
,
map
);
}
lastURLMap
=
map
;
lastURL
=
url
;
}
CodeSource
cs
=
(
CodeSource
)
map
.
get
(
signers
);
if
(
cs
==
null
)
{
cs
=
new
VerifierCodeSource
(
csdomain
,
url
,
signers
);
signerToCodeSource
.
put
(
signers
,
cs
);
}
return
cs
;
}
private
CodeSource
[]
mapSignersToCodeSources
(
URL
url
,
List
signers
,
boolean
unsigned
)
{
List
sources
=
new
ArrayList
();
for
(
int
i
=
0
;
i
<
signers
.
size
();
i
++)
{
sources
.
add
(
mapSignersToCodeSource
(
url
,
(
CodeSigner
[])
signers
.
get
(
i
)));
}
if
(
unsigned
)
{
sources
.
add
(
mapSignersToCodeSource
(
url
,
null
));
}
return
(
CodeSource
[])
sources
.
toArray
(
new
CodeSource
[
sources
.
size
()]);
}
private
CodeSigner
[]
emptySigner
=
new
CodeSigner
[
0
];
/*
* Match CodeSource to a CodeSigner[] in the signer cache.
*/
private
CodeSigner
[]
findMatchingSigners
(
CodeSource
cs
)
{
if
(
cs
instanceof
VerifierCodeSource
)
{
VerifierCodeSource
vcs
=
(
VerifierCodeSource
)
cs
;
if
(
vcs
.
isSameDomain
(
csdomain
))
{
return
((
VerifierCodeSource
)
cs
).
getPrivateSigners
();
}
}
/*
* In practice signers should always be optimized above
* but this handles a CodeSource of any type, just in case.
*/
CodeSource
[]
sources
=
mapSignersToCodeSources
(
cs
.
getLocation
(),
getJarCodeSigners
(),
true
);
List
sourceList
=
new
ArrayList
();
for
(
int
i
=
0
;
i
<
sources
.
length
;
i
++)
{
sourceList
.
add
(
sources
[
i
]);
}
int
j
=
sourceList
.
indexOf
(
cs
);
if
(
j
!=
-
1
)
{
CodeSigner
[]
match
;
match
=
((
VerifierCodeSource
)
sourceList
.
get
(
j
)).
getPrivateSigners
();
if
(
match
==
null
)
{
match
=
emptySigner
;
}
return
match
;
}
return
null
;
}
/*
* Instances of this class hold uncopied references to internal
* signing data that can be compared by object reference identity.
*/
private
static
class
VerifierCodeSource
extends
CodeSource
{
URL
vlocation
;
CodeSigner
[]
vsigners
;
java
.
security
.
cert
.
Certificate
[]
vcerts
;
Object
csdomain
;
VerifierCodeSource
(
Object
csdomain
,
URL
location
,
CodeSigner
[]
signers
)
{
super
(
location
,
signers
);
this
.
csdomain
=
csdomain
;
vlocation
=
location
;
vsigners
=
signers
;
// from signerCache
}
VerifierCodeSource
(
Object
csdomain
,
URL
location
,
java
.
security
.
cert
.
Certificate
[]
certs
)
{
super
(
location
,
certs
);
this
.
csdomain
=
csdomain
;
vlocation
=
location
;
vcerts
=
certs
;
// from signerCache
}
/*
* All VerifierCodeSource instances are constructed based on
* singleton signerCache or signerCacheCert entries for each unique signer.
* No CodeSigner<->Certificate[] conversion is required.
* We use these assumptions to optimize equality comparisons.
*/
public
boolean
equals
(
Object
obj
)
{
if
(
obj
==
this
)
{
return
true
;
}
if
(
obj
instanceof
VerifierCodeSource
)
{
VerifierCodeSource
that
=
(
VerifierCodeSource
)
obj
;
/*
* Only compare against other per-signer singletons constructed
* on behalf of the same JarFile instance. Otherwise, compare
* things the slower way.
*/
if
(
isSameDomain
(
that
.
csdomain
))
{
if
(
that
.
vsigners
!=
this
.
vsigners
||
that
.
vcerts
!=
this
.
vcerts
)
{
return
false
;
}
if
(
that
.
vlocation
!=
null
)
{
return
that
.
vlocation
.
equals
(
this
.
vlocation
);
}
else
if
(
this
.
vlocation
!=
null
)
{
return
this
.
vlocation
.
equals
(
that
.
vlocation
);
}
else
{
// both null
return
true
;
}
}
}
return
super
.
equals
(
obj
);
}
boolean
isSameDomain
(
Object
csdomain
)
{
return
this
.
csdomain
==
csdomain
;
}
private
CodeSigner
[]
getPrivateSigners
()
{
return
vsigners
;
}
private
java
.
security
.
cert
.
Certificate
[]
getPrivateCertificates
()
{
return
vcerts
;
}
}
private
Map
signerMap
;
private
synchronized
Map
signerMap
()
{
if
(
signerMap
==
null
)
{
/*
* Snapshot signer state so it doesn't change on us. We care
* only about the asserted signatures. Verification of
* signature validity happens via the JarEntry apis.
*/
signerMap
=
new
HashMap
(
verifiedSigners
.
size
()
+
sigFileSigners
.
size
());
signerMap
.
putAll
(
verifiedSigners
);
signerMap
.
putAll
(
sigFileSigners
);
}
return
signerMap
;
}
public
synchronized
Enumeration
<
String
>
entryNames
(
JarFile
jar
,
final
CodeSource
[]
cs
)
{
final
Map
map
=
signerMap
();
final
Iterator
itor
=
map
.
entrySet
().
iterator
();
boolean
matchUnsigned
=
false
;
/*
* Grab a single copy of the CodeSigner arrays. Check
* to see if we can optimize CodeSigner equality test.
*/
List
req
=
new
ArrayList
(
cs
.
length
);
for
(
int
i
=
0
;
i
<
cs
.
length
;
i
++)
{
CodeSigner
[]
match
=
findMatchingSigners
(
cs
[
i
]);
if
(
match
!=
null
)
{
if
(
match
.
length
>
0
)
{
req
.
add
(
match
);
}
else
{
matchUnsigned
=
true
;
}
}
}
final
List
signersReq
=
req
;
final
Enumeration
enum2
=
(
matchUnsigned
)
?
unsignedEntryNames
(
jar
)
:
emptyEnumeration
;
return
new
Enumeration
<
String
>()
{
String
name
;
public
boolean
hasMoreElements
()
{
if
(
name
!=
null
)
{
return
true
;
}
while
(
itor
.
hasNext
())
{
Map
.
Entry
e
=
(
Map
.
Entry
)
itor
.
next
();
if
(
signersReq
.
contains
((
CodeSigner
[])
e
.
getValue
()))
{
name
=
(
String
)
e
.
getKey
();
return
true
;
}
}
while
(
enum2
.
hasMoreElements
())
{
name
=
(
String
)
enum2
.
nextElement
();
return
true
;
}
return
false
;
}
public
String
nextElement
()
{
if
(
hasMoreElements
())
{
String
value
=
name
;
name
=
null
;
return
value
;
}
throw
new
NoSuchElementException
();
}
};
}
/*
* Like entries() but screens out internal JAR mechanism entries
* and includes signed entries with no ZIP data.
*/
public
Enumeration
<
JarEntry
>
entries2
(
final
JarFile
jar
,
Enumeration
e
)
{
final
Map
map
=
new
HashMap
();
map
.
putAll
(
signerMap
());
final
Enumeration
enum_
=
e
;
return
new
Enumeration
<
JarEntry
>()
{
Enumeration
signers
=
null
;
JarEntry
entry
;
public
boolean
hasMoreElements
()
{
if
(
entry
!=
null
)
{
return
true
;
}
while
(
enum_
.
hasMoreElements
())
{
ZipEntry
ze
=
(
ZipEntry
)
enum_
.
nextElement
();
if
(
JarVerifier
.
isSigningRelated
(
ze
.
getName
()))
{
continue
;
}
entry
=
jar
.
newEntry
(
ze
);
return
true
;
}
if
(
signers
==
null
)
{
signers
=
Collections
.
enumeration
(
map
.
keySet
());
}
while
(
signers
.
hasMoreElements
())
{
String
name
=
(
String
)
signers
.
nextElement
();
entry
=
jar
.
newEntry
(
new
ZipEntry
(
name
));
return
true
;
}
// Any map entries left?
return
false
;
}
public
JarEntry
nextElement
()
{
if
(
hasMoreElements
())
{
JarEntry
je
=
entry
;
map
.
remove
(
je
.
getName
());
entry
=
null
;
return
je
;
}
throw
new
NoSuchElementException
();
}
};
}
private
Enumeration
emptyEnumeration
=
new
Enumeration
<
String
>()
{
public
boolean
hasMoreElements
()
{
return
false
;
}
public
String
nextElement
()
{
throw
new
NoSuchElementException
();
}
};
// true if file is part of the signature mechanism itself
static
boolean
isSigningRelated
(
String
name
)
{
name
=
name
.
toUpperCase
(
Locale
.
ENGLISH
);
if
(!
name
.
startsWith
(
"META-INF/"
))
{
return
false
;
}
name
=
name
.
substring
(
9
);
if
(
name
.
indexOf
(
'/'
)
!=
-
1
)
{
return
false
;
}
if
(
name
.
endsWith
(
".DSA"
)
||
name
.
endsWith
(
".RSA"
)
||
name
.
endsWith
(
".SF"
)
||
name
.
endsWith
(
".EC"
)
||
name
.
startsWith
(
"SIG-"
)
||
name
.
equals
(
"MANIFEST.MF"
))
{
return
true
;
}
return
false
;
}
private
Enumeration
<
String
>
unsignedEntryNames
(
JarFile
jar
)
{
final
Map
map
=
signerMap
();
final
Enumeration
entries
=
jar
.
entries
();
return
new
Enumeration
<
String
>()
{
String
name
;
/*
* Grab entries from ZIP directory but screen out
* metadata.
*/
public
boolean
hasMoreElements
()
{
if
(
name
!=
null
)
{
return
true
;
}
while
(
entries
.
hasMoreElements
())
{
String
value
;
ZipEntry
e
=
(
ZipEntry
)
entries
.
nextElement
();
value
=
e
.
getName
();
if
(
e
.
isDirectory
()
||
isSigningRelated
(
value
))
{
continue
;
}
if
(
map
.
get
(
value
)
==
null
)
{
name
=
value
;
return
true
;
}
}
return
false
;
}
public
String
nextElement
()
{
if
(
hasMoreElements
())
{
String
value
=
name
;
name
=
null
;
return
value
;
}
throw
new
NoSuchElementException
();
}
};
}
private
List
jarCodeSigners
;
private
synchronized
List
getJarCodeSigners
()
{
CodeSigner
[]
signers
;
if
(
jarCodeSigners
==
null
)
{
HashSet
set
=
new
HashSet
();
set
.
addAll
(
signerMap
().
values
());
jarCodeSigners
=
new
ArrayList
();
jarCodeSigners
.
addAll
(
set
);
}
return
jarCodeSigners
;
}
public
synchronized
CodeSource
[]
getCodeSources
(
JarFile
jar
,
URL
url
)
{
boolean
hasUnsigned
=
unsignedEntryNames
(
jar
).
hasMoreElements
();
return
mapSignersToCodeSources
(
url
,
getJarCodeSigners
(),
hasUnsigned
);
}
public
CodeSource
getCodeSource
(
URL
url
,
String
name
)
{
CodeSigner
[]
signers
;
signers
=
(
CodeSigner
[])
signerMap
().
get
(
name
);
return
mapSignersToCodeSource
(
url
,
signers
);
}
public
CodeSource
getCodeSource
(
URL
url
,
JarFile
jar
,
JarEntry
je
)
{
CodeSigner
[]
signers
;
return
mapSignersToCodeSource
(
url
,
getCodeSigners
(
jar
,
je
));
}
public
void
setEagerValidation
(
boolean
eager
)
{
eagerValidation
=
eager
;
}
public
synchronized
List
getManifestDigests
()
{
return
Collections
.
unmodifiableList
(
manifestDigests
);
}
static
CodeSource
getUnsignedCS
(
URL
url
)
{
return
new
VerifierCodeSource
(
null
,
url
,
(
java
.
security
.
cert
.
Certificate
[])
null
);
}
}
}
src/share/classes/java/util/jar/JavaUtilJarAccessImpl.java
浏览文件 @
dc0440a8
/*
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002,
2011,
Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -26,10 +26,38 @@
...
@@ -26,10 +26,38 @@
package
java.util.jar
;
package
java.util.jar
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.net.URL
;
import
java.security.CodeSource
;
import
java.util.Enumeration
;
import
java.util.List
;
import
sun.misc.JavaUtilJarAccess
;
import
sun.misc.JavaUtilJarAccess
;
class
JavaUtilJarAccessImpl
implements
JavaUtilJarAccess
{
class
JavaUtilJarAccessImpl
implements
JavaUtilJarAccess
{
public
boolean
jarFileHasClassPathAttribute
(
JarFile
jar
)
throws
IOException
{
public
boolean
jarFileHasClassPathAttribute
(
JarFile
jar
)
throws
IOException
{
return
jar
.
hasClassPathAttribute
();
return
jar
.
hasClassPathAttribute
();
}
}
public
CodeSource
[]
getCodeSources
(
JarFile
jar
,
URL
url
)
{
return
jar
.
getCodeSources
(
url
);
}
public
CodeSource
getCodeSource
(
JarFile
jar
,
URL
url
,
String
name
)
{
return
jar
.
getCodeSource
(
url
,
name
);
}
public
Enumeration
<
String
>
entryNames
(
JarFile
jar
,
CodeSource
[]
cs
)
{
return
jar
.
entryNames
(
cs
);
}
public
Enumeration
<
JarEntry
>
entries2
(
JarFile
jar
)
{
return
jar
.
entries2
();
}
public
void
setEagerValidation
(
JarFile
jar
,
boolean
eager
)
{
jar
.
setEagerValidation
(
eager
);
}
public
List
getManifestDigests
(
JarFile
jar
)
{
return
jar
.
getManifestDigests
();
}
}
}
src/share/classes/javax/script/ScriptEngineFactory.java
浏览文件 @
dc0440a8
...
@@ -115,20 +115,19 @@ public interface ScriptEngineFactory {
...
@@ -115,20 +115,19 @@ public interface ScriptEngineFactory {
* with respect to concurrent execution of scripts and maintenance of state is also defined.
* with respect to concurrent execution of scripts and maintenance of state is also defined.
* These values for the <code><b>THREADING</b></code> key are:<br><br>
* These values for the <code><b>THREADING</b></code> key are:<br><br>
* <ul>
* <ul>
* <
p
><code>null</code> - The engine implementation is not thread safe, and cannot
* <
li
><code>null</code> - The engine implementation is not thread safe, and cannot
* be used to execute scripts concurrently on multiple threads.
* be used to execute scripts concurrently on multiple threads.
* <
p
><code>"MULTITHREADED"</code> - The engine implementation is internally
* <
li
><code>"MULTITHREADED"</code> - The engine implementation is internally
* thread-safe and scripts may execute concurrently although effects of script execution
* thread-safe and scripts may execute concurrently although effects of script execution
* on one thread may be visible to scripts on other threads.
* on one thread may be visible to scripts on other threads.
* <
p
><code>"THREAD-ISOLATED"</code> - The implementation satisfies the requirements
* <
li
><code>"THREAD-ISOLATED"</code> - The implementation satisfies the requirements
* of "MULTITHREADED", and also, the engine maintains independent values
* of "MULTITHREADED", and also, the engine maintains independent values
* for symbols in scripts executing on different threads.
* for symbols in scripts executing on different threads.
* <
p
><code>"STATELESS"</code> - The implementation satisfies the requirements of
* <
li
><code>"STATELESS"</code> - The implementation satisfies the requirements of
* <code>"THREAD-ISOLATED"</code>. In addition, script executions do not alter the
* <
li><
code>"THREAD-ISOLATED"</code>. In addition, script executions do not alter the
* mappings in the <code>Bindings</code> which is the engine scope of the
* mappings in the <code>Bindings</code> which is the engine scope of the
* <code>ScriptEngine</code>. In particular, the keys in the <code>Bindings</code>
* <code>ScriptEngine</code>. In particular, the keys in the <code>Bindings</code>
* and their associated values are the same before and after the execution of the script.
* and their associated values are the same before and after the execution of the script.
* </li>
* </ul>
* </ul>
* <br><br>
* <br><br>
* Implementations may define implementation-specific keys.
* Implementations may define implementation-specific keys.
...
@@ -145,22 +144,23 @@ public interface ScriptEngineFactory {
...
@@ -145,22 +144,23 @@ public interface ScriptEngineFactory {
* of the supported scripting language. For instance, an implementaton for a Javascript
* of the supported scripting language. For instance, an implementaton for a Javascript
* engine might be;
* engine might be;
* <p>
* <p>
* <code><pre>
* <pre>
* <code>
* public String getMethodCallSyntax(String obj,
* public String getMethodCallSyntax(String obj,
* String m, String... args) {
* String m, String... args) {
* String ret = obj;
* String ret = obj;
* ret += "." + m + "(";
* ret += "." + m + "(";
* for (int i = 0; i < args.length; i++) {
* for (int i = 0; i < args.length; i++) {
* ret += args[i];
* ret += args[i];
* if (i == args.length - 1) {
* if (i < args.length - 1) {
* ret += ")";
* } else {
* ret += ",";
* ret += ",";
* }
* }
* }
* }
* ret += ")";
* return ret;
* return ret;
* }
* }
*</pre></code>
*</code>
*</pre>
* <p>
* <p>
*
*
* @param obj The name representing the object whose method is to be invoked. The
* @param obj The name representing the object whose method is to be invoked. The
...
...
src/share/classes/javax/sound/sampled/AudioSystem.java
浏览文件 @
dc0440a8
...
@@ -670,6 +670,12 @@ public class AudioSystem {
...
@@ -670,6 +670,12 @@ public class AudioSystem {
* <p>The returned <code>TargetDataLine</code>'s default
* <p>The returned <code>TargetDataLine</code>'s default
* audio format will be initialized with <code>format</code>.
* audio format will be initialized with <code>format</code>.
*
*
* <p>If the system property
* {@code javax.sound.sampled.TargetDataLine}
* is defined or it is defined in the file "sound.properties",
* it is used to retrieve the default target data line.
* For details, refer to the {@link AudioSystem class description}.
*
* @param format an <code>AudioFormat</code> object specifying
* @param format an <code>AudioFormat</code> object specifying
* the supported audio format of the returned line,
* the supported audio format of the returned line,
* or <code>null</code> for any audio format
* or <code>null</code> for any audio format
...
@@ -712,12 +718,6 @@ public class AudioSystem {
...
@@ -712,12 +718,6 @@ public class AudioSystem {
* <p>The returned <code>TargetDataLine</code>'s default
* <p>The returned <code>TargetDataLine</code>'s default
* audio format will be initialized with <code>format</code>.
* audio format will be initialized with <code>format</code>.
*
*
* <p>If the system property
* <code>javax.sound.sampled.TargetDataLine</code>
* is defined or it is defined in the file "sound.properties",
* it is used to retrieve the default target data line.
* For details, refer to the {@link AudioSystem class description}.
*
* @param format an <code>AudioFormat</code> object specifying
* @param format an <code>AudioFormat</code> object specifying
* the supported audio format of the returned line,
* the supported audio format of the returned line,
* or <code>null</code> for any audio format
* or <code>null</code> for any audio format
...
...
src/share/classes/javax/sql/rowset/serial/SerialClob.java
浏览文件 @
dc0440a8
...
@@ -57,10 +57,10 @@ public class SerialClob implements Clob, Serializable, Cloneable {
...
@@ -57,10 +57,10 @@ public class SerialClob implements Clob, Serializable, Cloneable {
private
char
buf
[];
private
char
buf
[];
/**
/**
* Internal Clob representation if SerialClob is intialized with a
* Internal Clob representation if SerialClob is in
i
tialized with a
* Clob
* Clob
. Null if SerialClob is initialized with a char[].
*/
*/
private
Clob
clob
;
private
final
Clob
clob
;
/**
/**
* The length in characters of this <code>SerialClob</code> object's
* The length in characters of this <code>SerialClob</code> object's
...
@@ -71,12 +71,12 @@ public class SerialClob implements Clob, Serializable, Cloneable {
...
@@ -71,12 +71,12 @@ public class SerialClob implements Clob, Serializable, Cloneable {
private
long
len
;
private
long
len
;
/**
/**
* The original length in characters of t
gu
s <code>SerialClob</code>
* The original length in characters of t
hi
s <code>SerialClob</code>
* objects internal array of characters.
* object
'
s internal array of characters.
*
*
* @serial
* @serial
*/
*/
private
long
origLen
;
private
final
long
origLen
;
/**
/**
* Constructs a <code>SerialClob</code> object that is a serialized version of
* Constructs a <code>SerialClob</code> object that is a serialized version of
...
@@ -104,6 +104,7 @@ public class SerialClob implements Clob, Serializable, Cloneable {
...
@@ -104,6 +104,7 @@ public class SerialClob implements Clob, Serializable, Cloneable {
buf
[
i
]
=
ch
[
i
];
buf
[
i
]
=
ch
[
i
];
}
}
origLen
=
len
;
origLen
=
len
;
clob
=
null
;
}
}
/**
/**
...
@@ -117,19 +118,19 @@ public class SerialClob implements Clob, Serializable, Cloneable {
...
@@ -117,19 +118,19 @@ public class SerialClob implements Clob, Serializable, Cloneable {
* the database. Otherwise, the new <code>SerialClob</code> object
* the database. Otherwise, the new <code>SerialClob</code> object
* object will contain no data.
* object will contain no data.
* <p>
* <p>
* Note: The <code>Clob</code> object supplied to this constructor
canno
t
* Note: The <code>Clob</code> object supplied to this constructor
mus
t
* return
<code>null</code> for
the <code>Clob.getCharacterStream()</code>
* return
non-null for both
the <code>Clob.getCharacterStream()</code>
* and <code>Clob.getAsciiStream</code> methods. This <code>SerialClob</code>
* and <code>Clob.getAsciiStream</code> methods. This <code>SerialClob</code>
* constructor cannot
serialize a <code>Clob</code> object in this instance
* constructor cannot serialize a <code>Clob</code> object in this instance
* and will throw an <code>SQLException</code> object.
* and will throw an <code>SQLException</code> object.
*
*
* @param clob the <code>Clob</code> object from which this
* @param clob the <code>Clob</code> object from which this
* <code>SerialClob</code> object is to be constructed; cannot be null
* <code>SerialClob</code> object is to be constructed; cannot be null
* @throws SerialException if an error occurs during serialization
* @throws SerialException if an error occurs during serialization
* @throws SQLException if a SQL error occurs in capturing the CLOB;
* @throws SQLException if a SQL error occurs in capturing the CLOB;
* if the <code>Clob</code> object is a null; or if
both
the
* if the <code>Clob</code> object is a null; or if
either of
the
* <code>Clob.getCharacterStream()</code> and <code>Clob.getAsciiStream()</code>
* <code>Clob.getCharacterStream()</code> and <code>Clob.getAsciiStream()</code>
* methods on the <code>Clob</code> return a null
* methods on the <code>Clob</code> return
s
a null
* @see java.sql.Clob
* @see java.sql.Clob
*/
*/
public
SerialClob
(
Clob
clob
)
throws
SerialException
,
SQLException
{
public
SerialClob
(
Clob
clob
)
throws
SerialException
,
SQLException
{
...
@@ -144,19 +145,27 @@ public class SerialClob implements Clob, Serializable, Cloneable {
...
@@ -144,19 +145,27 @@ public class SerialClob implements Clob, Serializable, Cloneable {
int
read
=
0
;
int
read
=
0
;
int
offset
=
0
;
int
offset
=
0
;
BufferedReader
reader
;
try
(
Reader
charStream
=
clob
.
getCharacterStream
())
{
if
(
(((
reader
=
new
BufferedReader
(
clob
.
getCharacterStream
()))
==
null
))
&&
if
(
charStream
==
null
)
{
(
clob
.
getAsciiStream
()
==
null
))
{
throw
new
SQLException
(
"Invalid Clob object. The call to getCharacterStream "
+
throw
new
SQLException
(
"Invalid Clob object. Calls to getCharacterStream "
+
"returned null which cannot be serialized."
);
"and getAsciiStream return null which cannot be serialized."
);
}
}
try
{
// Note: get an ASCII stream in order to null-check it,
do
{
// even though we don't do anything with it.
read
=
reader
.
read
(
buf
,
offset
,
(
int
)(
len
-
offset
));
try
(
InputStream
asciiStream
=
clob
.
getAsciiStream
())
{
offset
+=
read
;
if
(
asciiStream
==
null
)
{
}
while
(
read
>
0
);
throw
new
SQLException
(
"Invalid Clob object. The call to getAsciiStream "
+
"returned null which cannot be serialized."
);
}
}
try
(
Reader
reader
=
new
BufferedReader
(
charStream
))
{
do
{
read
=
reader
.
read
(
buf
,
offset
,
(
int
)(
len
-
offset
));
offset
+=
read
;
}
while
(
read
>
0
);
}
}
catch
(
java
.
io
.
IOException
ex
)
{
}
catch
(
java
.
io
.
IOException
ex
)
{
throw
new
SerialException
(
"SerialClob: "
+
ex
.
getMessage
());
throw
new
SerialException
(
"SerialClob: "
+
ex
.
getMessage
());
}
}
...
@@ -207,13 +216,13 @@ public class SerialClob implements Clob, Serializable, Cloneable {
...
@@ -207,13 +216,13 @@ public class SerialClob implements Clob, Serializable, Cloneable {
* used to create this <code>SerialClob</code> object
* used to create this <code>SerialClob</code> object
*/
*/
public
java
.
io
.
InputStream
getAsciiStream
()
throws
SerialException
,
SQLException
{
public
java
.
io
.
InputStream
getAsciiStream
()
throws
SerialException
,
SQLException
{
if
(
this
.
clob
!=
null
)
{
if
(
this
.
clob
!=
null
)
{
return
this
.
clob
.
getAsciiStream
();
return
this
.
clob
.
getAsciiStream
();
}
else
{
}
else
{
throw
new
SerialException
(
"Unsupported operation. SerialClob cannot "
+
throw
new
SerialException
(
"Unsupported operation. SerialClob cannot "
+
"return a the CLOB value as an ascii stream, unless instantiated "
+
"return a the CLOB value as an ascii stream, unless instantiated "
+
"with a fully implemented Clob object."
);
"with a fully implemented Clob object."
);
}
}
}
}
/**
/**
...
...
src/share/classes/javax/sql/rowset/spi/SyncFactory.java
浏览文件 @
dc0440a8
...
@@ -32,6 +32,7 @@ import java.sql.*;
...
@@ -32,6 +32,7 @@ import java.sql.*;
import
javax.sql.*
;
import
javax.sql.*
;
import
java.io.FileInputStream
;
import
java.io.FileInputStream
;
import
java.io.InputStream
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.FileNotFoundException
;
import
java.io.FileNotFoundException
;
...
@@ -366,7 +367,9 @@ public class SyncFactory {
...
@@ -366,7 +367,9 @@ public class SyncFactory {
// Load user's implementation of SyncProvider
// Load user's implementation of SyncProvider
// here. -Drowset.properties=/abc/def/pqr.txt
// here. -Drowset.properties=/abc/def/pqr.txt
ROWSET_PROPERTIES
=
strRowsetProperties
;
ROWSET_PROPERTIES
=
strRowsetProperties
;
properties
.
load
(
new
FileInputStream
(
ROWSET_PROPERTIES
));
try
(
FileInputStream
fis
=
new
FileInputStream
(
ROWSET_PROPERTIES
))
{
properties
.
load
(
fis
);
}
parseProperties
(
properties
);
parseProperties
(
properties
);
}
}
...
@@ -376,12 +379,19 @@ public class SyncFactory {
...
@@ -376,12 +379,19 @@ public class SyncFactory {
ROWSET_PROPERTIES
=
"javax"
+
strFileSep
+
"sql"
+
ROWSET_PROPERTIES
=
"javax"
+
strFileSep
+
"sql"
+
strFileSep
+
"rowset"
+
strFileSep
+
strFileSep
+
"rowset"
+
strFileSep
+
"rowset.properties"
;
"rowset.properties"
;
// properties.load(
// ClassLoader.getSystemResourceAsStream(ROWSET_PROPERTIES));
ClassLoader
cl
=
Thread
.
currentThread
().
getContextClassLoader
();
ClassLoader
cl
=
Thread
.
currentThread
().
getContextClassLoader
();
properties
.
load
(
cl
.
getResourceAsStream
(
ROWSET_PROPERTIES
));
try
(
InputStream
stream
=
(
cl
==
null
)
?
ClassLoader
.
getSystemResourceAsStream
(
ROWSET_PROPERTIES
)
:
cl
.
getResourceAsStream
(
ROWSET_PROPERTIES
))
{
if
(
stream
==
null
)
{
throw
new
SyncFactoryException
(
"Resource "
+
ROWSET_PROPERTIES
+
" not found"
);
}
properties
.
load
(
stream
);
}
parseProperties
(
properties
);
parseProperties
(
properties
);
// removed else, has properties should sum together
// removed else, has properties should sum together
...
...
src/share/classes/javax/swing/JComponent.java
浏览文件 @
dc0440a8
...
@@ -4910,14 +4910,17 @@ public abstract class JComponent extends Container implements Serializable,
...
@@ -4910,14 +4910,17 @@ public abstract class JComponent extends Container implements Serializable,
* Returns {@code true} if a paint triggered on a child component should cause
* Returns {@code true} if a paint triggered on a child component should cause
* painting to originate from this Component, or one of its ancestors.
* painting to originate from this Component, or one of its ancestors.
* <p/>
* <p/>
* Calling {@link JComponent#repaint} on a Swing component will be delegated to
* Calling {@link #repaint} or {@link #paintImmediately(int, int, int, int)}
* the first ancestor which {@code isPaintingOrigin()} returns {@code true},
* on a Swing component will result in calling
* if there are any.
* the {@link JComponent#paintImmediately(int, int, int, int)} method of
* the first ancestor which {@code isPaintingOrigin()} returns {@code true}, if there are any.
* <p/>
* <p/>
* {@code JComponent} subclasses that need to be
re
painted when any of their
* {@code JComponent} subclasses that need to be painted when any of their
* children are repainted should override this method to return {@code true}.
* children are repainted should override this method to return {@code true}.
*
*
* @return always returns {@code false}
* @return always returns {@code false}
*
* @see #paintImmediately(int, int, int, int)
*/
*/
protected
boolean
isPaintingOrigin
()
{
protected
boolean
isPaintingOrigin
()
{
return
false
;
return
false
;
...
@@ -4932,12 +4935,16 @@ public abstract class JComponent extends Container implements Serializable,
...
@@ -4932,12 +4935,16 @@ public abstract class JComponent extends Container implements Serializable,
* and can collapse redundant requests into a single paint call.
* and can collapse redundant requests into a single paint call.
* This method is useful if one needs to update the display while
* This method is useful if one needs to update the display while
* the current event is being dispatched.
* the current event is being dispatched.
* <p>
* This method is to be overridden when the dirty region needs to be changed
* for components that are painting origins.
*
*
* @param x the x value of the region to be painted
* @param x the x value of the region to be painted
* @param y the y value of the region to be painted
* @param y the y value of the region to be painted
* @param w the width of the region to be painted
* @param w the width of the region to be painted
* @param h the height of the region to be painted
* @param h the height of the region to be painted
* @see #repaint
* @see #repaint
* @see #isPaintingOrigin()
*/
*/
public
void
paintImmediately
(
int
x
,
int
y
,
int
w
,
int
h
)
{
public
void
paintImmediately
(
int
x
,
int
y
,
int
w
,
int
h
)
{
Component
c
=
this
;
Component
c
=
this
;
...
@@ -4946,6 +4953,15 @@ public abstract class JComponent extends Container implements Serializable,
...
@@ -4946,6 +4953,15 @@ public abstract class JComponent extends Container implements Serializable,
if
(!
isShowing
())
{
if
(!
isShowing
())
{
return
;
return
;
}
}
JComponent
paintingOigin
=
SwingUtilities
.
getPaintingOrigin
(
this
);
if
(
paintingOigin
!=
null
)
{
Rectangle
rectangle
=
SwingUtilities
.
convertRectangle
(
c
,
new
Rectangle
(
x
,
y
,
w
,
h
),
paintingOigin
);
paintingOigin
.
paintImmediately
(
rectangle
.
x
,
rectangle
.
y
,
rectangle
.
width
,
rectangle
.
height
);
return
;
}
while
(!
c
.
isOpaque
())
{
while
(!
c
.
isOpaque
())
{
parent
=
c
.
getParent
();
parent
=
c
.
getParent
();
if
(
parent
!=
null
)
{
if
(
parent
!=
null
)
{
...
...
src/share/classes/javax/swing/JLayer.java
浏览文件 @
dc0440a8
...
@@ -156,8 +156,9 @@ public final class JLayer<V extends Component>
...
@@ -156,8 +156,9 @@ public final class JLayer<V extends Component>
// when layerUI is serializable
// when layerUI is serializable
private
LayerUI
<?
super
V
>
layerUI
;
private
LayerUI
<?
super
V
>
layerUI
;
private
JPanel
glassPane
;
private
JPanel
glassPane
;
private
boolean
isPainting
;
private
long
eventMask
;
private
long
eventMask
;
private
transient
boolean
isPainting
;
private
transient
boolean
isPaintingImmediately
;
private
static
final
LayerEventController
eventController
=
private
static
final
LayerEventController
eventController
=
new
LayerEventController
();
new
LayerEventController
();
...
@@ -393,17 +394,25 @@ public final class JLayer<V extends Component>
...
@@ -393,17 +394,25 @@ public final class JLayer<V extends Component>
}
}
/**
/**
* Delegates repainting to {@link javax.swing.plaf.LayerUI#repaint} method.
* Delegates its functionality to the
* {@link javax.swing.plaf.LayerUI#paintImmediately(int, int, int, int, JLayer)} method,
* if {@code LayerUI} is set.
*
*
* @param tm this parameter is not used
* @param x the x value of the region to be painted
* @param x the x value of the dirty region
* @param y the y value of the region to be painted
* @param y the y value of the dirty region
* @param w the width of the region to be painted
* @param width the width of the dirty region
* @param h the height of the region to be painted
* @param height the height of the dirty region
*/
*/
public
void
paintImmediately
(
int
x
,
int
y
,
int
w
,
int
h
)
{
public
void
repaint
(
long
tm
,
int
x
,
int
y
,
int
width
,
int
height
)
{
if
(!
isPaintingImmediately
&&
getUI
()
!=
null
)
{
if
(
getUI
()
!=
null
)
{
isPaintingImmediately
=
true
;
getUI
().
repaint
(
tm
,
x
,
y
,
width
,
height
,
this
);
try
{
getUI
().
paintImmediately
(
x
,
y
,
w
,
h
,
this
);
}
finally
{
isPaintingImmediately
=
false
;
}
}
else
{
super
.
paintImmediately
(
x
,
y
,
w
,
h
);
}
}
}
}
...
@@ -415,8 +424,11 @@ public final class JLayer<V extends Component>
...
@@ -415,8 +424,11 @@ public final class JLayer<V extends Component>
public
void
paint
(
Graphics
g
)
{
public
void
paint
(
Graphics
g
)
{
if
(!
isPainting
)
{
if
(!
isPainting
)
{
isPainting
=
true
;
isPainting
=
true
;
super
.
paintComponent
(
g
);
try
{
isPainting
=
false
;
super
.
paintComponent
(
g
);
}
finally
{
isPainting
=
false
;
}
}
else
{
}
else
{
super
.
paint
(
g
);
super
.
paint
(
g
);
}
}
...
...
src/share/classes/javax/swing/LookAndFeel.java
浏览文件 @
dc0440a8
...
@@ -332,12 +332,13 @@ public abstract class LookAndFeel
...
@@ -332,12 +332,13 @@ public abstract class LookAndFeel
{
{
JTextComponent
.
KeyBinding
[]
rv
=
new
JTextComponent
.
KeyBinding
[
keyBindingList
.
length
/
2
];
JTextComponent
.
KeyBinding
[]
rv
=
new
JTextComponent
.
KeyBinding
[
keyBindingList
.
length
/
2
];
for
(
int
i
=
0
;
i
<
keyBindingList
.
length
;
i
+=
2
)
{
for
(
int
i
=
0
;
i
<
rv
.
length
;
i
++)
{
KeyStroke
keystroke
=
(
keyBindingList
[
i
]
instanceof
KeyStroke
)
Object
o
=
keyBindingList
[
2
*
i
];
?
(
KeyStroke
)
keyBindingList
[
i
]
KeyStroke
keystroke
=
(
o
instanceof
KeyStroke
)
:
KeyStroke
.
getKeyStroke
((
String
)
keyBindingList
[
i
]);
?
(
KeyStroke
)
o
String
action
=
(
String
)
keyBindingList
[
i
+
1
];
:
KeyStroke
.
getKeyStroke
((
String
)
o
);
rv
[
i
/
2
]
=
new
JTextComponent
.
KeyBinding
(
keystroke
,
action
);
String
action
=
(
String
)
keyBindingList
[
2
*
i
+
1
];
rv
[
i
]
=
new
JTextComponent
.
KeyBinding
(
keystroke
,
action
);
}
}
return
rv
;
return
rv
;
...
...
src/share/classes/javax/swing/RepaintManager.java
浏览文件 @
dc0440a8
...
@@ -438,7 +438,6 @@ public class RepaintManager
...
@@ -438,7 +438,6 @@ public class RepaintManager
* @param y Y coordinate of the region to repaint
* @param y Y coordinate of the region to repaint
* @param w Width of the region to repaint
* @param w Width of the region to repaint
* @param h Height of the region to repaint
* @param h Height of the region to repaint
* @see JComponent#isPaintingOrigin()
* @see JComponent#repaint
* @see JComponent#repaint
*/
*/
public
void
addDirtyRegion
(
JComponent
c
,
int
x
,
int
y
,
int
w
,
int
h
)
public
void
addDirtyRegion
(
JComponent
c
,
int
x
,
int
y
,
int
w
,
int
h
)
...
@@ -448,16 +447,6 @@ public class RepaintManager
...
@@ -448,16 +447,6 @@ public class RepaintManager
delegate
.
addDirtyRegion
(
c
,
x
,
y
,
w
,
h
);
delegate
.
addDirtyRegion
(
c
,
x
,
y
,
w
,
h
);
return
;
return
;
}
}
Container
p
=
c
;
while
((
p
=
p
.
getParent
())
instanceof
JComponent
)
{
JComponent
jp
=
(
JComponent
)
p
;
if
(
jp
.
isPaintingOrigin
())
{
Rectangle
rectangle
=
SwingUtilities
.
convertRectangle
(
c
,
new
Rectangle
(
x
,
y
,
w
,
h
),
jp
);
jp
.
repaint
(
0
,
rectangle
.
x
,
rectangle
.
y
,
rectangle
.
width
,
rectangle
.
height
);
return
;
}
}
addDirtyRegion0
(
c
,
x
,
y
,
w
,
h
);
addDirtyRegion0
(
c
,
x
,
y
,
w
,
h
);
}
}
...
...
src/share/classes/javax/swing/SwingUtilities.java
浏览文件 @
dc0440a8
...
@@ -1532,6 +1532,17 @@ public class SwingUtilities implements SwingConstants
...
@@ -1532,6 +1532,17 @@ public class SwingUtilities implements SwingConstants
return
applet
;
return
applet
;
}
}
static
JComponent
getPaintingOrigin
(
JComponent
c
)
{
Container
p
=
c
;
while
((
p
=
p
.
getParent
())
instanceof
JComponent
)
{
JComponent
jp
=
(
JComponent
)
p
;
if
(
jp
.
isPaintingOrigin
())
{
return
jp
;
}
}
return
null
;
}
/**
/**
* Process the key bindings for the <code>Component</code> associated with
* Process the key bindings for the <code>Component</code> associated with
* <code>event</code>. This method is only useful if
* <code>event</code>. This method is only useful if
...
...
src/share/classes/javax/swing/plaf/LayerUI.java
浏览文件 @
dc0440a8
...
@@ -703,21 +703,19 @@ public class LayerUI<V extends Component>
...
@@ -703,21 +703,19 @@ public class LayerUI<V extends Component>
}
}
/**
/**
* Adds the specified region to the dirty region list if the component
* Paints the specified region in the {@code JLayer} this {@code LayerUI} is set to, immediately.
* is showing. The component will be repainted after all of the
* currently pending events have been dispatched.
* <p/>
* <p/>
* This method is to be overridden when the dirty region needs to be changed.
* This method is to be overridden when the dirty region needs to be changed.
* The default implementation delegates its functionality to {@link JComponent#paintImmediately(int, int, int, int)}.
*
*
* @param tm this parameter is not used
* @param x the x value of the region to be painted
* @param x the x value of the dirty region
* @param y the y value of the region to be painted
* @param y the y value of the dirty region
* @param w the width of the region to be painted
* @param width the width of the dirty region
* @param h the height of the region to be painted
* @param height the height of the dirty region
*
* @see java.awt.Component#isShowing
* @see JComponent#paintImmediately(int, int, int, int)
* @see RepaintManager#addDirtyRegion
*/
*/
public
void
repaint
(
long
tm
,
int
x
,
int
y
,
int
width
,
int
height
,
JLayer
<?
extends
V
>
l
)
{
public
void
paintImmediately
(
int
x
,
int
y
,
int
width
,
int
height
,
JLayer
<?
extends
V
>
l
)
{
RepaintManager
.
currentManager
(
l
).
addDirtyRegion
(
l
,
x
,
y
,
width
,
height
);
l
.
paintImmediately
(
x
,
y
,
width
,
height
);
}
}
}
}
src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java
浏览文件 @
dc0440a8
...
@@ -1965,18 +1965,18 @@ public class BasicTreeUI extends TreeUI
...
@@ -1965,18 +1965,18 @@ public class BasicTreeUI extends TreeUI
}
}
/** Returns the preferred size to properly display the tree,
/** Returns the preferred size to properly display the tree,
* this is a cover method for getPreferredSize(c,
fals
e).
* this is a cover method for getPreferredSize(c,
tru
e).
*/
*/
public
Dimension
getPreferredSize
(
JComponent
c
)
{
public
Dimension
getPreferredSize
(
JComponent
c
)
{
return
getPreferredSize
(
c
,
true
);
return
getPreferredSize
(
c
,
true
);
}
}
/** Returns the preferred size to represent the tree in
/** Returns the preferred size to represent the tree in
* <I>c</I>. If <I>checkConsist
a
ncy</I> is true
* <I>c</I>. If <I>checkConsist
e
ncy</I> is true
* <b>checkConsist
a
ncy</b> is messaged first.
* <b>checkConsist
e
ncy</b> is messaged first.
*/
*/
public
Dimension
getPreferredSize
(
JComponent
c
,
public
Dimension
getPreferredSize
(
JComponent
c
,
boolean
checkConsist
a
ncy
)
{
boolean
checkConsist
e
ncy
)
{
Dimension
pSize
=
this
.
getPreferredMinSize
();
Dimension
pSize
=
this
.
getPreferredMinSize
();
if
(!
validCachedPreferredSize
)
if
(!
validCachedPreferredSize
)
...
...
src/share/classes/javax/swing/plaf/synth/SynthGraphicsUtils.java
浏览文件 @
dc0440a8
...
@@ -510,7 +510,6 @@ public class SynthGraphicsUtils {
...
@@ -510,7 +510,6 @@ public class SynthGraphicsUtils {
Font
holdf
=
g
.
getFont
();
Font
holdf
=
g
.
getFont
();
Color
holdc
=
g
.
getColor
();
Color
holdc
=
g
.
getColor
();
paintBackground
(
g
,
lh
);
paintCheckIcon
(
g
,
lh
,
lr
);
paintCheckIcon
(
g
,
lh
,
lr
);
paintIcon
(
g
,
lh
,
lr
);
paintIcon
(
g
,
lh
,
lr
);
paintText
(
g
,
lh
,
lr
);
paintText
(
g
,
lh
,
lr
);
...
...
src/share/classes/sun/awt/image/ImageFetcher.java
浏览文件 @
dc0440a8
...
@@ -61,8 +61,10 @@ class ImageFetcher extends Thread {
...
@@ -61,8 +61,10 @@ class ImageFetcher extends Thread {
/**
/**
* Adds an ImageFetchable to the queue of items to fetch. Instantiates
* Adds an ImageFetchable to the queue of items to fetch. Instantiates
* a new ImageFetcher if it's reasonable to do so.
* a new ImageFetcher if it's reasonable to do so.
* If there is no available fetcher to process an ImageFetchable, then
* reports failure to caller.
*/
*/
public
static
void
add
(
ImageFetchable
src
)
{
public
static
boolean
add
(
ImageFetchable
src
)
{
final
FetcherInfo
info
=
FetcherInfo
.
getFetcherInfo
();
final
FetcherInfo
info
=
FetcherInfo
.
getFetcherInfo
();
synchronized
(
info
.
waitList
)
{
synchronized
(
info
.
waitList
)
{
if
(!
info
.
waitList
.
contains
(
src
))
{
if
(!
info
.
waitList
.
contains
(
src
))
{
...
@@ -71,9 +73,23 @@ class ImageFetcher extends Thread {
...
@@ -71,9 +73,23 @@ class ImageFetcher extends Thread {
info
.
numFetchers
<
info
.
fetchers
.
length
)
{
info
.
numFetchers
<
info
.
fetchers
.
length
)
{
createFetchers
(
info
);
createFetchers
(
info
);
}
}
info
.
waitList
.
notify
();
/* Creation of new fetcher may fail due to high vm load
* or some other reason.
* If there is already exist, but busy, fetcher, we leave
* the src in queue (it will be handled by existing
* fetcher later).
* Otherwise, we report failure: there is no fetcher
* to handle the src.
*/
if
(
info
.
numFetchers
>
0
)
{
info
.
waitList
.
notify
();
}
else
{
info
.
waitList
.
removeElement
(
src
);
return
false
;
}
}
}
}
}
return
true
;
}
}
/**
/**
...
@@ -291,11 +307,15 @@ class ImageFetcher extends Thread {
...
@@ -291,11 +307,15 @@ class ImageFetcher extends Thread {
public
Object
run
()
{
public
Object
run
()
{
for
(
int
i
=
0
;
i
<
info
.
fetchers
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
info
.
fetchers
.
length
;
i
++)
{
if
(
info
.
fetchers
[
i
]
==
null
)
{
if
(
info
.
fetchers
[
i
]
==
null
)
{
info
.
fetchers
[
i
]
=
new
ImageFetcher
(
ImageFetcher
f
=
new
ImageFetcher
(
fetcherGroup
,
i
);
fetcherGroup
,
i
);
info
.
fetchers
[
i
].
start
();
try
{
info
.
numFetchers
++;
f
.
start
();
break
;
info
.
fetchers
[
i
]
=
f
;
info
.
numFetchers
++;
break
;
}
catch
(
Error
e
)
{
}
}
}
}
}
return
null
;
return
null
;
...
...
src/share/classes/sun/awt/image/InputStreamImageSource.java
浏览文件 @
dc0440a8
...
@@ -164,8 +164,13 @@ public abstract class InputStreamImageSource implements ImageProducer,
...
@@ -164,8 +164,13 @@ public abstract class InputStreamImageSource implements ImageProducer,
private
synchronized
void
startProduction
()
{
private
synchronized
void
startProduction
()
{
if
(!
awaitingFetch
)
{
if
(!
awaitingFetch
)
{
ImageFetcher
.
add
(
this
);
if
(
ImageFetcher
.
add
(
this
))
{
awaitingFetch
=
true
;
awaitingFetch
=
true
;
}
else
{
ImageConsumerQueue
cq
=
consumers
;
consumers
=
null
;
errorAllConsumers
(
cq
,
false
);
}
}
}
}
}
...
...
src/share/classes/sun/font/FontUtilities.java
浏览文件 @
dc0440a8
...
@@ -30,6 +30,8 @@ import java.io.BufferedReader;
...
@@ -30,6 +30,8 @@ import java.io.BufferedReader;
import
java.io.File
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.FileInputStream
;
import
java.io.InputStreamReader
;
import
java.io.InputStreamReader
;
import
java.lang.ref.SoftReference
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.security.AccessController
;
import
java.security.AccessController
;
import
java.security.PrivilegedAction
;
import
java.security.PrivilegedAction
;
...
@@ -383,6 +385,10 @@ public final class FontUtilities {
...
@@ -383,6 +385,10 @@ public final class FontUtilities {
* }
* }
* return fuir;
* return fuir;
*/
*/
private
static
volatile
SoftReference
<
ConcurrentHashMap
<
PhysicalFont
,
CompositeFont
>>
compMapRef
=
new
SoftReference
(
null
);
public
static
FontUIResource
getCompositeFontUIResource
(
Font
font
)
{
public
static
FontUIResource
getCompositeFontUIResource
(
Font
font
)
{
FontUIResource
fuir
=
new
FontUIResource
(
font
);
FontUIResource
fuir
=
new
FontUIResource
(
font
);
...
@@ -402,12 +408,22 @@ public final class FontUtilities {
...
@@ -402,12 +408,22 @@ public final class FontUtilities {
FontManager
fm
=
FontManagerFactory
.
getInstance
();
FontManager
fm
=
FontManagerFactory
.
getInstance
();
CompositeFont
dialog2D
=
CompositeFont
dialog2D
=
(
CompositeFont
)
fm
.
findFont2D
(
"dialog"
,
font
.
getStyle
(),
FontManager
.
NO_FALLBACK
);
(
CompositeFont
)
fm
.
findFont2D
(
"dialog"
,
font
.
getStyle
(),
FontManager
.
NO_FALLBACK
);
if
(
dialog2D
==
null
)
{
/* shouldn't happen */
if
(
dialog2D
==
null
)
{
/* shouldn't happen */
return
fuir
;
return
fuir
;
}
}
PhysicalFont
physicalFont
=
(
PhysicalFont
)
font2D
;
PhysicalFont
physicalFont
=
(
PhysicalFont
)
font2D
;
CompositeFont
compFont
=
new
CompositeFont
(
physicalFont
,
dialog2D
);
ConcurrentHashMap
<
PhysicalFont
,
CompositeFont
>
compMap
=
compMapRef
.
get
();
if
(
compMap
==
null
)
{
// Its been collected.
compMap
=
new
ConcurrentHashMap
<
PhysicalFont
,
CompositeFont
>();
compMapRef
=
new
SoftReference
(
compMap
);
}
CompositeFont
compFont
=
compMap
.
get
(
physicalFont
);
if
(
compFont
==
null
)
{
compFont
=
new
CompositeFont
(
physicalFont
,
dialog2D
);
compMap
.
put
(
physicalFont
,
compFont
);
}
FontAccess
.
getFontAccess
().
setFont2D
(
fuir
,
compFont
.
handle
);
FontAccess
.
getFontAccess
().
setFont2D
(
fuir
,
compFont
.
handle
);
/* marking this as a created font is needed as only created fonts
/* marking this as a created font is needed as only created fonts
* copy their creator's handles.
* copy their creator's handles.
...
...
src/share/classes/sun/misc/JarIndex.java
浏览文件 @
dc0440a8
...
@@ -103,6 +103,19 @@ public class JarIndex {
...
@@ -103,6 +103,19 @@ public class JarIndex {
parseJars
(
files
);
parseJars
(
files
);
}
}
/**
* Returns the jar index, or <code>null</code> if none.
*
* This single parameter version of the method is retained
* for binary compatibility with earlier releases.
*
* @param jar the JAR file to get the index from.
* @exception IOException if an I/O error has occurred.
*/
public
static
JarIndex
getJarIndex
(
JarFile
jar
)
throws
IOException
{
return
getJarIndex
(
jar
,
null
);
}
/**
/**
* Returns the jar index, or <code>null</code> if none.
* Returns the jar index, or <code>null</code> if none.
*
*
...
...
src/share/classes/sun/misc/JavaUtilJarAccess.java
浏览文件 @
dc0440a8
/*
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002,
2011,
Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -26,8 +26,19 @@
...
@@ -26,8 +26,19 @@
package
sun.misc
;
package
sun.misc
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.net.URL
;
import
java.security.CodeSource
;
import
java.util.Enumeration
;
import
java.util.List
;
import
java.util.jar.JarEntry
;
import
java.util.jar.JarFile
;
import
java.util.jar.JarFile
;
public
interface
JavaUtilJarAccess
{
public
interface
JavaUtilJarAccess
{
public
boolean
jarFileHasClassPathAttribute
(
JarFile
jar
)
throws
IOException
;
public
boolean
jarFileHasClassPathAttribute
(
JarFile
jar
)
throws
IOException
;
public
CodeSource
[]
getCodeSources
(
JarFile
jar
,
URL
url
);
public
CodeSource
getCodeSource
(
JarFile
jar
,
URL
url
,
String
name
);
public
Enumeration
<
String
>
entryNames
(
JarFile
jar
,
CodeSource
[]
cs
);
public
Enumeration
<
JarEntry
>
entries2
(
JarFile
jar
);
public
void
setEagerValidation
(
JarFile
jar
,
boolean
eager
);
public
List
getManifestDigests
(
JarFile
jar
);
}
}
src/share/classes/sun/net/www/protocol/jar/URLJarFile.java
浏览文件 @
dc0440a8
...
@@ -27,6 +27,9 @@ package sun.net.www.protocol.jar;
...
@@ -27,6 +27,9 @@ package sun.net.www.protocol.jar;
import
java.io.*
;
import
java.io.*
;
import
java.net.*
;
import
java.net.*
;
import
java.nio.file.Files
;
import
java.nio.file.Path
;
import
java.nio.file.StandardCopyOption
;
import
java.util.*
;
import
java.util.*
;
import
java.util.jar.*
;
import
java.util.jar.*
;
import
java.util.zip.ZipFile
;
import
java.util.zip.ZipFile
;
...
@@ -208,38 +211,23 @@ public class URLJarFile extends JarFile {
...
@@ -208,38 +211,23 @@ public class URLJarFile extends JarFile {
JarFile
result
=
null
;
JarFile
result
=
null
;
/* get the stream before asserting privileges */
/* get the stream before asserting privileges */
final
InputStream
in
=
url
.
openConnection
().
getInputStream
();
try
(
final
InputStream
in
=
url
.
openConnection
().
getInputStream
())
{
try
{
result
=
AccessController
.
doPrivileged
(
result
=
AccessController
.
doPrivileged
(
new
PrivilegedExceptionAction
<
JarFile
>()
{
new
PrivilegedExceptionAction
<
JarFile
>()
{
public
JarFile
run
()
throws
IOException
{
public
JarFile
run
()
throws
IOException
{
OutputStream
out
=
null
;
Path
tmpFile
=
Files
.
createTempFile
(
"jar_cache"
,
null
);
File
tmpFile
=
null
;
try
{
try
{
tmpFile
=
File
.
createTempFile
(
"jar_cache"
,
null
);
Files
.
copy
(
in
,
tmpFile
,
StandardCopyOption
.
REPLACE_EXISTING
);
tmpFile
.
deleteOnExit
();
JarFile
jarFile
=
new
URLJarFile
(
tmpFile
.
toFile
(),
closeController
);
out
=
new
FileOutputStream
(
tmpFile
);
tmpFile
.
toFile
().
deleteOnExit
();
int
read
=
0
;
return
jarFile
;
byte
[]
buf
=
new
byte
[
BUF_SIZE
];
}
catch
(
Throwable
thr
)
{
while
((
read
=
in
.
read
(
buf
))
!=
-
1
)
{
try
{
out
.
write
(
buf
,
0
,
read
);
Files
.
delete
(
tmpFile
);
}
}
catch
(
IOException
ioe
)
{
out
.
close
();
thr
.
addSuppressed
(
ioe
);
out
=
null
;
return
new
URLJarFile
(
tmpFile
,
closeController
);
}
catch
(
IOException
e
)
{
if
(
tmpFile
!=
null
)
{
tmpFile
.
delete
();
}
throw
e
;
}
finally
{
if
(
in
!=
null
)
{
in
.
close
();
}
if
(
out
!=
null
)
{
out
.
close
();
}
}
throw
thr
;
}
}
}
}
});
});
...
...
src/share/classes/sun/nio/ch/FileChannelImpl.java
浏览文件 @
dc0440a8
...
@@ -51,6 +51,7 @@ public class FileChannelImpl
...
@@ -51,6 +51,7 @@ public class FileChannelImpl
// File access mode (immutable)
// File access mode (immutable)
private
final
boolean
writable
;
private
final
boolean
writable
;
private
final
boolean
readable
;
private
final
boolean
readable
;
private
final
boolean
append
;
// Required to prevent finalization of creating stream (immutable)
// Required to prevent finalization of creating stream (immutable)
private
final
Object
parent
;
private
final
Object
parent
;
...
@@ -67,6 +68,7 @@ public class FileChannelImpl
...
@@ -67,6 +68,7 @@ public class FileChannelImpl
this
.
fd
=
fd
;
this
.
fd
=
fd
;
this
.
readable
=
readable
;
this
.
readable
=
readable
;
this
.
writable
=
writable
;
this
.
writable
=
writable
;
this
.
append
=
append
;
this
.
parent
=
parent
;
this
.
parent
=
parent
;
this
.
nd
=
new
FileDispatcherImpl
(
append
);
this
.
nd
=
new
FileDispatcherImpl
(
append
);
}
}
...
@@ -242,7 +244,8 @@ public class FileChannelImpl
...
@@ -242,7 +244,8 @@ public class FileChannelImpl
if
(!
isOpen
())
if
(!
isOpen
())
return
0
;
return
0
;
do
{
do
{
p
=
position0
(
fd
,
-
1
);
// in append-mode then position is advanced to end before writing
p
=
(
append
)
?
nd
.
size
(
fd
)
:
position0
(
fd
,
-
1
);
}
while
((
p
==
IOStatus
.
INTERRUPTED
)
&&
isOpen
());
}
while
((
p
==
IOStatus
.
INTERRUPTED
)
&&
isOpen
());
return
IOStatus
.
normalize
(
p
);
return
IOStatus
.
normalize
(
p
);
}
finally
{
}
finally
{
...
...
src/share/classes/sun/security/jgss/wrapper/SunNativeProvider.java
浏览文件 @
dc0440a8
...
@@ -87,6 +87,7 @@ public final class SunNativeProvider extends Provider {
...
@@ -87,6 +87,7 @@ public final class SunNativeProvider extends Provider {
gssLibs
=
new
String
[]{
gssLibs
=
new
String
[]{
"libgssapi.so"
,
"libgssapi.so"
,
"libgssapi_krb5.so"
,
"libgssapi_krb5.so"
,
"libgssapi_krb5.so.2"
,
};
};
}
}
}
else
{
}
else
{
...
...
src/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java
浏览文件 @
dc0440a8
...
@@ -231,13 +231,6 @@ public class PKIXCertPathValidator extends CertPathValidatorSpi {
...
@@ -231,13 +231,6 @@ public class PKIXCertPathValidator extends CertPathValidatorSpi {
AdaptableX509CertSelector
issuerSelector
=
AdaptableX509CertSelector
issuerSelector
=
new
AdaptableX509CertSelector
();
new
AdaptableX509CertSelector
();
// check trusted certificate's key usage
boolean
[]
usages
=
trustedCert
.
getKeyUsage
();
if
(
usages
!=
null
)
{
usages
[
5
]
=
true
;
// keyCertSign
issuerSelector
.
setKeyUsage
(
usages
);
}
// check trusted certificate's subject
// check trusted certificate's subject
issuerSelector
.
setSubject
(
firstCert
.
getIssuerX500Principal
());
issuerSelector
.
setSubject
(
firstCert
.
getIssuerX500Principal
());
...
...
src/share/classes/sun/security/util/SignatureFileVerifier.java
浏览文件 @
dc0440a8
/*
/*
* Copyright (c) 1997, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
1
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -181,7 +181,8 @@ public class SignatureFileVerifier {
...
@@ -181,7 +181,8 @@ public class SignatureFileVerifier {
*
*
*
*
*/
*/
public
void
process
(
Hashtable
<
String
,
CodeSigner
[]>
signers
)
public
void
process
(
Hashtable
<
String
,
CodeSigner
[]>
signers
,
List
manifestDigests
)
throws
IOException
,
SignatureException
,
NoSuchAlgorithmException
,
throws
IOException
,
SignatureException
,
NoSuchAlgorithmException
,
JarException
,
CertificateException
JarException
,
CertificateException
{
{
...
@@ -190,14 +191,15 @@ public class SignatureFileVerifier {
...
@@ -190,14 +191,15 @@ public class SignatureFileVerifier {
Object
obj
=
null
;
Object
obj
=
null
;
try
{
try
{
obj
=
Providers
.
startJarVerification
();
obj
=
Providers
.
startJarVerification
();
processImpl
(
signers
);
processImpl
(
signers
,
manifestDigests
);
}
finally
{
}
finally
{
Providers
.
stopJarVerification
(
obj
);
Providers
.
stopJarVerification
(
obj
);
}
}
}
}
private
void
processImpl
(
Hashtable
<
String
,
CodeSigner
[]>
signers
)
private
void
processImpl
(
Hashtable
<
String
,
CodeSigner
[]>
signers
,
List
manifestDigests
)
throws
IOException
,
SignatureException
,
NoSuchAlgorithmException
,
throws
IOException
,
SignatureException
,
NoSuchAlgorithmException
,
JarException
,
CertificateException
JarException
,
CertificateException
{
{
...
@@ -232,7 +234,7 @@ public class SignatureFileVerifier {
...
@@ -232,7 +234,7 @@ public class SignatureFileVerifier {
sf
.
getEntries
().
entrySet
().
iterator
();
sf
.
getEntries
().
entrySet
().
iterator
();
// see if we can verify the whole manifest first
// see if we can verify the whole manifest first
boolean
manifestSigned
=
verifyManifestHash
(
sf
,
md
,
decoder
);
boolean
manifestSigned
=
verifyManifestHash
(
sf
,
md
,
decoder
,
manifestDigests
);
// verify manifest main attributes
// verify manifest main attributes
if
(!
manifestSigned
&&
!
verifyManifestMainAttrs
(
sf
,
md
,
decoder
))
{
if
(!
manifestSigned
&&
!
verifyManifestMainAttrs
(
sf
,
md
,
decoder
))
{
...
@@ -275,7 +277,8 @@ public class SignatureFileVerifier {
...
@@ -275,7 +277,8 @@ public class SignatureFileVerifier {
*/
*/
private
boolean
verifyManifestHash
(
Manifest
sf
,
private
boolean
verifyManifestHash
(
Manifest
sf
,
ManifestDigester
md
,
ManifestDigester
md
,
BASE64Decoder
decoder
)
BASE64Decoder
decoder
,
List
manifestDigests
)
throws
IOException
throws
IOException
{
{
Attributes
mattr
=
sf
.
getMainAttributes
();
Attributes
mattr
=
sf
.
getMainAttributes
();
...
@@ -290,6 +293,8 @@ public class SignatureFileVerifier {
...
@@ -290,6 +293,8 @@ public class SignatureFileVerifier {
// 16 is length of "-Digest-Manifest"
// 16 is length of "-Digest-Manifest"
String
algorithm
=
key
.
substring
(
0
,
key
.
length
()-
16
);
String
algorithm
=
key
.
substring
(
0
,
key
.
length
()-
16
);
manifestDigests
.
add
(
key
);
manifestDigests
.
add
(
se
.
getValue
());
MessageDigest
digest
=
getDigest
(
algorithm
);
MessageDigest
digest
=
getDigest
(
algorithm
);
if
(
digest
!=
null
)
{
if
(
digest
!=
null
)
{
byte
[]
computedHash
=
md
.
manifestDigest
(
digest
);
byte
[]
computedHash
=
md
.
manifestDigest
(
digest
);
...
...
src/share/classes/sun/tools/jps/Jps.java
浏览文件 @
dc0440a8
/*
/*
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004,
2011,
Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -77,9 +77,52 @@ public class Jps {
...
@@ -77,9 +77,52 @@ public class Jps {
MonitoredVm
vm
=
null
;
MonitoredVm
vm
=
null
;
String
vmidString
=
"//"
+
lvmid
+
"?mode=r"
;
String
vmidString
=
"//"
+
lvmid
+
"?mode=r"
;
String
errorString
=
null
;
try
{
try
{
// Note: The VM associated with the current VM id may
// no longer be running so these queries may fail. We
// already added the VM id to the output stream above.
// If one of the queries fails, then we try to add a
// reasonable message to indicate that the requested
// info is not available.
errorString
=
" -- process information unavailable"
;
VmIdentifier
id
=
new
VmIdentifier
(
vmidString
);
VmIdentifier
id
=
new
VmIdentifier
(
vmidString
);
vm
=
monitoredHost
.
getMonitoredVm
(
id
,
0
);
vm
=
monitoredHost
.
getMonitoredVm
(
id
,
0
);
errorString
=
" -- main class information unavailable"
;
output
.
append
(
" "
+
MonitoredVmUtil
.
mainClass
(
vm
,
arguments
.
showLongPaths
()));
if
(
arguments
.
showMainArgs
())
{
errorString
=
" -- main args information unavailable"
;
String
mainArgs
=
MonitoredVmUtil
.
mainArgs
(
vm
);
if
(
mainArgs
!=
null
&&
mainArgs
.
length
()
>
0
)
{
output
.
append
(
" "
+
mainArgs
);
}
}
if
(
arguments
.
showVmArgs
())
{
errorString
=
" -- jvm args information unavailable"
;
String
jvmArgs
=
MonitoredVmUtil
.
jvmArgs
(
vm
);
if
(
jvmArgs
!=
null
&&
jvmArgs
.
length
()
>
0
)
{
output
.
append
(
" "
+
jvmArgs
);
}
}
if
(
arguments
.
showVmFlags
())
{
errorString
=
" -- jvm flags information unavailable"
;
String
jvmFlags
=
MonitoredVmUtil
.
jvmFlags
(
vm
);
if
(
jvmFlags
!=
null
&&
jvmFlags
.
length
()
>
0
)
{
output
.
append
(
" "
+
jvmFlags
);
}
}
errorString
=
" -- detach failed"
;
monitoredHost
.
detach
(
vm
);
System
.
out
.
println
(
output
);
errorString
=
null
;
}
catch
(
URISyntaxException
e
)
{
}
catch
(
URISyntaxException
e
)
{
// unexpected as vmidString is based on a validated hostid
// unexpected as vmidString is based on a validated hostid
lastError
=
e
;
lastError
=
e
;
...
@@ -87,7 +130,7 @@ public class Jps {
...
@@ -87,7 +130,7 @@ public class Jps {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
lastError
=
e
;
lastError
=
e
;
}
finally
{
}
finally
{
if
(
vm
=
=
null
)
{
if
(
errorString
!
=
null
)
{
/*
/*
* we ignore most exceptions, as there are race
* we ignore most exceptions, as there are race
* conditions where a JVM in 'jvms' may terminate
* conditions where a JVM in 'jvms' may terminate
...
@@ -95,7 +138,7 @@ public class Jps {
...
@@ -95,7 +138,7 @@ public class Jps {
* Other errors, such as access and I/O exceptions
* Other errors, such as access and I/O exceptions
* should stop us from iterating over the complete set.
* should stop us from iterating over the complete set.
*/
*/
output
.
append
(
" -- process information unavailable"
);
output
.
append
(
errorString
);
if
(
arguments
.
isDebug
())
{
if
(
arguments
.
isDebug
())
{
if
((
lastError
!=
null
)
if
((
lastError
!=
null
)
&&
(
lastError
.
getMessage
()
!=
null
))
{
&&
(
lastError
.
getMessage
()
!=
null
))
{
...
@@ -110,33 +153,6 @@ public class Jps {
...
@@ -110,33 +153,6 @@ public class Jps {
continue
;
continue
;
}
}
}
}
output
.
append
(
" "
);
output
.
append
(
MonitoredVmUtil
.
mainClass
(
vm
,
arguments
.
showLongPaths
()));
if
(
arguments
.
showMainArgs
())
{
String
mainArgs
=
MonitoredVmUtil
.
mainArgs
(
vm
);
if
(
mainArgs
!=
null
&&
mainArgs
.
length
()
>
0
)
{
output
.
append
(
" "
).
append
(
mainArgs
);
}
}
if
(
arguments
.
showVmArgs
())
{
String
jvmArgs
=
MonitoredVmUtil
.
jvmArgs
(
vm
);
if
(
jvmArgs
!=
null
&&
jvmArgs
.
length
()
>
0
)
{
output
.
append
(
" "
).
append
(
jvmArgs
);
}
}
if
(
arguments
.
showVmFlags
())
{
String
jvmFlags
=
MonitoredVmUtil
.
jvmFlags
(
vm
);
if
(
jvmFlags
!=
null
&&
jvmFlags
.
length
()
>
0
)
{
output
.
append
(
" "
).
append
(
jvmFlags
);
}
}
System
.
out
.
println
(
output
);
monitoredHost
.
detach
(
vm
);
}
}
}
catch
(
MonitorException
e
)
{
}
catch
(
MonitorException
e
)
{
if
(
e
.
getMessage
()
!=
null
)
{
if
(
e
.
getMessage
()
!=
null
)
{
...
...
src/share/classes/sun/util/resources/TimeZoneNames.java
浏览文件 @
dc0440a8
...
@@ -405,6 +405,7 @@ public final class TimeZoneNames extends TimeZoneNamesBundle {
...
@@ -405,6 +405,7 @@ public final class TimeZoneNames extends TimeZoneNamesBundle {
{
"America/Nipigon"
,
EST
},
{
"America/Nipigon"
,
EST
},
{
"America/Nome"
,
AKST
},
{
"America/Nome"
,
AKST
},
{
"America/Noronha"
,
NORONHA
},
{
"America/Noronha"
,
NORONHA
},
{
"America/North_Dakota/Beulah"
,
CST
},
{
"America/North_Dakota/Center"
,
CST
},
{
"America/North_Dakota/Center"
,
CST
},
{
"America/North_Dakota/New_Salem"
,
CST
},
{
"America/North_Dakota/New_Salem"
,
CST
},
{
"America/Ojinaga"
,
MST
},
{
"America/Ojinaga"
,
MST
},
...
...
src/share/classes/sun/util/resources/TimeZoneNames_de.java
浏览文件 @
dc0440a8
...
@@ -405,6 +405,7 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle {
...
@@ -405,6 +405,7 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle {
{
"America/Nipigon"
,
EST
},
{
"America/Nipigon"
,
EST
},
{
"America/Nome"
,
AKST
},
{
"America/Nome"
,
AKST
},
{
"America/Noronha"
,
NORONHA
},
{
"America/Noronha"
,
NORONHA
},
{
"America/North_Dakota/Beulah"
,
CST
},
{
"America/North_Dakota/Center"
,
CST
},
{
"America/North_Dakota/Center"
,
CST
},
{
"America/North_Dakota/New_Salem"
,
CST
},
{
"America/North_Dakota/New_Salem"
,
CST
},
{
"America/Ojinaga"
,
MST
},
{
"America/Ojinaga"
,
MST
},
...
...
src/share/classes/sun/util/resources/TimeZoneNames_es.java
浏览文件 @
dc0440a8
...
@@ -405,6 +405,7 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle {
...
@@ -405,6 +405,7 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle {
{
"America/Nipigon"
,
EST
},
{
"America/Nipigon"
,
EST
},
{
"America/Nome"
,
AKST
},
{
"America/Nome"
,
AKST
},
{
"America/Noronha"
,
NORONHA
},
{
"America/Noronha"
,
NORONHA
},
{
"America/North_Dakota/Beulah"
,
CST
},
{
"America/North_Dakota/Center"
,
CST
},
{
"America/North_Dakota/Center"
,
CST
},
{
"America/North_Dakota/New_Salem"
,
CST
},
{
"America/North_Dakota/New_Salem"
,
CST
},
{
"America/Ojinaga"
,
MST
},
{
"America/Ojinaga"
,
MST
},
...
...
src/share/classes/sun/util/resources/TimeZoneNames_fr.java
浏览文件 @
dc0440a8
...
@@ -405,6 +405,7 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle {
...
@@ -405,6 +405,7 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle {
{
"America/Nipigon"
,
EST
},
{
"America/Nipigon"
,
EST
},
{
"America/Nome"
,
AKST
},
{
"America/Nome"
,
AKST
},
{
"America/Noronha"
,
NORONHA
},
{
"America/Noronha"
,
NORONHA
},
{
"America/North_Dakota/Beulah"
,
CST
},
{
"America/North_Dakota/Center"
,
CST
},
{
"America/North_Dakota/Center"
,
CST
},
{
"America/North_Dakota/New_Salem"
,
CST
},
{
"America/North_Dakota/New_Salem"
,
CST
},
{
"America/Ojinaga"
,
MST
},
{
"America/Ojinaga"
,
MST
},
...
...
src/share/classes/sun/util/resources/TimeZoneNames_it.java
浏览文件 @
dc0440a8
...
@@ -405,6 +405,7 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle {
...
@@ -405,6 +405,7 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle {
{
"America/Nipigon"
,
EST
},
{
"America/Nipigon"
,
EST
},
{
"America/Nome"
,
AKST
},
{
"America/Nome"
,
AKST
},
{
"America/Noronha"
,
NORONHA
},
{
"America/Noronha"
,
NORONHA
},
{
"America/North_Dakota/Beulah"
,
CST
},
{
"America/North_Dakota/Center"
,
CST
},
{
"America/North_Dakota/Center"
,
CST
},
{
"America/North_Dakota/New_Salem"
,
CST
},
{
"America/North_Dakota/New_Salem"
,
CST
},
{
"America/Ojinaga"
,
MST
},
{
"America/Ojinaga"
,
MST
},
...
...
src/share/classes/sun/util/resources/TimeZoneNames_ja.java
浏览文件 @
dc0440a8
...
@@ -405,6 +405,7 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle {
...
@@ -405,6 +405,7 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle {
{
"America/Nipigon"
,
EST
},
{
"America/Nipigon"
,
EST
},
{
"America/Nome"
,
AKST
},
{
"America/Nome"
,
AKST
},
{
"America/Noronha"
,
NORONHA
},
{
"America/Noronha"
,
NORONHA
},
{
"America/North_Dakota/Beulah"
,
CST
},
{
"America/North_Dakota/Center"
,
CST
},
{
"America/North_Dakota/Center"
,
CST
},
{
"America/North_Dakota/New_Salem"
,
CST
},
{
"America/North_Dakota/New_Salem"
,
CST
},
{
"America/Ojinaga"
,
MST
},
{
"America/Ojinaga"
,
MST
},
...
...
src/share/classes/sun/util/resources/TimeZoneNames_ko.java
浏览文件 @
dc0440a8
...
@@ -405,6 +405,7 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle {
...
@@ -405,6 +405,7 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle {
{
"America/Nipigon"
,
EST
},
{
"America/Nipigon"
,
EST
},
{
"America/Nome"
,
AKST
},
{
"America/Nome"
,
AKST
},
{
"America/Noronha"
,
NORONHA
},
{
"America/Noronha"
,
NORONHA
},
{
"America/North_Dakota/Beulah"
,
CST
},
{
"America/North_Dakota/Center"
,
CST
},
{
"America/North_Dakota/Center"
,
CST
},
{
"America/North_Dakota/New_Salem"
,
CST
},
{
"America/North_Dakota/New_Salem"
,
CST
},
{
"America/Ojinaga"
,
MST
},
{
"America/Ojinaga"
,
MST
},
...
...
src/share/classes/sun/util/resources/TimeZoneNames_pt_BR.java
浏览文件 @
dc0440a8
...
@@ -405,6 +405,7 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle {
...
@@ -405,6 +405,7 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle {
{
"America/Nipigon"
,
EST
},
{
"America/Nipigon"
,
EST
},
{
"America/Nome"
,
AKST
},
{
"America/Nome"
,
AKST
},
{
"America/Noronha"
,
NORONHA
},
{
"America/Noronha"
,
NORONHA
},
{
"America/North_Dakota/Beulah"
,
CST
},
{
"America/North_Dakota/Center"
,
CST
},
{
"America/North_Dakota/Center"
,
CST
},
{
"America/North_Dakota/New_Salem"
,
CST
},
{
"America/North_Dakota/New_Salem"
,
CST
},
{
"America/Panama"
,
EST
},
{
"America/Panama"
,
EST
},
...
...
src/share/classes/sun/util/resources/TimeZoneNames_sv.java
浏览文件 @
dc0440a8
...
@@ -405,6 +405,7 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle {
...
@@ -405,6 +405,7 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle {
{
"America/Nipigon"
,
EST
},
{
"America/Nipigon"
,
EST
},
{
"America/Nome"
,
AKST
},
{
"America/Nome"
,
AKST
},
{
"America/Noronha"
,
NORONHA
},
{
"America/Noronha"
,
NORONHA
},
{
"America/North_Dakota/Beulah"
,
CST
},
{
"America/North_Dakota/Center"
,
CST
},
{
"America/North_Dakota/Center"
,
CST
},
{
"America/North_Dakota/New_Salem"
,
CST
},
{
"America/North_Dakota/New_Salem"
,
CST
},
{
"America/Ojinaga"
,
MST
},
{
"America/Ojinaga"
,
MST
},
...
...
src/share/classes/sun/util/resources/TimeZoneNames_zh_CN.java
浏览文件 @
dc0440a8
...
@@ -405,6 +405,7 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle {
...
@@ -405,6 +405,7 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle {
{
"America/Nipigon"
,
EST
},
{
"America/Nipigon"
,
EST
},
{
"America/Nome"
,
AKST
},
{
"America/Nome"
,
AKST
},
{
"America/Noronha"
,
NORONHA
},
{
"America/Noronha"
,
NORONHA
},
{
"America/North_Dakota/Beulah"
,
CST
},
{
"America/North_Dakota/Center"
,
CST
},
{
"America/North_Dakota/Center"
,
CST
},
{
"America/North_Dakota/New_Salem"
,
CST
},
{
"America/North_Dakota/New_Salem"
,
CST
},
{
"America/Ojinaga"
,
MST
},
{
"America/Ojinaga"
,
MST
},
...
...
src/share/classes/sun/util/resources/TimeZoneNames_zh_TW.java
浏览文件 @
dc0440a8
...
@@ -405,6 +405,7 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle {
...
@@ -405,6 +405,7 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle {
{
"America/Nipigon"
,
EST
},
{
"America/Nipigon"
,
EST
},
{
"America/Nome"
,
AKST
},
{
"America/Nome"
,
AKST
},
{
"America/Noronha"
,
NORONHA
},
{
"America/Noronha"
,
NORONHA
},
{
"America/North_Dakota/Beulah"
,
CST
},
{
"America/North_Dakota/Center"
,
CST
},
{
"America/North_Dakota/Center"
,
CST
},
{
"America/North_Dakota/New_Salem"
,
CST
},
{
"America/North_Dakota/New_Salem"
,
CST
},
{
"America/Ojinaga"
,
MST
},
{
"America/Ojinaga"
,
MST
},
...
...
src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystemProvider.java
浏览文件 @
dc0440a8
...
@@ -42,6 +42,7 @@ import java.net.URISyntaxException;
...
@@ -42,6 +42,7 @@ import java.net.URISyntaxException;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.Set
;
import
java.util.zip.ZipError
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.ExecutorService
;
/*
/*
...
@@ -78,42 +79,63 @@ public class ZipFileSystemProvider extends FileSystemProvider {
...
@@ -78,42 +79,63 @@ public class ZipFileSystemProvider extends FileSystemProvider {
}
}
}
}
@Override
private
boolean
ensureFile
(
Path
path
)
{
public
FileSystem
newFileSystem
(
URI
uri
,
Map
<
String
,
?>
env
)
try
{
throws
IOException
BasicFileAttributes
attrs
=
{
Files
.
readAttributes
(
path
,
BasicFileAttributes
.
class
);
return
newFileSystem
(
uriToPath
(
uri
),
env
,
true
);
if
(!
attrs
.
isRegularFile
())
}
throw
new
UnsupportedOperationException
();
return
true
;
@Override
}
catch
(
IOException
ioe
)
{
public
FileSystem
newFileSystem
(
Path
path
,
Map
<
String
,
?>
env
)
return
false
;
throws
IOException
{
if
(!
path
.
toUri
().
getScheme
().
equalsIgnoreCase
(
"file"
))
{
throw
new
UnsupportedOperationException
();
}
}
return
newFileSystem
(
path
,
env
,
false
);
}
}
private
FileSystem
newFileSystem
(
Path
path
,
Map
<
String
,
?>
env
,
boolean
checkIfFSExists
)
@Override
public
FileSystem
newFileSystem
(
URI
uri
,
Map
<
String
,
?>
env
)
throws
IOException
throws
IOException
{
{
Path
path
=
uriToPath
(
uri
);
synchronized
(
filesystems
)
{
synchronized
(
filesystems
)
{
Path
realPath
=
null
;
Path
realPath
=
null
;
if
(
checkIfFSExists
&&
Files
.
exists
(
path
))
{
if
(
ensureFile
(
path
))
{
realPath
=
path
.
toRealPath
(
true
);
realPath
=
path
.
toRealPath
(
true
);
if
(
filesystems
.
containsKey
(
realPath
))
if
(
filesystems
.
containsKey
(
realPath
))
throw
new
FileSystemAlreadyExistsException
();
throw
new
FileSystemAlreadyExistsException
();
}
}
ZipFileSystem
zipfs
=
new
ZipFileSystem
(
this
,
path
,
env
);
ZipFileSystem
zipfs
=
null
;
if
(
realPath
==
null
)
try
{
realPath
=
path
.
toRealPath
(
true
);
zipfs
=
new
ZipFileSystem
(
this
,
path
,
env
);
if
(!
filesystems
.
containsKey
(
realPath
))
}
catch
(
ZipError
ze
)
{
filesystems
.
put
(
realPath
,
zipfs
);
String
pname
=
path
.
toString
();
if
(
pname
.
endsWith
(
".zip"
)
||
pname
.
endsWith
(
".jar"
))
throw
ze
;
// assume NOT a zip/jar file
throw
new
UnsupportedOperationException
();
}
filesystems
.
put
(
realPath
,
zipfs
);
return
zipfs
;
return
zipfs
;
}
}
}
}
@Override
public
FileSystem
newFileSystem
(
Path
path
,
Map
<
String
,
?>
env
)
throws
IOException
{
if
(
path
.
getFileSystem
()
!=
FileSystems
.
getDefault
())
{
throw
new
UnsupportedOperationException
();
}
ensureFile
(
path
);
try
{
return
new
ZipFileSystem
(
this
,
path
,
env
);
}
catch
(
ZipError
ze
)
{
String
pname
=
path
.
toString
();
if
(
pname
.
endsWith
(
".zip"
)
||
pname
.
endsWith
(
".jar"
))
throw
ze
;
throw
new
UnsupportedOperationException
();
}
}
@Override
@Override
public
Path
getPath
(
URI
uri
)
{
public
Path
getPath
(
URI
uri
)
{
...
...
src/share/native/sun/awt/image/jpeg/imageioJPEG.c
浏览文件 @
dc0440a8
...
@@ -109,8 +109,8 @@ typedef struct streamBufferStruct {
...
@@ -109,8 +109,8 @@ typedef struct streamBufferStruct {
jobject
stream
;
// ImageInputStream or ImageOutputStream
jobject
stream
;
// ImageInputStream or ImageOutputStream
jbyteArray
hstreamBuffer
;
// Handle to a Java buffer for the stream
jbyteArray
hstreamBuffer
;
// Handle to a Java buffer for the stream
JOCTET
*
buf
;
// Pinned buffer pointer */
JOCTET
*
buf
;
// Pinned buffer pointer */
in
t
bufferOffset
;
// holds offset between unpin and the next pin
size_
t
bufferOffset
;
// holds offset between unpin and the next pin
in
t
bufferLength
;
// Allocated, nut just used
size_
t
bufferLength
;
// Allocated, nut just used
int
suspendable
;
// Set to true to suspend input
int
suspendable
;
// Set to true to suspend input
long
remaining_skip
;
// Used only on input
long
remaining_skip
;
// Used only on input
}
streamBuffer
,
*
streamBufferPtr
;
}
streamBuffer
,
*
streamBufferPtr
;
...
@@ -129,7 +129,7 @@ typedef struct streamBufferStruct {
...
@@ -129,7 +129,7 @@ typedef struct streamBufferStruct {
* Used to signal that no data need be restored from an unpin to a pin.
* Used to signal that no data need be restored from an unpin to a pin.
* I.e. the buffer is empty.
* I.e. the buffer is empty.
*/
*/
#define NO_DATA
-1
#define NO_DATA
((size_t)-1)
// Forward reference
// Forward reference
static
void
resetStreamBuffer
(
JNIEnv
*
env
,
streamBufferPtr
sb
);
static
void
resetStreamBuffer
(
JNIEnv
*
env
,
streamBufferPtr
sb
);
...
@@ -389,7 +389,6 @@ typedef struct imageIODataStruct {
...
@@ -389,7 +389,6 @@ typedef struct imageIODataStruct {
static
imageIODataPtr
initImageioData
(
JNIEnv
*
env
,
static
imageIODataPtr
initImageioData
(
JNIEnv
*
env
,
j_common_ptr
cinfo
,
j_common_ptr
cinfo
,
jobject
obj
)
{
jobject
obj
)
{
int
i
,
j
;
imageIODataPtr
data
=
(
imageIODataPtr
)
malloc
(
sizeof
(
imageIOData
));
imageIODataPtr
data
=
(
imageIODataPtr
)
malloc
(
sizeof
(
imageIOData
));
if
(
data
==
NULL
)
{
if
(
data
==
NULL
)
{
...
@@ -982,7 +981,7 @@ imageio_fill_suspended_buffer(j_decompress_ptr cinfo)
...
@@ -982,7 +981,7 @@ imageio_fill_suspended_buffer(j_decompress_ptr cinfo)
streamBufferPtr
sb
=
&
data
->
streamBuf
;
streamBufferPtr
sb
=
&
data
->
streamBuf
;
JNIEnv
*
env
=
(
JNIEnv
*
)
JNU_GetEnv
(
jvm
,
JNI_VERSION_1_2
);
JNIEnv
*
env
=
(
JNIEnv
*
)
JNU_GetEnv
(
jvm
,
JNI_VERSION_1_2
);
jint
ret
;
jint
ret
;
in
t
offset
,
buflen
;
size_
t
offset
,
buflen
;
/*
/*
* The original (jpegdecoder.c) had code here that called
* The original (jpegdecoder.c) had code here that called
...
@@ -1520,7 +1519,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_initJPEGImageReader
...
@@ -1520,7 +1519,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_initJPEGImageReader
imageio_dispose
((
j_common_ptr
)
cinfo
);
imageio_dispose
((
j_common_ptr
)
cinfo
);
return
0
;
return
0
;
}
}
return
(
jlong
)
ret
;
return
ptr_to_jlong
(
ret
)
;
}
}
/*
/*
...
@@ -1535,7 +1534,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_setSource
...
@@ -1535,7 +1534,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_setSource
jlong
ptr
,
jlong
ptr
,
jobject
source
)
{
jobject
source
)
{
imageIODataPtr
data
=
(
imageIODataPtr
)
ptr
;
imageIODataPtr
data
=
(
imageIODataPtr
)
jlong_to_ptr
(
ptr
)
;
j_common_ptr
cinfo
;
j_common_ptr
cinfo
;
if
(
data
==
NULL
)
{
if
(
data
==
NULL
)
{
...
@@ -1574,7 +1573,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_readImageHeader
...
@@ -1574,7 +1573,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_readImageHeader
int
h_samp0
,
h_samp1
,
h_samp2
;
int
h_samp0
,
h_samp1
,
h_samp2
;
int
v_samp0
,
v_samp1
,
v_samp2
;
int
v_samp0
,
v_samp1
,
v_samp2
;
jboolean
retval
=
JNI_FALSE
;
jboolean
retval
=
JNI_FALSE
;
imageIODataPtr
data
=
(
imageIODataPtr
)
ptr
;
imageIODataPtr
data
=
(
imageIODataPtr
)
jlong_to_ptr
(
ptr
)
;
j_decompress_ptr
cinfo
;
j_decompress_ptr
cinfo
;
struct
jpeg_source_mgr
*
src
;
struct
jpeg_source_mgr
*
src
;
sun_jpeg_error_ptr
jerr
;
sun_jpeg_error_ptr
jerr
;
...
@@ -1772,7 +1771,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_setOutColorSpace
...
@@ -1772,7 +1771,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_setOutColorSpace
jlong
ptr
,
jlong
ptr
,
jint
code
)
{
jint
code
)
{
imageIODataPtr
data
=
(
imageIODataPtr
)
ptr
;
imageIODataPtr
data
=
(
imageIODataPtr
)
jlong_to_ptr
(
ptr
)
;
j_decompress_ptr
cinfo
;
j_decompress_ptr
cinfo
;
if
(
data
==
NULL
)
{
if
(
data
==
NULL
)
{
...
@@ -1814,7 +1813,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_readImage
...
@@ -1814,7 +1813,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_readImage
struct
jpeg_source_mgr
*
src
;
struct
jpeg_source_mgr
*
src
;
JSAMPROW
scanLinePtr
=
NULL
;
JSAMPROW
scanLinePtr
=
NULL
;
jint
bands
[
MAX_BANDS
];
jint
bands
[
MAX_BANDS
];
int
i
,
j
;
int
i
;
jint
*
body
;
jint
*
body
;
int
scanlineLimit
;
int
scanlineLimit
;
int
pixelStride
;
int
pixelStride
;
...
@@ -1824,14 +1823,12 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_readImage
...
@@ -1824,14 +1823,12 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_readImage
pixelBufferPtr
pb
;
pixelBufferPtr
pb
;
sun_jpeg_error_ptr
jerr
;
sun_jpeg_error_ptr
jerr
;
boolean
done
;
boolean
done
;
jint
*
bandSize
;
int
maxBandValue
,
halfMaxBandValue
;
boolean
mustScale
=
FALSE
;
boolean
mustScale
=
FALSE
;
boolean
progressive
=
FALSE
;
boolean
progressive
=
FALSE
;
boolean
orderedBands
=
TRUE
;
boolean
orderedBands
=
TRUE
;
imageIODataPtr
data
=
(
imageIODataPtr
)
ptr
;
imageIODataPtr
data
=
(
imageIODataPtr
)
jlong_to_ptr
(
ptr
)
;
j_decompress_ptr
cinfo
;
j_decompress_ptr
cinfo
;
unsigned
in
t
numBytes
;
size_
t
numBytes
;
/* verify the inputs */
/* verify the inputs */
...
@@ -1849,7 +1846,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_readImage
...
@@ -1849,7 +1846,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_readImage
cinfo
=
(
j_decompress_ptr
)
data
->
jpegObj
;
cinfo
=
(
j_decompress_ptr
)
data
->
jpegObj
;
if
((
numBands
<
1
)
||
if
((
numBands
<
1
)
||
(
numBands
>
MAX_BANDS
)
||
(
sourceXStart
<
0
)
||
(
sourceXStart
>=
(
jint
)
cinfo
->
image_width
)
||
(
sourceXStart
<
0
)
||
(
sourceXStart
>=
(
jint
)
cinfo
->
image_width
)
||
(
sourceYStart
<
0
)
||
(
sourceYStart
>=
(
jint
)
cinfo
->
image_height
)
||
(
sourceYStart
<
0
)
||
(
sourceYStart
>=
(
jint
)
cinfo
->
image_height
)
||
(
sourceWidth
<
1
)
||
(
sourceWidth
>
(
jint
)
cinfo
->
image_width
)
||
(
sourceWidth
<
1
)
||
(
sourceWidth
>
(
jint
)
cinfo
->
image_width
)
||
...
@@ -1863,10 +1860,10 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_readImage
...
@@ -1863,10 +1860,10 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_readImage
return
JNI_FALSE
;
return
JNI_FALSE
;
}
}
if
(
stepX
>
cinfo
->
image_width
)
{
if
(
stepX
>
(
jint
)
cinfo
->
image_width
)
{
stepX
=
cinfo
->
image_width
;
stepX
=
cinfo
->
image_width
;
}
}
if
(
stepY
>
cinfo
->
image_height
)
{
if
(
stepY
>
(
jint
)
cinfo
->
image_height
)
{
stepY
=
cinfo
->
image_height
;
stepY
=
cinfo
->
image_height
;
}
}
...
@@ -2119,7 +2116,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_abortRead
...
@@ -2119,7 +2116,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_abortRead
jobject
this
,
jobject
this
,
jlong
ptr
)
{
jlong
ptr
)
{
imageIODataPtr
data
=
(
imageIODataPtr
)
ptr
;
imageIODataPtr
data
=
(
imageIODataPtr
)
jlong_to_ptr
(
ptr
)
;
if
(
data
==
NULL
)
{
if
(
data
==
NULL
)
{
JNU_ThrowByName
(
env
,
JNU_ThrowByName
(
env
,
...
@@ -2137,7 +2134,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_resetLibraryState
...
@@ -2137,7 +2134,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_resetLibraryState
(
JNIEnv
*
env
,
(
JNIEnv
*
env
,
jobject
this
,
jobject
this
,
jlong
ptr
)
{
jlong
ptr
)
{
imageIODataPtr
data
=
(
imageIODataPtr
)
ptr
;
imageIODataPtr
data
=
(
imageIODataPtr
)
jlong_to_ptr
(
ptr
)
;
j_decompress_ptr
cinfo
;
j_decompress_ptr
cinfo
;
if
(
data
==
NULL
)
{
if
(
data
==
NULL
)
{
...
@@ -2159,7 +2156,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_resetReader
...
@@ -2159,7 +2156,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_resetReader
jobject
this
,
jobject
this
,
jlong
ptr
)
{
jlong
ptr
)
{
imageIODataPtr
data
=
(
imageIODataPtr
)
ptr
;
imageIODataPtr
data
=
(
imageIODataPtr
)
jlong_to_ptr
(
ptr
)
;
j_decompress_ptr
cinfo
;
j_decompress_ptr
cinfo
;
sun_jpeg_error_ptr
jerr
;
sun_jpeg_error_ptr
jerr
;
...
@@ -2232,7 +2229,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_disposeReader
...
@@ -2232,7 +2229,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_disposeReader
jclass
reader
,
jclass
reader
,
jlong
ptr
)
{
jlong
ptr
)
{
imageIODataPtr
data
=
(
imageIODataPtr
)
ptr
;
imageIODataPtr
data
=
(
imageIODataPtr
)
jlong_to_ptr
(
ptr
)
;
j_common_ptr
info
=
destroyImageioData
(
env
,
data
);
j_common_ptr
info
=
destroyImageioData
(
env
,
data
);
imageio_dispose
(
info
);
imageio_dispose
(
info
);
...
@@ -2317,8 +2314,8 @@ imageio_term_destination (j_compress_ptr cinfo)
...
@@ -2317,8 +2314,8 @@ imageio_term_destination (j_compress_ptr cinfo)
JNIEnv
*
env
=
(
JNIEnv
*
)
JNU_GetEnv
(
jvm
,
JNI_VERSION_1_2
);
JNIEnv
*
env
=
(
JNIEnv
*
)
JNU_GetEnv
(
jvm
,
JNI_VERSION_1_2
);
/* find out how much needs to be written */
/* find out how much needs to be written */
jint
datacount
=
sb
->
bufferLength
-
dest
->
free_in_buffer
;
/* this conversion from size_t to jint is safe, because the lenght of the buffer is limited by jint */
jint
datacount
=
(
jint
)(
sb
->
bufferLength
-
dest
->
free_in_buffer
);
if
(
datacount
!=
0
)
{
if
(
datacount
!=
0
)
{
RELEASE_ARRAYS
(
env
,
data
,
(
const
JOCTET
*
)(
dest
->
next_output_byte
));
RELEASE_ARRAYS
(
env
,
data
,
(
const
JOCTET
*
)(
dest
->
next_output_byte
));
...
@@ -2485,7 +2482,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_initJPEGImageWriter
...
@@ -2485,7 +2482,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_initJPEGImageWriter
imageio_dispose
((
j_common_ptr
)
cinfo
);
imageio_dispose
((
j_common_ptr
)
cinfo
);
return
0
;
return
0
;
}
}
return
(
jlong
)
ret
;
return
ptr_to_jlong
(
ret
)
;
}
}
JNIEXPORT
void
JNICALL
JNIEXPORT
void
JNICALL
...
@@ -2495,7 +2492,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_setDest
...
@@ -2495,7 +2492,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_setDest
jlong
ptr
,
jlong
ptr
,
jobject
destination
)
{
jobject
destination
)
{
imageIODataPtr
data
=
(
imageIODataPtr
)
ptr
;
imageIODataPtr
data
=
(
imageIODataPtr
)
jlong_to_ptr
(
ptr
)
;
j_compress_ptr
cinfo
;
j_compress_ptr
cinfo
;
if
(
data
==
NULL
)
{
if
(
data
==
NULL
)
{
...
@@ -2526,7 +2523,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_writeTables
...
@@ -2526,7 +2523,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_writeTables
struct
jpeg_destination_mgr
*
dest
;
struct
jpeg_destination_mgr
*
dest
;
sun_jpeg_error_ptr
jerr
;
sun_jpeg_error_ptr
jerr
;
imageIODataPtr
data
=
(
imageIODataPtr
)
ptr
;
imageIODataPtr
data
=
(
imageIODataPtr
)
jlong_to_ptr
(
ptr
)
;
j_compress_ptr
cinfo
;
j_compress_ptr
cinfo
;
if
(
data
==
NULL
)
{
if
(
data
==
NULL
)
{
...
@@ -2625,10 +2622,11 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_writeImage
...
@@ -2625,10 +2622,11 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_writeImage
jint
*
scanData
;
jint
*
scanData
;
jint
*
bandSize
;
jint
*
bandSize
;
int
maxBandValue
,
halfMaxBandValue
;
int
maxBandValue
,
halfMaxBandValue
;
imageIODataPtr
data
=
(
imageIODataPtr
)
ptr
;
imageIODataPtr
data
=
(
imageIODataPtr
)
jlong_to_ptr
(
ptr
)
;
j_compress_ptr
cinfo
;
j_compress_ptr
cinfo
;
UINT8
**
scale
=
NULL
;
UINT8
**
scale
=
NULL
;
/* verify the inputs */
/* verify the inputs */
if
(
data
==
NULL
)
{
if
(
data
==
NULL
)
{
...
@@ -2740,6 +2738,16 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_writeImage
...
@@ -2740,6 +2738,16 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_writeImage
buffer
);
buffer
);
JNU_ThrowByName
(
env
,
"javax/imageio/IIOException"
,
buffer
);
JNU_ThrowByName
(
env
,
"javax/imageio/IIOException"
,
buffer
);
}
}
if
(
scale
!=
NULL
)
{
for
(
i
=
0
;
i
<
numBands
;
i
++
)
{
if
(
scale
[
i
]
!=
NULL
)
{
free
(
scale
[
i
]);
}
}
free
(
scale
);
}
free
(
scanLinePtr
);
free
(
scanLinePtr
);
return
data
->
abortFlag
;
return
data
->
abortFlag
;
}
}
...
@@ -2953,7 +2961,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_abortWrite
...
@@ -2953,7 +2961,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_abortWrite
jobject
this
,
jobject
this
,
jlong
ptr
)
{
jlong
ptr
)
{
imageIODataPtr
data
=
(
imageIODataPtr
)
ptr
;
imageIODataPtr
data
=
(
imageIODataPtr
)
jlong_to_ptr
(
ptr
)
;
if
(
data
==
NULL
)
{
if
(
data
==
NULL
)
{
JNU_ThrowByName
(
env
,
JNU_ThrowByName
(
env
,
...
@@ -2970,7 +2978,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_resetWriter
...
@@ -2970,7 +2978,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_resetWriter
(
JNIEnv
*
env
,
(
JNIEnv
*
env
,
jobject
this
,
jobject
this
,
jlong
ptr
)
{
jlong
ptr
)
{
imageIODataPtr
data
=
(
imageIODataPtr
)
ptr
;
imageIODataPtr
data
=
(
imageIODataPtr
)
jlong_to_ptr
(
ptr
)
;
j_compress_ptr
cinfo
;
j_compress_ptr
cinfo
;
if
(
data
==
NULL
)
{
if
(
data
==
NULL
)
{
...
@@ -3002,7 +3010,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_disposeWriter
...
@@ -3002,7 +3010,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_disposeWriter
jclass
writer
,
jclass
writer
,
jlong
ptr
)
{
jlong
ptr
)
{
imageIODataPtr
data
=
(
imageIODataPtr
)
ptr
;
imageIODataPtr
data
=
(
imageIODataPtr
)
jlong_to_ptr
(
ptr
)
;
j_common_ptr
info
=
destroyImageioData
(
env
,
data
);
j_common_ptr
info
=
destroyImageioData
(
env
,
data
);
imageio_dispose
(
info
);
imageio_dispose
(
info
);
...
...
src/share/native/sun/awt/image/jpeg/jdmarker.c
浏览文件 @
dc0440a8
...
@@ -1325,14 +1325,14 @@ jpeg_save_markers (j_decompress_ptr cinfo, int marker_code,
...
@@ -1325,14 +1325,14 @@ jpeg_save_markers (j_decompress_ptr cinfo, int marker_code,
unsigned
int
length_limit
)
unsigned
int
length_limit
)
{
{
my_marker_ptr
marker
=
(
my_marker_ptr
)
cinfo
->
marker
;
my_marker_ptr
marker
=
(
my_marker_ptr
)
cinfo
->
marker
;
long
maxlength
;
size_t
maxlength
;
jpeg_marker_parser_method
processor
;
jpeg_marker_parser_method
processor
;
/* Length limit mustn't be larger than what we can allocate
/* Length limit mustn't be larger than what we can allocate
* (should only be a concern in a 16-bit environment).
* (should only be a concern in a 16-bit environment).
*/
*/
maxlength
=
cinfo
->
mem
->
max_alloc_chunk
-
SIZEOF
(
struct
jpeg_marker_struct
);
maxlength
=
cinfo
->
mem
->
max_alloc_chunk
-
SIZEOF
(
struct
jpeg_marker_struct
);
if
(
((
long
)
length_limit
)
>
maxlength
)
if
(
length_limit
>
maxlength
)
length_limit
=
(
unsigned
int
)
maxlength
;
length_limit
=
(
unsigned
int
)
maxlength
;
/* Choose processor routine to use.
/* Choose processor routine to use.
...
...
src/share/native/sun/awt/image/jpeg/jmemmgr.c
浏览文件 @
dc0440a8
...
@@ -133,7 +133,7 @@ typedef struct {
...
@@ -133,7 +133,7 @@ typedef struct {
jvirt_barray_ptr
virt_barray_list
;
jvirt_barray_ptr
virt_barray_list
;
/* This counts total space obtained from jpeg_get_small/large */
/* This counts total space obtained from jpeg_get_small/large */
long
total_space_allocated
;
size_t
total_space_allocated
;
/* alloc_sarray and alloc_barray set this value for use by virtual
/* alloc_sarray and alloc_barray set this value for use by virtual
* array routines.
* array routines.
...
@@ -588,8 +588,8 @@ realize_virt_arrays (j_common_ptr cinfo)
...
@@ -588,8 +588,8 @@ realize_virt_arrays (j_common_ptr cinfo)
/* Allocate the in-memory buffers for any unrealized virtual arrays */
/* Allocate the in-memory buffers for any unrealized virtual arrays */
{
{
my_mem_ptr
mem
=
(
my_mem_ptr
)
cinfo
->
mem
;
my_mem_ptr
mem
=
(
my_mem_ptr
)
cinfo
->
mem
;
long
space_per_minheight
,
maximum_space
,
avail_mem
;
size_t
space_per_minheight
,
maximum_space
,
avail_mem
;
long
minheights
,
max_minheights
;
size_t
minheights
,
max_minheights
;
jvirt_sarray_ptr
sptr
;
jvirt_sarray_ptr
sptr
;
jvirt_barray_ptr
bptr
;
jvirt_barray_ptr
bptr
;
...
@@ -1032,7 +1032,7 @@ GLOBAL(void)
...
@@ -1032,7 +1032,7 @@ GLOBAL(void)
jinit_memory_mgr
(
j_common_ptr
cinfo
)
jinit_memory_mgr
(
j_common_ptr
cinfo
)
{
{
my_mem_ptr
mem
;
my_mem_ptr
mem
;
long
max_to_use
;
size_t
max_to_use
;
int
pool
;
int
pool
;
size_t
test_mac
;
size_t
test_mac
;
...
@@ -1109,8 +1109,10 @@ jinit_memory_mgr (j_common_ptr cinfo)
...
@@ -1109,8 +1109,10 @@ jinit_memory_mgr (j_common_ptr cinfo)
if
((
memenv
=
getenv
(
"JPEGMEM"
))
!=
NULL
)
{
if
((
memenv
=
getenv
(
"JPEGMEM"
))
!=
NULL
)
{
char
ch
=
'x'
;
char
ch
=
'x'
;
unsigned
int
mem_max
=
0u
;
if
(
sscanf
(
memenv
,
"%ld%c"
,
&
max_to_use
,
&
ch
)
>
0
)
{
if
(
sscanf
(
memenv
,
"%u%c"
,
&
mem_max
,
&
ch
)
>
0
)
{
max_to_use
=
(
size_t
)
mem_max
;
if
(
ch
==
'm'
||
ch
==
'M'
)
if
(
ch
==
'm'
||
ch
==
'M'
)
max_to_use
*=
1000L
;
max_to_use
*=
1000L
;
mem
->
pub
.
max_memory_to_use
=
max_to_use
*
1000L
;
mem
->
pub
.
max_memory_to_use
=
max_to_use
*
1000L
;
...
...
src/share/native/sun/awt/image/jpeg/jmemnobs.c
浏览文件 @
dc0440a8
...
@@ -73,9 +73,9 @@ jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)
...
@@ -73,9 +73,9 @@ jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)
* Here we always say, "we got all you want bud!"
* Here we always say, "we got all you want bud!"
*/
*/
GLOBAL
(
long
)
GLOBAL
(
size_t
)
jpeg_mem_available
(
j_common_ptr
cinfo
,
long
min_bytes_needed
,
jpeg_mem_available
(
j_common_ptr
cinfo
,
size_t
min_bytes_needed
,
long
max_bytes_needed
,
long
already_allocated
)
size_t
max_bytes_needed
,
size_t
already_allocated
)
{
{
return
max_bytes_needed
;
return
max_bytes_needed
;
}
}
...
@@ -100,7 +100,7 @@ jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info,
...
@@ -100,7 +100,7 @@ jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info,
* cleanup required. Here, there isn't any.
* cleanup required. Here, there isn't any.
*/
*/
GLOBAL
(
long
)
GLOBAL
(
size_t
)
jpeg_mem_init
(
j_common_ptr
cinfo
)
jpeg_mem_init
(
j_common_ptr
cinfo
)
{
{
return
0
;
/* just set max_memory_to_use to 0 */
return
0
;
/* just set max_memory_to_use to 0 */
...
...
src/share/native/sun/awt/image/jpeg/jmemsys.h
浏览文件 @
dc0440a8
...
@@ -104,10 +104,10 @@ EXTERN(void) jpeg_free_large JPP((j_common_ptr cinfo, void FAR * object,
...
@@ -104,10 +104,10 @@ EXTERN(void) jpeg_free_large JPP((j_common_ptr cinfo, void FAR * object,
* Conversely, zero may be returned to always use the minimum amount of memory.
* Conversely, zero may be returned to always use the minimum amount of memory.
*/
*/
EXTERN
(
long
)
jpeg_mem_available
JPP
((
j_common_ptr
cinfo
,
EXTERN
(
size_t
)
jpeg_mem_available
JPP
((
j_common_ptr
cinfo
,
long
min_bytes_needed
,
size_t
min_bytes_needed
,
long
max_bytes_needed
,
size_t
max_bytes_needed
,
long
already_allocated
));
size_t
already_allocated
));
/*
/*
...
@@ -198,5 +198,5 @@ EXTERN(void) jpeg_open_backing_store JPP((j_common_ptr cinfo,
...
@@ -198,5 +198,5 @@ EXTERN(void) jpeg_open_backing_store JPP((j_common_ptr cinfo,
* all opened backing-store objects have been closed.
* all opened backing-store objects have been closed.
*/
*/
EXTERN
(
long
)
jpeg_mem_init
JPP
((
j_common_ptr
cinfo
));
EXTERN
(
size_t
)
jpeg_mem_init
JPP
((
j_common_ptr
cinfo
));
EXTERN
(
void
)
jpeg_mem_term
JPP
((
j_common_ptr
cinfo
));
EXTERN
(
void
)
jpeg_mem_term
JPP
((
j_common_ptr
cinfo
));
src/share/native/sun/awt/image/jpeg/jpegdecoder.c
浏览文件 @
dc0440a8
...
@@ -328,7 +328,7 @@ sun_jpeg_fill_suspended_buffer(j_decompress_ptr cinfo)
...
@@ -328,7 +328,7 @@ sun_jpeg_fill_suspended_buffer(j_decompress_ptr cinfo)
if
((
*
env
)
->
ExceptionOccurred
(
env
)
||
!
GET_ARRAYS
(
env
,
src
))
{
if
((
*
env
)
->
ExceptionOccurred
(
env
)
||
!
GET_ARRAYS
(
env
,
src
))
{
cinfo
->
err
->
error_exit
((
struct
jpeg_common_struct
*
)
cinfo
);
cinfo
->
err
->
error_exit
((
struct
jpeg_common_struct
*
)
cinfo
);
}
}
if
(
ret
<=
src
->
remaining_skip
)
{
if
(
ret
<
0
||
(
unsigned
int
)
ret
<
=
src
->
remaining_skip
)
{
return
;
return
;
}
}
if
(
src
->
remaining_skip
)
{
if
(
src
->
remaining_skip
)
{
...
@@ -397,7 +397,7 @@ sun_jpeg_skip_input_data(j_decompress_ptr cinfo, long num_bytes)
...
@@ -397,7 +397,7 @@ sun_jpeg_skip_input_data(j_decompress_ptr cinfo, long num_bytes)
}
}
num_bytes
+=
src
->
remaining_skip
;
num_bytes
+=
src
->
remaining_skip
;
src
->
remaining_skip
=
0
;
src
->
remaining_skip
=
0
;
ret
=
src
->
pub
.
bytes_in_buffer
;
ret
=
(
int
)
src
->
pub
.
bytes_in_buffer
;
/* this conversion is safe, because capacity of the buffer is limited by jnit */
if
(
ret
>=
num_bytes
)
{
if
(
ret
>=
num_bytes
)
{
src
->
pub
.
next_input_byte
+=
num_bytes
;
src
->
pub
.
next_input_byte
+=
num_bytes
;
src
->
pub
.
bytes_in_buffer
-=
num_bytes
;
src
->
pub
.
bytes_in_buffer
-=
num_bytes
;
...
...
src/share/native/sun/awt/image/jpeg/jpeglib.h
浏览文件 @
dc0440a8
...
@@ -800,10 +800,10 @@ struct jpeg_memory_mgr {
...
@@ -800,10 +800,10 @@ struct jpeg_memory_mgr {
* used for virtual-array buffers.) May be changed by outer application
* used for virtual-array buffers.) May be changed by outer application
* after creating the JPEG object.
* after creating the JPEG object.
*/
*/
long
max_memory_to_use
;
size_t
max_memory_to_use
;
/* Maximum allocation request accepted by alloc_large. */
/* Maximum allocation request accepted by alloc_large. */
long
max_alloc_chunk
;
size_t
max_alloc_chunk
;
};
};
...
...
src/solaris/classes/sun/awt/X11/XDesktopPeer.java
浏览文件 @
dc0440a8
...
@@ -44,11 +44,27 @@ import java.awt.peer.DesktopPeer;
...
@@ -44,11 +44,27 @@ import java.awt.peer.DesktopPeer;
public
class
XDesktopPeer
implements
DesktopPeer
{
public
class
XDesktopPeer
implements
DesktopPeer
{
private
static
boolean
nativeLibraryLoaded
=
false
;
private
static
boolean
nativeLibraryLoaded
=
false
;
static
{
private
static
boolean
initExecuted
=
false
;
nativeLibraryLoaded
=
init
();
private
static
void
initWithLock
(){
XToolkit
.
awtLock
();
try
{
if
(!
initExecuted
)
{
nativeLibraryLoaded
=
init
();
}
}
finally
{
initExecuted
=
true
;
XToolkit
.
awtUnlock
();
}
}
//package-private
XDesktopPeer
(){
initWithLock
();
}
}
static
boolean
isDesktopSupported
()
{
static
boolean
isDesktopSupported
()
{
initWithLock
();
return
nativeLibraryLoaded
;
return
nativeLibraryLoaded
;
}
}
...
@@ -83,12 +99,17 @@ public class XDesktopPeer implements DesktopPeer {
...
@@ -83,12 +99,17 @@ public class XDesktopPeer implements DesktopPeer {
}
}
private
void
launch
(
URI
uri
)
throws
IOException
{
private
void
launch
(
URI
uri
)
throws
IOException
{
if
(!
nativeLibraryLoaded
)
{
throw
new
IOException
(
"Failed to load native libraries."
);
}
byte
[]
uriByteArray
=
(
uri
.
toString
()
+
'\0'
).
getBytes
();
byte
[]
uriByteArray
=
(
uri
.
toString
()
+
'\0'
).
getBytes
();
boolean
result
=
gnome_url_show
(
uriByteArray
);
boolean
result
=
false
;
XToolkit
.
awtLock
();
try
{
if
(!
nativeLibraryLoaded
)
{
throw
new
IOException
(
"Failed to load native libraries."
);
}
result
=
gnome_url_show
(
uriByteArray
);
}
finally
{
XToolkit
.
awtUnlock
();
}
if
(!
result
)
{
if
(!
result
)
{
throw
new
IOException
(
"Failed to show URI:"
+
uri
);
throw
new
IOException
(
"Failed to show URI:"
+
uri
);
}
}
...
...
src/solaris/classes/sun/java2d/xr/XRSurfaceData.java
浏览文件 @
dc0440a8
...
@@ -479,8 +479,7 @@ public abstract class XRSurfaceData extends XSurfaceData {
...
@@ -479,8 +479,7 @@ public abstract class XRSurfaceData extends XSurfaceData {
if
(
xrpipe
==
null
)
{
if
(
xrpipe
==
null
)
{
try
{
try
{
SunToolkit
.
awtLock
();
SunToolkit
.
awtLock
();
xgc
=
renderQueue
.
createGC
(
xid
);
// TODO: GC leak? where to
xgc
=
XCreateGC
(
getNativeOps
());
// clean up?
xrpipe
=
new
XRRenderer
(
maskBuffer
.
getMaskBuffer
());
xrpipe
=
new
XRRenderer
(
maskBuffer
.
getMaskBuffer
());
xrtxpipe
=
new
PixelToShapeConverter
(
xrpipe
);
xrtxpipe
=
new
PixelToShapeConverter
(
xrpipe
);
...
...
src/solaris/classes/sun/nio/fs/UnixChannelFactory.java
浏览文件 @
dc0440a8
...
@@ -136,7 +136,7 @@ class UnixChannelFactory {
...
@@ -136,7 +136,7 @@ class UnixChannelFactory {
throw
new
IllegalArgumentException
(
"APPEND + TRUNCATE_EXISTING not allowed"
);
throw
new
IllegalArgumentException
(
"APPEND + TRUNCATE_EXISTING not allowed"
);
FileDescriptor
fdObj
=
open
(
dfd
,
path
,
pathForPermissionCheck
,
flags
,
mode
);
FileDescriptor
fdObj
=
open
(
dfd
,
path
,
pathForPermissionCheck
,
flags
,
mode
);
return
FileChannelImpl
.
open
(
fdObj
,
flags
.
read
,
flags
.
write
,
null
);
return
FileChannelImpl
.
open
(
fdObj
,
flags
.
read
,
flags
.
write
,
flags
.
append
,
null
);
}
}
/**
/**
...
...
src/solaris/native/sun/java2d/x11/X11SurfaceData.c
浏览文件 @
dc0440a8
...
@@ -595,15 +595,16 @@ XImage* X11SD_CreateSharedImage(X11SDOps *xsdo,
...
@@ -595,15 +595,16 @@ XImage* X11SD_CreateSharedImage(X11SDOps *xsdo,
}
}
XImage
*
X11SD_GetSharedImage
(
X11SDOps
*
xsdo
,
jint
width
,
jint
height
,
XImage
*
X11SD_GetSharedImage
(
X11SDOps
*
xsdo
,
jint
width
,
jint
height
,
jboolean
readBits
)
j
int
maxWidth
,
jint
maxHeight
,
j
boolean
readBits
)
{
{
XImage
*
retImage
=
NULL
;
XImage
*
retImage
=
NULL
;
if
(
cachedXImage
!=
NULL
&&
if
(
cachedXImage
!=
NULL
&&
X11SD_CachedXImageFits
(
width
,
height
,
xsdo
->
depth
,
readBits
))
{
X11SD_CachedXImageFits
(
width
,
height
,
maxWidth
,
maxHeight
,
/* sync so previous data gets flushed */
xsdo
->
depth
,
readBits
))
{
XSync
(
awt_display
,
False
);
/* sync so previous data gets flushed */
retImage
=
cachedXImage
;
XSync
(
awt_display
,
False
);
cachedXImage
=
(
XImage
*
)
NULL
;
retImage
=
cachedXImage
;
cachedXImage
=
(
XImage
*
)
NULL
;
}
else
if
(
width
*
height
*
xsdo
->
depth
>
0x10000
)
{
}
else
if
(
width
*
height
*
xsdo
->
depth
>
0x10000
)
{
retImage
=
X11SD_CreateSharedImage
(
xsdo
,
width
,
height
);
retImage
=
X11SD_CreateSharedImage
(
xsdo
,
width
,
height
);
}
}
...
@@ -728,8 +729,8 @@ void X11SD_UnPuntPixmap(X11SDOps *xsdo)
...
@@ -728,8 +729,8 @@ void X11SD_UnPuntPixmap(X11SDOps *xsdo)
* it must be close enough to avoid excessive reading from the screen;
* it must be close enough to avoid excessive reading from the screen;
* otherwise it should just be at least the size requested.
* otherwise it should just be at least the size requested.
*/
*/
jboolean
X11SD_CachedXImageFits
(
jint
width
,
jint
height
,
jint
dep
th
,
jboolean
X11SD_CachedXImageFits
(
jint
width
,
jint
height
,
jint
maxWid
th
,
jboolean
readBits
)
j
int
maxHeight
,
jint
depth
,
j
boolean
readBits
)
{
{
/* we assume here that the cached image exists */
/* we assume here that the cached image exists */
jint
imgWidth
=
cachedXImage
->
width
;
jint
imgWidth
=
cachedXImage
->
width
;
...
@@ -747,10 +748,14 @@ jboolean X11SD_CachedXImageFits(jint width, jint height, jint depth,
...
@@ -747,10 +748,14 @@ jboolean X11SD_CachedXImageFits(jint width, jint height, jint depth,
return
JNI_TRUE
;
return
JNI_TRUE
;
}
}
if
((
imgWidth
<
width
+
64
)
&&
(
imgHeight
<
height
+
64
))
{
if
((
imgWidth
<
width
+
64
)
&&
(
imgHeight
<
height
+
64
)
&&
imgWidth
<=
maxWidth
&&
imgHeight
<=
maxHeight
)
{
/* Cached image's width/height shouldn't be more than 64 pixels
/* Cached image's width/height shouldn't be more than 64 pixels
* larger than requested, because the region in XShmGetImage
* larger than requested, because the region in XShmGetImage
* can't be specified and we don't want to read too much.
* can't be specified and we don't want to read too much.
* Furthermore it has to be smaller than maxWidth/Height
* so drawables are not read out of bounds.
*/
*/
return
JNI_TRUE
;
return
JNI_TRUE
;
}
}
...
@@ -1295,7 +1300,7 @@ static XImage * X11SD_GetImage(JNIEnv *env, X11SDOps *xsdo,
...
@@ -1295,7 +1300,7 @@ static XImage * X11SD_GetImage(JNIEnv *env, X11SDOps *xsdo,
SurfaceDataBounds
*
bounds
,
SurfaceDataBounds
*
bounds
,
jint
lockFlags
)
jint
lockFlags
)
{
{
int
x
,
y
,
w
,
h
;
int
x
,
y
,
w
,
h
,
maxWidth
,
maxHeight
;
int
scan
;
int
scan
;
XImage
*
img
=
NULL
;
XImage
*
img
=
NULL
;
Drawable
drawable
;
Drawable
drawable
;
...
@@ -1311,10 +1316,31 @@ static XImage * X11SD_GetImage(JNIEnv *env, X11SDOps *xsdo,
...
@@ -1311,10 +1316,31 @@ static XImage * X11SD_GetImage(JNIEnv *env, X11SDOps *xsdo,
#ifdef MITSHM
#ifdef MITSHM
if
(
useMitShmExt
==
CAN_USE_MITSHM
)
{
if
(
useMitShmExt
==
CAN_USE_MITSHM
)
{
if
(
xsdo
->
isPixmap
&&
readBits
)
{
if
(
xsdo
->
isPixmap
)
{
X11SD_PuntPixmap
(
xsdo
,
w
,
h
);
if
(
readBits
)
{
X11SD_PuntPixmap
(
xsdo
,
w
,
h
);
}
maxWidth
=
xsdo
->
pmWidth
;
maxHeight
=
xsdo
->
pmHeight
;
}
else
{
XWindowAttributes
winAttr
;
if
(
XGetWindowAttributes
(
awt_display
,
(
Window
)
xsdo
->
drawable
,
&
winAttr
)
!=
0
)
{
maxWidth
=
winAttr
.
width
;
maxHeight
=
winAttr
.
height
;
}
else
{
/* XGWA failed which isn't a good thing. Defaulting to using
* x,y means that after the subtraction of these we will use
* w=0, h=0 which is a reasonable default on such a failure.
*/
maxWidth
=
x
;
maxHeight
=
y
;
}
}
}
img
=
X11SD_GetSharedImage
(
xsdo
,
w
,
h
,
readBits
);
maxWidth
-=
x
;
maxHeight
-=
y
;
img
=
X11SD_GetSharedImage
(
xsdo
,
w
,
h
,
maxWidth
,
maxHeight
,
readBits
);
}
}
#endif
/* MITSHM */
#endif
/* MITSHM */
drawable
=
xsdo
->
drawable
;
drawable
=
xsdo
->
drawable
;
...
...
src/solaris/native/sun/java2d/x11/X11SurfaceData.h
浏览文件 @
dc0440a8
...
@@ -125,15 +125,21 @@ struct _X11SDOps {
...
@@ -125,15 +125,21 @@ struct _X11SDOps {
#define X11SD_LOCK_BY_SHMEM 4
/* surface locked by ShMemExt */
#define X11SD_LOCK_BY_SHMEM 4
/* surface locked by ShMemExt */
#ifdef MITSHM
#ifdef MITSHM
XImage
*
X11SD_GetSharedImage
(
X11SDOps
*
xsdo
,
jint
width
,
jint
height
,
jboolean
readBits
);
XImage
*
X11SD_GetSharedImage
(
X11SDOps
*
xsdo
,
jint
width
,
jint
height
,
jint
maxWidth
,
jint
maxHeight
,
jboolean
readBits
);
XImage
*
X11SD_CreateSharedImage
(
X11SDOps
*
xsdo
,
jint
width
,
jint
height
);
XImage
*
X11SD_CreateSharedImage
(
X11SDOps
*
xsdo
,
jint
width
,
jint
height
);
Drawable
X11SD_CreateSharedPixmap
(
X11SDOps
*
xsdo
);
Drawable
X11SD_CreateSharedPixmap
(
X11SDOps
*
xsdo
);
void
X11SD_DropSharedSegment
(
XShmSegmentInfo
*
shminfo
);
void
X11SD_DropSharedSegment
(
XShmSegmentInfo
*
shminfo
);
void
X11SD_PuntPixmap
(
X11SDOps
*
xsdo
,
jint
width
,
jint
height
);
void
X11SD_PuntPixmap
(
X11SDOps
*
xsdo
,
jint
width
,
jint
height
);
void
X11SD_UnPuntPixmap
(
X11SDOps
*
xsdo
);
void
X11SD_UnPuntPixmap
(
X11SDOps
*
xsdo
);
jboolean
X11SD_CachedXImageFits
(
jint
width
,
jint
height
,
jint
depth
,
jboolean
readBits
);
jboolean
X11SD_CachedXImageFits
(
jint
width
,
jint
height
,
jint
maxWidth
,
jint
maxHeight
,
jint
depth
,
jboolean
readBits
);
XImage
*
X11SD_GetCachedXImage
(
jint
width
,
jint
height
,
jboolean
readBits
);
XImage
*
X11SD_GetCachedXImage
(
jint
width
,
jint
height
,
jboolean
readBits
);
#endif
/* MITSHM */
#endif
/* MITSHM */
jint
X11SD_InitWindow
(
JNIEnv
*
env
,
X11SDOps
*
xsdo
);
void
X11SD_DisposeOrCacheXImage
(
XImage
*
image
);
void
X11SD_DisposeOrCacheXImage
(
XImage
*
image
);
void
X11SD_DisposeXImage
(
XImage
*
image
);
void
X11SD_DisposeXImage
(
XImage
*
image
);
void
X11SD_DirectRenderNotify
(
JNIEnv
*
env
,
X11SDOps
*
xsdo
);
void
X11SD_DirectRenderNotify
(
JNIEnv
*
env
,
X11SDOps
*
xsdo
);
...
...
src/solaris/native/sun/xawt/awt_Desktop.c
浏览文件 @
dc0440a8
...
@@ -48,9 +48,15 @@ int init(){
...
@@ -48,9 +48,15 @@ int init(){
}
}
dlerror
();
/* Clear errors */
dlerror
();
/* Clear errors */
gnome_vfs_init
=
(
GNOME_VFS_INIT_TYPE
*
)
dlsym
(
vfs_handle
,
"gnome_vfs_init"
);
gnome_vfs_init
=
(
GNOME_VFS_INIT_TYPE
*
)
dlsym
(
vfs_handle
,
"gnome_vfs_init"
);
if
(
gnome_vfs_init
==
NULL
){
#ifdef INTERNAL_BUILD
fprintf
(
stderr
,
"dlsym( gnome_vfs_init) returned NULL
\n
"
);
#endif
return
0
;
}
if
((
errmsg
=
dlerror
())
!=
NULL
)
{
if
((
errmsg
=
dlerror
())
!=
NULL
)
{
#ifdef INTERNAL_BUILD
#ifdef INTERNAL_BUILD
fprintf
(
stderr
,
"can not find symb
le gnome_vfs_init
\n
"
);
fprintf
(
stderr
,
"can not find symb
ol gnome_vfs_init %s
\n
"
,
errmsg
);
#endif
#endif
return
0
;
return
0
;
}
}
...
...
src/windows/classes/sun/awt/windows/WPathGraphics.java
浏览文件 @
dc0440a8
...
@@ -51,9 +51,12 @@ import java.awt.image.ColorModel;
...
@@ -51,9 +51,12 @@ import java.awt.image.ColorModel;
import
java.awt.image.DataBuffer
;
import
java.awt.image.DataBuffer
;
import
java.awt.image.IndexColorModel
;
import
java.awt.image.IndexColorModel
;
import
java.awt.image.WritableRaster
;
import
java.awt.image.WritableRaster
;
import
java.awt.image.ComponentSampleModel
;
import
java.awt.image.MultiPixelPackedSampleModel
;
import
java.awt.image.SampleModel
;
import
sun.awt.image.ByteComponentRaster
;
import
sun.awt.image.ByteComponentRaster
;
import
sun.awt.image.BytePackedRaster
;
import
sun.awt.image.BytePackedRaster
;
import
java.awt.print.PageFormat
;
import
java.awt.print.PageFormat
;
import
java.awt.print.Printable
;
import
java.awt.print.Printable
;
import
java.awt.print.PrinterException
;
import
java.awt.print.PrinterException
;
...
@@ -1272,6 +1275,25 @@ class WPathGraphics extends PathGraphics {
...
@@ -1272,6 +1275,25 @@ class WPathGraphics extends PathGraphics {
return
false
;
return
false
;
}
}
int
bitsPerPixel
=
24
;
SampleModel
sm
=
deepImage
.
getSampleModel
();
if
(
sm
instanceof
ComponentSampleModel
)
{
ComponentSampleModel
csm
=
(
ComponentSampleModel
)
sm
;
bitsPerPixel
=
csm
.
getPixelStride
()
*
8
;
}
else
if
(
sm
instanceof
MultiPixelPackedSampleModel
)
{
MultiPixelPackedSampleModel
mppsm
=
(
MultiPixelPackedSampleModel
)
sm
;
bitsPerPixel
=
mppsm
.
getPixelBitStride
();
}
else
{
if
(
icm
!=
null
)
{
int
diw
=
deepImage
.
getWidth
();
int
dih
=
deepImage
.
getHeight
();
if
(
diw
>
0
&&
dih
>
0
)
{
bitsPerPixel
=
data
.
length
*
8
/
diw
/
dih
;
}
}
}
/* Because the caller's image has been rotated
/* Because the caller's image has been rotated
* and sheared into our BufferedImage and because
* and sheared into our BufferedImage and because
* we will be handing that BufferedImage directly to
* we will be handing that BufferedImage directly to
...
@@ -1289,7 +1311,7 @@ class WPathGraphics extends PathGraphics {
...
@@ -1289,7 +1311,7 @@ class WPathGraphics extends PathGraphics {
(
float
)
Math
.
rint
(
scaledBounds
.
height
+
0.5
),
(
float
)
Math
.
rint
(
scaledBounds
.
height
+
0.5
),
0
f
,
0
f
,
0
f
,
0
f
,
deepImage
.
getWidth
(),
deepImage
.
getHeight
(),
deepImage
.
getWidth
(),
deepImage
.
getHeight
(),
icm
);
bitsPerPixel
,
icm
);
setClip
(
holdClip
);
setClip
(
holdClip
);
}
}
...
...
src/windows/classes/sun/awt/windows/WPrinterJob.java
浏览文件 @
dc0440a8
...
@@ -1212,13 +1212,14 @@ public class WPrinterJob extends RasterPrinterJob implements DisposerTarget {
...
@@ -1212,13 +1212,14 @@ public class WPrinterJob extends RasterPrinterJob implements DisposerTarget {
float
destWidth
,
float
destHeight
,
float
destWidth
,
float
destHeight
,
float
srcX
,
float
srcY
,
float
srcX
,
float
srcY
,
float
srcWidth
,
float
srcHeight
,
float
srcWidth
,
float
srcHeight
,
int
sampleBitsPerPixel
,
IndexColorModel
icm
)
{
IndexColorModel
icm
)
{
int
bitCount
=
24
;
int
bitCount
=
24
;
byte
[]
bmiColors
=
null
;
byte
[]
bmiColors
=
null
;
if
(
icm
!=
null
)
{
if
(
icm
!=
null
)
{
bitCount
=
icm
.
getPixelSize
()
;
bitCount
=
sampleBitsPerPixel
;
bmiColors
=
new
byte
[(
1
<<
bitCount
)*
4
];
bmiColors
=
new
byte
[(
1
<<
icm
.
getPixelSize
()
)*
4
];
for
(
int
i
=
0
;
i
<
icm
.
getMapSize
();
i
++)
{
for
(
int
i
=
0
;
i
<
icm
.
getMapSize
();
i
++)
{
bmiColors
[
i
*
4
+
0
]=(
byte
)(
icm
.
getBlue
(
i
)&
0xff
);
bmiColors
[
i
*
4
+
0
]=(
byte
)(
icm
.
getBlue
(
i
)&
0xff
);
bmiColors
[
i
*
4
+
1
]=(
byte
)(
icm
.
getGreen
(
i
)&
0xff
);
bmiColors
[
i
*
4
+
1
]=(
byte
)(
icm
.
getGreen
(
i
)&
0xff
);
...
...
src/windows/classes/sun/print/Win32PrintService.java
浏览文件 @
dc0440a8
...
@@ -31,6 +31,7 @@ import java.net.URISyntaxException;
...
@@ -31,6 +31,7 @@ import java.net.URISyntaxException;
import
java.net.URL
;
import
java.net.URL
;
import
java.util.Vector
;
import
java.util.Vector
;
import
java.util.HashMap
;
import
javax.print.DocFlavor
;
import
javax.print.DocFlavor
;
import
javax.print.DocPrintJob
;
import
javax.print.DocPrintJob
;
...
@@ -205,6 +206,7 @@ public class Win32PrintService implements PrintService, AttributeUpdater,
...
@@ -205,6 +206,7 @@ public class Win32PrintService implements PrintService, AttributeUpdater,
private
MediaPrintableArea
[]
mediaPrintables
;
private
MediaPrintableArea
[]
mediaPrintables
;
private
MediaTray
[]
mediaTrays
;
private
MediaTray
[]
mediaTrays
;
private
PrinterResolution
[]
printRes
;
private
PrinterResolution
[]
printRes
;
private
HashMap
mpaMap
;
private
int
nCopies
;
private
int
nCopies
;
private
int
prnCaps
;
private
int
prnCaps
;
private
int
[]
defaultSettings
;
private
int
[]
defaultSettings
;
...
@@ -212,6 +214,7 @@ public class Win32PrintService implements PrintService, AttributeUpdater,
...
@@ -212,6 +214,7 @@ public class Win32PrintService implements PrintService, AttributeUpdater,
private
boolean
gotTrays
;
private
boolean
gotTrays
;
private
boolean
gotCopies
;
private
boolean
gotCopies
;
private
boolean
mediaInitialized
;
private
boolean
mediaInitialized
;
private
boolean
mpaListInitialized
;
private
ArrayList
idList
;
private
ArrayList
idList
;
private
MediaSize
[]
mediaSizes
;
private
MediaSize
[]
mediaSizes
;
...
@@ -270,6 +273,20 @@ public class Win32PrintService implements PrintService, AttributeUpdater,
...
@@ -270,6 +273,20 @@ public class Win32PrintService implements PrintService, AttributeUpdater,
return
DMPAPER_B6_JIS
;
return
DMPAPER_B6_JIS
;
}
}
}
}
// If not found in predefined Windows ID, then we search through
// the returned IDs of the driver because they can define their own
// unique IDs.
initMedia
();
if
((
idList
!=
null
)
&&
(
mediaSizes
!=
null
)
&&
(
idList
.
size
()
==
mediaSizes
.
length
))
{
for
(
int
i
=
0
;
i
<
idList
.
size
();
i
++)
{
if
(
mediaSizes
[
i
].
getMediaSizeName
()
==
msn
)
{
return
((
Integer
)
idList
.
get
(
i
)).
intValue
();
}
}
}
return
0
;
return
0
;
}
}
...
@@ -380,43 +397,115 @@ public class Win32PrintService implements PrintService, AttributeUpdater,
...
@@ -380,43 +397,115 @@ public class Win32PrintService implements PrintService, AttributeUpdater,
// Add mediaName to the msnList
// Add mediaName to the msnList
if
(
mediaName
!=
null
)
{
if
(
mediaName
!=
null
)
{
added
=
addToUniqueList
(
msnList
,
mediaName
);
added
=
addToUniqueList
(
msnList
,
mediaName
);
// get MediaPrintableArea only for supported MediaSizeName ?
if
(
added
&&
!
queryFailure
)
{
prnArea
=
getMediaPrintableArea
(
printer
,
((
Integer
)
idList
.
get
(
i
)).
intValue
());
if
(
prnArea
!=
null
)
{
try
{
MediaPrintableArea
mpa
=
new
MediaPrintableArea
(
prnArea
[
0
],
prnArea
[
1
],
prnArea
[
2
],
prnArea
[
3
],
MediaPrintableArea
.
INCH
);
printableList
.
add
(
mpa
);
}
catch
(
IllegalArgumentException
iae
)
{
}
}
else
{
// Calling getMediaPrintableArea causes
// much overhead so if first attempt failed, we should
// just bail out.
if
(
i
==
0
)
{
queryFailure
=
true
;
}
}
}
}
}
}
}
// init mediaSizeNames
// init mediaSizeNames
mediaSizeNames
=
new
MediaSizeName
[
msnList
.
size
()];
mediaSizeNames
=
new
MediaSizeName
[
msnList
.
size
()];
msnList
.
toArray
(
mediaSizeNames
);
msnList
.
toArray
(
mediaSizeNames
);
}
/*
* Gets a list of MediaPrintableAreas using a call to native function.
* msn is MediaSizeName used to get a specific printable area. If null,
* it will get all the supported MediPrintableAreas.
*/
private
synchronized
MediaPrintableArea
[]
getMediaPrintables
(
MediaSizeName
msn
)
{
if
(
msn
==
null
)
{
if
(
mpaListInitialized
==
true
)
{
return
mediaPrintables
;
}
}
else
{
// get from cached mapping of MPAs
if
(
mpaMap
!=
null
&&
(
mpaMap
.
get
(
msn
)
!=
null
))
{
MediaPrintableArea
[]
mpaArr
=
new
MediaPrintableArea
[
1
];
mpaArr
[
0
]
=
(
MediaPrintableArea
)
mpaMap
.
get
(
msn
);
return
mpaArr
;
}
}
initMedia
();
if
((
mediaSizeNames
==
null
)
&&
(
mediaSizeNames
.
length
==
0
))
{
return
null
;
}
MediaSizeName
[]
loopNames
;
if
(
msn
!=
null
)
{
loopNames
=
new
MediaSizeName
[
1
];
loopNames
[
0
]
=
msn
;
}
else
{
loopNames
=
mediaSizeNames
;
}
if
(
mpaMap
==
null
)
{
mpaMap
=
new
HashMap
();
}
for
(
int
i
=
0
;
i
<
loopNames
.
length
;
i
++)
{
MediaSizeName
mediaName
=
loopNames
[
i
];
if
(
mpaMap
.
get
(
mediaName
)
!=
null
)
{
continue
;
}
// init mediaPrintables
if
(
mediaName
!=
null
)
{
mediaPrintables
=
new
MediaPrintableArea
[
printableList
.
size
()];
int
defPaper
=
findPaperID
(
mediaName
);
printableList
.
toArray
(
mediaPrintables
);
float
[]
prnArea
=
(
defPaper
!=
0
)
?
getMediaPrintableArea
(
printer
,
defPaper
)
:
null
;
MediaPrintableArea
printableArea
=
null
;
if
(
prnArea
!=
null
)
{
try
{
printableArea
=
new
MediaPrintableArea
(
prnArea
[
0
],
prnArea
[
1
],
prnArea
[
2
],
prnArea
[
3
],
MediaPrintableArea
.
INCH
);
mpaMap
.
put
(
mediaName
,
printableArea
);
}
catch
(
IllegalArgumentException
e
)
{
}
}
else
{
// if getting MPA failed, we use MediaSize
MediaSize
ms
=
MediaSize
.
getMediaSizeForName
((
MediaSizeName
)
mediaName
);
if
(
ms
!=
null
)
{
try
{
printableArea
=
new
MediaPrintableArea
(
0
,
0
,
ms
.
getX
(
MediaSize
.
INCH
),
ms
.
getY
(
MediaSize
.
INCH
),
MediaPrintableArea
.
INCH
);
mpaMap
.
put
(
mediaName
,
printableArea
);
}
catch
(
IllegalArgumentException
e
)
{
}
}
}
}
//mediaName != null
}
if
(
mpaMap
.
size
()
==
0
)
{
return
null
;
}
if
(
msn
!=
null
)
{
if
(
mpaMap
.
get
(
msn
)
==
null
)
{
return
null
;
}
MediaPrintableArea
[]
mpaArr
=
new
MediaPrintableArea
[
1
];
// by this time, we've already gotten the desired MPA
mpaArr
[
0
]
=
(
MediaPrintableArea
)
mpaMap
.
get
(
msn
);
return
mpaArr
;
}
else
{
mediaPrintables
=
(
MediaPrintableArea
[])
mpaMap
.
values
().
toArray
(
new
MediaPrintableArea
[
0
]);
mpaListInitialized
=
true
;
return
mediaPrintables
;
}
}
}
private
synchronized
MediaTray
[]
getMediaTrays
()
{
private
synchronized
MediaTray
[]
getMediaTrays
()
{
if
(
gotTrays
==
true
&&
mediaTrays
!=
null
)
{
if
(
gotTrays
==
true
&&
mediaTrays
!=
null
)
{
return
mediaTrays
;
return
mediaTrays
;
...
@@ -626,7 +715,7 @@ public class Win32PrintService implements PrintService, AttributeUpdater,
...
@@ -626,7 +715,7 @@ public class Win32PrintService implements PrintService, AttributeUpdater,
private
boolean
isSupportedMediaPrintableArea
(
MediaPrintableArea
mpa
)
{
private
boolean
isSupportedMediaPrintableArea
(
MediaPrintableArea
mpa
)
{
initMedia
(
);
getMediaPrintables
(
null
);
if
(
mediaPrintables
!=
null
)
{
if
(
mediaPrintables
!=
null
)
{
for
(
int
i
=
0
;
i
<
mediaPrintables
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
mediaPrintables
.
length
;
i
++)
{
...
@@ -1250,57 +1339,32 @@ public class Win32PrintService implements PrintService, AttributeUpdater,
...
@@ -1250,57 +1339,32 @@ public class Win32PrintService implements PrintService, AttributeUpdater,
}
}
if
(
trays
!=
null
)
{
if
(
trays
!=
null
)
{
System
.
arraycopy
(
trays
,
0
,
arr
,
System
.
arraycopy
(
trays
,
0
,
arr
,
mediaSizeName
s
.
length
,
trays
.
length
);
len
-
tray
s
.
length
,
trays
.
length
);
}
}
return
arr
;
return
arr
;
}
else
if
(
category
==
MediaPrintableArea
.
class
)
{
}
else
if
(
category
==
MediaPrintableArea
.
class
)
{
initMedia
();
if
(
mediaPrintables
==
null
)
{
return
null
;
}
// if getting printable area for a specific media size
// if getting printable area for a specific media size
Media
mediaName
;
Media
mediaName
=
null
;
if
((
attributes
!=
null
)
&&
if
((
attributes
!=
null
)
&&
((
mediaName
=
((
mediaName
=
(
Media
)
attributes
.
get
(
Media
.
class
))
!=
null
))
{
(
Media
)
attributes
.
get
(
Media
.
class
))
!=
null
))
{
if
(
mediaName
instanceof
MediaSizeName
)
{
if
(!(
mediaName
instanceof
MediaSizeName
))
{
MediaPrintableArea
[]
arr
=
new
MediaPrintableArea
[
1
];
// if an instance of MediaTray, fall thru returning
// all MediaPrintableAreas
if
(
mediaSizeNames
.
length
==
mediaPrintables
.
length
)
{
mediaName
=
null
;
for
(
int
j
=
0
;
j
<
mediaSizeNames
.
length
;
j
++)
{
if
(
mediaName
.
equals
(
mediaSizeNames
[
j
]))
{
arr
[
0
]
=
mediaPrintables
[
j
];
return
arr
;
}
}
}
MediaSize
ms
=
MediaSize
.
getMediaSizeForName
((
MediaSizeName
)
mediaName
);
if
(
ms
!=
null
)
{
arr
[
0
]
=
new
MediaPrintableArea
(
0
,
0
,
ms
.
getX
(
MediaSize
.
INCH
),
ms
.
getY
(
MediaSize
.
INCH
),
MediaPrintableArea
.
INCH
);
return
arr
;
}
else
{
return
null
;
}
}
}
// else an instance of MediaTray, fall thru returning
// all MediaPrintableAreas
}
}
MediaPrintableArea
[]
arr
=
MediaPrintableArea
[]
mpas
=
new
MediaPrintableArea
[
mediaPrintables
.
length
];
getMediaPrintables
((
MediaSizeName
)
mediaName
);
System
.
arraycopy
(
mediaPrintables
,
0
,
arr
,
0
,
mediaPrintables
.
length
);
if
(
mpas
!=
null
)
{
return
arr
;
MediaPrintableArea
[]
arr
=
new
MediaPrintableArea
[
mpas
.
length
];
System
.
arraycopy
(
mpas
,
0
,
arr
,
0
,
mpas
.
length
);
return
arr
;
}
else
{
return
null
;
}
}
else
if
(
category
==
SunAlternateMedia
.
class
)
{
}
else
if
(
category
==
SunAlternateMedia
.
class
)
{
return
new
SunAlternateMedia
(
return
new
SunAlternateMedia
(
(
Media
)
getDefaultAttributeValue
(
Media
.
class
));
(
Media
)
getDefaultAttributeValue
(
Media
.
class
));
...
...
src/windows/native/sun/java2d/windows/GDIBlitLoops.cpp
浏览文件 @
dc0440a8
...
@@ -107,8 +107,16 @@ Java_sun_java2d_windows_GDIBlitLoops_nativeBlit
...
@@ -107,8 +107,16 @@ Java_sun_java2d_windows_GDIBlitLoops_nativeBlit
// could retain their own DIB info and we would not need to
// could retain their own DIB info and we would not need to
// recreate it every time.
// recreate it every time.
// GetRasInfo implicitly calls GetPrimitiveArrayCritical
// and since GetDC uses JNI it needs to be called first.
HDC
hDC
=
dstOps
->
GetDC
(
env
,
dstOps
,
0
,
NULL
,
clip
,
NULL
,
0
);
if
(
hDC
==
NULL
)
{
SurfaceData_InvokeUnlock
(
env
,
srcOps
,
&
srcInfo
);
return
;
}
srcOps
->
GetRasInfo
(
env
,
srcOps
,
&
srcInfo
);
srcOps
->
GetRasInfo
(
env
,
srcOps
,
&
srcInfo
);
if
(
srcInfo
.
rasBase
==
NULL
)
{
if
(
srcInfo
.
rasBase
==
NULL
)
{
dstOps
->
ReleaseDC
(
env
,
dstOps
,
hDC
);
SurfaceData_InvokeUnlock
(
env
,
srcOps
,
&
srcInfo
);
SurfaceData_InvokeUnlock
(
env
,
srcOps
,
&
srcInfo
);
return
;
return
;
}
}
...
@@ -174,13 +182,6 @@ Java_sun_java2d_windows_GDIBlitLoops_nativeBlit
...
@@ -174,13 +182,6 @@ Java_sun_java2d_windows_GDIBlitLoops_nativeBlit
bmi
.
colors
.
dwMasks
[
2
]
=
bmask
;
bmi
.
colors
.
dwMasks
[
2
]
=
bmask
;
}
}
HDC
hDC
=
dstOps
->
GetDC
(
env
,
dstOps
,
0
,
NULL
,
clip
,
NULL
,
0
);
if
(
hDC
==
NULL
)
{
SurfaceData_InvokeRelease
(
env
,
srcOps
,
&
srcInfo
);
SurfaceData_InvokeUnlock
(
env
,
srcOps
,
&
srcInfo
);
return
;
}
if
(
fastBlt
)
{
if
(
fastBlt
)
{
// Window could go away at any time, leaving bits on the screen
// Window could go away at any time, leaving bits on the screen
// from this GDI call, so make sure window still exists
// from this GDI call, so make sure window still exists
...
...
test/ProblemList.txt
浏览文件 @
dc0440a8
...
@@ -41,14 +41,14 @@
...
@@ -41,14 +41,14 @@
#
#
# Shell tests are othervm by default.
# Shell tests are othervm by default.
#
#
# List items are testnames followed by labels, all MUST BE commented
# List items are testnames followed by labels, all MUST BE commented
# as to why they are here and use a label:
# as to why they are here and use a label:
# generic-all Problems on all platforms
# generic-all Problems on all platforms
# generic-ARCH Where ARCH is one of: sparc, sparcv9, x64, i586, etc.
# generic-ARCH Where ARCH is one of: sparc, sparcv9, x64, i586, etc.
# OSNAME-all Where OSNAME is one of: solaris, linux, windows
# OSNAME-all Where OSNAME is one of: solaris, linux, windows
# OSNAME-ARCH Specific on to one OSNAME and ARCH, e.g. solaris-x64
# OSNAME-ARCH Specific on to one OSNAME and ARCH, e.g. solaris-x64
# OSNAME-REV Specific on to one OSNAME and REV, e.g. solaris-5.8
# OSNAME-REV Specific on to one OSNAME and REV, e.g. solaris-5.8
#
#
# More than one label is allowed but must be on the same line.
# More than one label is allowed but must be on the same line.
#
#
#############################################################################
#############################################################################
...
@@ -234,7 +234,7 @@ javax/management/remote/mandatory/threads/ExecutorTest.java generic-all
...
@@ -234,7 +234,7 @@ javax/management/remote/mandatory/threads/ExecutorTest.java generic-all
# Linux 32bit Fedora 9, IllegalStateException
# Linux 32bit Fedora 9, IllegalStateException
javax/management/monitor/RuntimeExceptionTest.java generic-all
javax/management/monitor/RuntimeExceptionTest.java generic-all
# Problems with rmi connection, othervm
# Problems with rmi connection, othervm
javax/management/remote/mandatory/subjectDelegation/SubjectDelegation2Test.java generic-all
javax/management/remote/mandatory/subjectDelegation/SubjectDelegation2Test.java generic-all
# Fails with port already in use
# Fails with port already in use
...
@@ -411,7 +411,7 @@ com/sun/nio/sctp/SctpChannel/SocketOptionTests.java
...
@@ -411,7 +411,7 @@ com/sun/nio/sctp/SctpChannel/SocketOptionTests.java
com/sun/nio/sctp/SctpChannel/Send.java generic-all
com/sun/nio/sctp/SctpChannel/Send.java generic-all
com/sun/nio/sctp/SctpChannel/Shutdown.java generic-all
com/sun/nio/sctp/SctpChannel/Shutdown.java generic-all
# Fails on OpenSolaris, IllegalStateException: Cannot add or remove addresses
# Fails on OpenSolaris, IllegalStateException: Cannot add or remove addresses
# from a channel that is bound to the wildcard address
# from a channel that is bound to the wildcard address
com/sun/nio/sctp/SctpChannel/Bind.java generic-all
com/sun/nio/sctp/SctpChannel/Bind.java generic-all
...
@@ -456,10 +456,10 @@ java/rmi/transport/pinLastArguments/PinLastArguments.java generic-all
...
@@ -456,10 +456,10 @@ java/rmi/transport/pinLastArguments/PinLastArguments.java generic-all
java/rmi/server/RemoteServer/AddrInUse.java generic-all
java/rmi/server/RemoteServer/AddrInUse.java generic-all
# Connection error on Windows i586 -server
# Connection error on Windows i586 -server
# Also connection errors in othervm on Solaris 10 sparc, same port???
# Also connection errors in othervm on Solaris 10 sparc, same port???
sun/rmi/transport/tcp/DeadCachedConnection.java generic-all
sun/rmi/transport/tcp/DeadCachedConnection.java generic-all
# Connection errors in othervm on Solaris 10 sparc, same port???
# Connection errors in othervm on Solaris 10 sparc, same port???
java/rmi/activation/Activatable/checkActivateRef/CheckActivateRef.java generic-all
java/rmi/activation/Activatable/checkActivateRef/CheckActivateRef.java generic-all
java/rmi/activation/Activatable/checkAnnotations/CheckAnnotations.java generic-all
java/rmi/activation/Activatable/checkAnnotations/CheckAnnotations.java generic-all
java/rmi/activation/Activatable/checkImplClassLoader/CheckImplClassLoader.java generic-all
java/rmi/activation/Activatable/checkImplClassLoader/CheckImplClassLoader.java generic-all
...
@@ -532,7 +532,7 @@ sun/security/pkcs11/ec/TestKeyFactory.java solaris-i586
...
@@ -532,7 +532,7 @@ sun/security/pkcs11/ec/TestKeyFactory.java solaris-i586
java/security/Security/SynchronizedAccess.java generic-all
java/security/Security/SynchronizedAccess.java generic-all
# Failing on Solaris X64 (-d64 -server) with:
# Failing on Solaris X64 (-d64 -server) with:
# GSSException: Failure unspecified at GSS-API level
# GSSException: Failure unspecified at GSS-API level
# (Mechanism level: Specified version of key is not available (44))
# (Mechanism level: Specified version of key is not available (44))
sun/security/krb5/auto/BasicKrb5Test.java generic-all
sun/security/krb5/auto/BasicKrb5Test.java generic-all
...
@@ -546,14 +546,14 @@ sun/security/tools/keytool/standard.sh generic-all
...
@@ -546,14 +546,14 @@ sun/security/tools/keytool/standard.sh generic-all
sun/security/krb5/auto/HttpNegotiateServer.java generic-all
sun/security/krb5/auto/HttpNegotiateServer.java generic-all
# Fails on almost all platforms
# Fails on almost all platforms
# java.lang.UnsupportedClassVersionError: SerialTest :
# java.lang.UnsupportedClassVersionError: SerialTest :
# Unsupported major.minor version 51.0
# Unsupported major.minor version 51.0
# at java.lang.ClassLoader.defineClass1(Native Method)
# at java.lang.ClassLoader.defineClass1(Native Method)
sun/security/util/Oid/S11N.sh generic-all
sun/security/util/Oid/S11N.sh generic-all
# Fails on Fedora 9 32bit
# Fails on Fedora 9 32bit
# GSSException: Failure unspecified at GSS-API level (Mechanism level:
# GSSException: Failure unspecified at GSS-API level (Mechanism level:
# Invalid argument (400) - Cannot find key of appropriate type to decrypt
# Invalid argument (400) - Cannot find key of appropriate type to decrypt
# AP REP - DES CBC mode with MD5)
# AP REP - DES CBC mode with MD5)
# at sun.security.jgss.krb5.Krb5Context.acceptSecContext(Krb5Context.java:778)
# at sun.security.jgss.krb5.Krb5Context.acceptSecContext(Krb5Context.java:778)
sun/security/krb5/auto/NonMutualSpnego.java generic-all
sun/security/krb5/auto/NonMutualSpnego.java generic-all
...
@@ -673,7 +673,7 @@ sun/security/rsa/TestSignatures.java solaris-all
...
@@ -673,7 +673,7 @@ sun/security/rsa/TestSignatures.java solaris-all
# Timeout on solaris-sparc and i586 and x64, -client and -server
# Timeout on solaris-sparc and i586 and x64, -client and -server
sun/security/ssl/com/sun/net/ssl/internal/ssl/InputRecord/InterruptedIO.java solaris-all
sun/security/ssl/com/sun/net/ssl/internal/ssl/InputRecord/InterruptedIO.java solaris-all
# Do not seem to run on windows machines? dll missing?
# Do not seem to run on windows machines? dll missing?
sun/security/tools/jarsigner/emptymanifest.sh windows-all
sun/security/tools/jarsigner/emptymanifest.sh windows-all
# Files does not exist or no encoding? solaris-sparcv9
# Files does not exist or no encoding? solaris-sparcv9
...
@@ -734,8 +734,5 @@ java/util/concurrent/FutureTask/BlockingTaskExecutor.java generic-all
...
@@ -734,8 +734,5 @@ java/util/concurrent/FutureTask/BlockingTaskExecutor.java generic-all
# Problems on windows, jmap.exe hangs? (these run jmap), fails on Solaris 10 x86
# Problems on windows, jmap.exe hangs? (these run jmap), fails on Solaris 10 x86
java/util/concurrent/locks/Lock/TimedAcquireLeak.java generic-all
java/util/concurrent/locks/Lock/TimedAcquireLeak.java generic-all
# Fails on solaris-sparc -server (Set not equal to copy. 1)
java/util/EnumSet/EnumSetBash.java solaris-sparc
############################################################################
############################################################################
test/demo/zipfs/ZipFSTester.java
浏览文件 @
dc0440a8
...
@@ -105,6 +105,18 @@ public class ZipFSTester {
...
@@ -105,6 +105,18 @@ public class ZipFSTester {
os
.
write
(
bits
);
os
.
write
(
bits
);
os
.
close
();
os
.
close
();
try
{
provider
.
newFileSystem
(
new
File
(
System
.
getProperty
(
"test.src"
,
"."
)).
toPath
(),
new
HashMap
<
String
,
Object
>());
throw
new
RuntimeException
(
"newFileSystem() opens a directory as zipfs"
);
}
catch
(
UnsupportedOperationException
uoe
)
{}
try
{
provider
.
newFileSystem
(
src
,
new
HashMap
<
String
,
Object
>());
throw
new
RuntimeException
(
"newFileSystem() opens a non-zip file as zipfs"
);
}
catch
(
UnsupportedOperationException
uoe
)
{}
// copyin
// copyin
Path
dst
=
getPathWithParents
(
fs
,
tmpName
);
Path
dst
=
getPathWithParents
(
fs
,
tmpName
);
Files
.
copy
(
src
,
dst
);
Files
.
copy
(
src
,
dst
);
...
...
test/demo/zipfs/basic.sh
浏览文件 @
dc0440a8
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
# questions.
# questions.
#
#
# @test
# @test
# @bug 6990846 7009092 7009085 7015391 7014948 7005986 7017840
# @bug 6990846 7009092 7009085 7015391 7014948 7005986 7017840
7007596
# @summary Test ZipFileSystem demo
# @summary Test ZipFileSystem demo
# @build Basic PathOps ZipFSTester
# @build Basic PathOps ZipFSTester
# @run shell basic.sh
# @run shell basic.sh
...
...
test/java/awt/PrintJob/Text/StringWidth.java
浏览文件 @
dc0440a8
...
@@ -63,7 +63,8 @@ public class StringWidth extends Frame {
...
@@ -63,7 +63,8 @@ public class StringWidth extends Frame {
}
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
new
StringWidth
();
StringWidth
sw
=
new
StringWidth
();
sw
.
dispose
();
}
}
}
}
test/java/awt/font/StyledMetrics/BoldSpace.java
0 → 100644
浏览文件 @
dc0440a8
/*
* Copyright (c) 2008, 2011, 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 6686365 7017637
@summary Confirm that styling does not affect metrics of zero advance glyphs
*/
import
java.awt.*
;
import
java.awt.image.*
;
public
class
BoldSpace
{
public
static
void
main
(
String
[]
s
)
{
BufferedImage
bi
=
new
BufferedImage
(
100
,
100
,
BufferedImage
.
TYPE_INT_ARGB
);
String
errMsg
=
"ZWJ Space char should have 0 advance\n"
;
Graphics
g
=
bi
.
getGraphics
();
// It turns out that some fonts inexplicably treat this as
// a standard character. In this 14 pt font, if we see an advance
// that's clearly bigger than we'd have introduced in bolding we'll
// not error out this test, presuming that its a consequence of
// the actual font data. A Linux font 'TLwg Type Bold' is the case
// in point.
int
errorMargin
=
4
;
g
.
setFont
(
new
Font
(
"monospaced"
,
Font
.
BOLD
,
14
));
//g.setFont(new Font("Lucida Sans Regular", Font.BOLD, 14));
FontMetrics
fm
=
g
.
getFontMetrics
();
System
.
out
.
println
(
"Bold: "
+
fm
.
charWidth
(
'\u200b'
));
int
cwid
=
fm
.
charWidth
(
'\u200b'
);
if
(
cwid
>
0
&&
cwid
<
errorMargin
)
{
throw
new
RuntimeException
(
errMsg
);
}
((
Graphics2D
)
g
).
setRenderingHint
(
RenderingHints
.
KEY_TEXT_ANTIALIASING
,
RenderingHints
.
VALUE_TEXT_ANTIALIAS_LCD_HRGB
);
fm
=
g
.
getFontMetrics
();
System
.
out
.
println
(
"Bold + LCD: "
+
fm
.
charWidth
(
'\u200b'
));
cwid
=
fm
.
charWidth
(
'\u200b'
);
if
(
cwid
>
0
&&
cwid
<
errorMargin
)
{
throw
new
RuntimeException
(
errMsg
);
}
((
Graphics2D
)
g
).
setRenderingHint
(
RenderingHints
.
KEY_FRACTIONALMETRICS
,
RenderingHints
.
VALUE_FRACTIONALMETRICS_ON
);
((
Graphics2D
)
g
).
setRenderingHint
(
RenderingHints
.
KEY_TEXT_ANTIALIASING
,
RenderingHints
.
VALUE_TEXT_ANTIALIAS_ON
);
fm
=
g
.
getFontMetrics
();
System
.
out
.
println
(
"Bold FM OFF + AA: "
+
fm
.
charWidth
(
'\u200b'
));
cwid
=
fm
.
charWidth
(
'\u200b'
);
if
(
cwid
>
0
&&
cwid
<
errorMargin
)
{
throw
new
RuntimeException
(
errMsg
);
}
((
Graphics2D
)
g
).
setRenderingHint
(
RenderingHints
.
KEY_FRACTIONALMETRICS
,
RenderingHints
.
VALUE_FRACTIONALMETRICS_OFF
);
((
Graphics2D
)
g
).
setRenderingHint
(
RenderingHints
.
KEY_TEXT_ANTIALIASING
,
RenderingHints
.
VALUE_TEXT_ANTIALIAS_ON
);
fm
=
g
.
getFontMetrics
();
System
.
out
.
println
(
"Bold FM ON + AA: "
+
fm
.
charWidth
(
'\u200b'
));
cwid
=
fm
.
charWidth
(
'\u200b'
);
if
(
cwid
>
0
&&
cwid
<
errorMargin
)
{
throw
new
RuntimeException
(
errMsg
);
}
((
Graphics2D
)
g
).
setRenderingHint
(
RenderingHints
.
KEY_FRACTIONALMETRICS
,
RenderingHints
.
VALUE_FRACTIONALMETRICS_ON
);
((
Graphics2D
)
g
).
setRenderingHint
(
RenderingHints
.
KEY_TEXT_ANTIALIASING
,
RenderingHints
.
VALUE_TEXT_ANTIALIAS_OFF
);
fm
=
g
.
getFontMetrics
();
System
.
out
.
println
(
"Bold FM ON + nonAA: "
+
fm
.
charWidth
(
'\u200b'
));
cwid
=
fm
.
charWidth
(
'\u200b'
);
if
(
cwid
>
0
&&
cwid
<
errorMargin
)
{
throw
new
RuntimeException
(
errMsg
);
}
System
.
out
.
println
(
"All printed values should be 0 to PASS"
);
}
}
test/java/awt/print/PrinterJob/ImagePrinting/ImageTypes.java
0 → 100644
浏览文件 @
dc0440a8
/*
* Copyright (c) 2006, 2011, 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 4521945 7006865
* @summary Test printing images of different types.
* @author prr
* @run main/manual=yesno/timeout=900 ImageTypes
*/
import
java.io.*
;
import
static
java
.
awt
.
Color
.*;
import
java.awt.*
;
import
java.awt.geom.*
;
import
java.awt.event.*
;
import
java.awt.print.*
;
import
java.awt.image.*
;
import
static
java
.
awt
.
image
.
BufferedImage
.*;
import
javax.print.*
;
import
javax.print.attribute.*
;
import
javax.print.attribute.standard.*
;
public
class
ImageTypes
extends
Frame
implements
ActionListener
{
private
ImageCanvas
c
;
public
static
void
main
(
String
args
[])
{
ImageTypes
f
=
new
ImageTypes
();
f
.
show
();
}
public
ImageTypes
()
{
super
(
"Image Types Printing Test"
);
c
=
new
ImageCanvas
();
add
(
"Center"
,
c
);
Button
printThisButton
=
new
Button
(
"Print"
);
printThisButton
.
addActionListener
(
this
);
Panel
p
=
new
Panel
();
p
.
add
(
printThisButton
);
add
(
"South"
,
p
);
add
(
"North"
,
getInstructions
());
addWindowListener
(
new
WindowAdapter
()
{
public
void
windowClosing
(
WindowEvent
e
)
{
System
.
exit
(
0
);
}
});
pack
();
}
private
TextArea
getInstructions
()
{
TextArea
ta
=
new
TextArea
(
10
,
60
);
ta
.
setFont
(
new
Font
(
"Dialog"
,
Font
.
PLAIN
,
11
));
ta
.
setText
(
"This is a manual test as it requires that you compare "
+
"the on-screen rendering with the printed output.\n"
+
"Select the 'Print' button to print out the test.\n"
+
"For each image compare the printed one to the on-screen one.\n"
+
"The test PASSES if the onscreen and printed rendering match."
);
return
ta
;
}
public
void
actionPerformed
(
ActionEvent
e
)
{
PrinterJob
pj
=
PrinterJob
.
getPrinterJob
();
PrintRequestAttributeSet
attrs
=
new
HashPrintRequestAttributeSet
();
if
(
pj
!=
null
&&
pj
.
printDialog
(
attrs
))
{
pj
.
setPrintable
(
c
);
try
{
pj
.
print
(
attrs
);
}
catch
(
PrinterException
pe
)
{
pe
.
printStackTrace
();
throw
new
RuntimeException
(
"Exception whilst printing."
);
}
finally
{
System
.
out
.
println
(
"PRINT RETURNED OK."
);
}
}
}
}
class
ImageCanvas
extends
Component
implements
Printable
{
IndexColorModel
icm2
=
null
;
IndexColorModel
icm4
=
null
;
BufferedImage
opaqueImg
=
null
;
BufferedImage
transImg
=
null
;
int
sw
=
99
,
sh
=
99
;
void
paintImage
(
BufferedImage
bi
,
Color
c1
,
Color
c2
)
{
GradientPaint
tp
=
new
GradientPaint
(
0.0f
,
0.0f
,
c1
,
10
f
,
8
f
,
c2
,
true
);
Graphics2D
g2d
=
(
Graphics2D
)
bi
.
getGraphics
();
g2d
.
setPaint
(
tp
);
g2d
.
fillRect
(
0
,
0
,
sw
,
sh
);
g2d
.
setColor
(
gray
);
int
cnt
=
0
;
Font
font
=
new
Font
(
"Serif"
,
Font
.
PLAIN
,
11
);
g2d
.
setFont
(
font
);
FontMetrics
fm
=
g2d
.
getFontMetrics
();
for
(
int
y
=
12
;
y
<
sh
;
y
+=
12
)
{
int
x
=
0
;
while
(
x
<
sw
)
{
String
s
=
(
new
Integer
(++
cnt
)).
toString
();
g2d
.
drawString
(
s
,
x
,
y
);
x
+=
fm
.
stringWidth
(
s
);
}
}
}
ImageCanvas
()
{
opaqueImg
=
new
BufferedImage
(
sw
,
sh
,
TYPE_INT_RGB
);
Color
o1
=
new
Color
(
0
,
0
,
0
);
Color
o2
=
new
Color
(
255
,
255
,
255
);
paintImage
(
opaqueImg
,
o1
,
o2
);
transImg
=
new
BufferedImage
(
sw
,
sh
,
TYPE_INT_ARGB
);
Color
t1
=
new
Color
(
255
,
255
,
255
,
220
);
Color
t2
=
new
Color
(
255
,
200
,
0
,
220
);
paintImage
(
transImg
,
t1
,
t2
);
/* greyscale 2bpp */
byte
[]
arr2bpp
=
{(
byte
)
0
,
(
byte
)
0x55
,
(
byte
)
0xaa
,
(
byte
)
0xff
};
icm2
=
new
IndexColorModel
(
2
,
4
,
arr2bpp
,
arr2bpp
,
arr2bpp
);
/* color 4bpp */
int
[]
cmap
=
new
int
[
16
];
cmap
[
0
]
=
black
.
getRGB
();
cmap
[
1
]
=
white
.
getRGB
();
cmap
[
2
]
=
gray
.
getRGB
();
cmap
[
3
]
=
lightGray
.
getRGB
();
cmap
[
4
]
=
red
.
getRGB
();
cmap
[
5
]
=
green
.
getRGB
();
cmap
[
6
]
=
blue
.
getRGB
();
cmap
[
7
]
=
yellow
.
getRGB
();
cmap
[
8
]
=
cyan
.
getRGB
();
cmap
[
9
]
=
magenta
.
getRGB
();
cmap
[
10
]
=
orange
.
getRGB
();
cmap
[
11
]
=
pink
.
getRGB
();
cmap
[
12
]
=
darkGray
.
getRGB
();
cmap
[
13
]
=
192
<<
16
;
// dark red.
cmap
[
14
]
=
192
<<
8
;
// dark green
cmap
[
15
]
=
192
;
// dark blue
icm4
=
new
IndexColorModel
(
4
,
16
,
cmap
,
0
,
false
,
-
1
,
DataBuffer
.
TYPE_BYTE
);
}
public
int
print
(
Graphics
g
,
PageFormat
pgFmt
,
int
pgIndex
)
{
if
(
pgIndex
>
0
)
{
return
Printable
.
NO_SUCH_PAGE
;
}
Graphics2D
g2d
=
(
Graphics2D
)
g
;
g2d
.
translate
(
pgFmt
.
getImageableX
(),
pgFmt
.
getImageableY
());
paint
(
g2d
);
return
Printable
.
PAGE_EXISTS
;
}
private
void
drawImage
(
Graphics
g
,
int
biType
,
IndexColorModel
icm
)
{
BufferedImage
bi
;
if
(
icm
!=
null
)
{
bi
=
new
BufferedImage
(
sw
,
sh
,
biType
,
icm
);
}
else
{
bi
=
new
BufferedImage
(
sw
,
sh
,
biType
);
}
Graphics
big
=
bi
.
getGraphics
();
if
(
bi
.
getColorModel
().
getPixelSize
()
<=
2
)
{
big
.
drawImage
(
opaqueImg
,
0
,
0
,
null
);
}
else
{
big
.
drawImage
(
transImg
,
0
,
0
,
null
);
}
g
.
drawImage
(
bi
,
0
,
0
,
null
);
}
public
void
paint
(
Graphics
g
)
{
int
incX
=
sw
+
10
,
incY
=
sh
+
10
;
g
.
translate
(
10
,
10
);
drawImage
(
g
,
TYPE_INT_RGB
,
null
);
g
.
translate
(
incX
,
0
);
drawImage
(
g
,
TYPE_INT_BGR
,
null
);
g
.
translate
(
incX
,
0
);
drawImage
(
g
,
TYPE_INT_ARGB
,
null
);
g
.
translate
(
incX
,
0
);
drawImage
(
g
,
TYPE_INT_ARGB_PRE
,
null
);
g
.
translate
(-
3
*
incX
,
incY
);
drawImage
(
g
,
TYPE_3BYTE_BGR
,
null
);
g
.
translate
(
incX
,
0
);
drawImage
(
g
,
TYPE_4BYTE_ABGR
,
null
);
g
.
translate
(
incX
,
0
);
drawImage
(
g
,
TYPE_4BYTE_ABGR_PRE
,
null
);
g
.
translate
(
incX
,
0
);
drawImage
(
g
,
TYPE_USHORT_555_RGB
,
null
);
g
.
translate
(-
3
*
incX
,
incY
);
drawImage
(
g
,
TYPE_USHORT_555_RGB
,
null
);
g
.
translate
(
incX
,
0
);
drawImage
(
g
,
TYPE_USHORT_GRAY
,
null
);
g
.
translate
(
incX
,
0
);
drawImage
(
g
,
TYPE_BYTE_GRAY
,
null
);
g
.
translate
(
incX
,
0
);
drawImage
(
g
,
TYPE_BYTE_INDEXED
,
null
);
g
.
translate
(-
3
*
incX
,
incY
);
drawImage
(
g
,
TYPE_BYTE_BINARY
,
null
);
g
.
translate
(
incX
,
0
);
drawImage
(
g
,
TYPE_BYTE_BINARY
,
icm2
);
g
.
translate
(
incX
,
0
);
drawImage
(
g
,
TYPE_BYTE_BINARY
,
icm4
);
g
.
translate
(
incX
,
0
);
drawImage
(
g
,
TYPE_BYTE_INDEXED
,
icm2
);
g
.
translate
(-
3
*
incX
,
incY
);
drawImage
(
g
,
TYPE_BYTE_INDEXED
,
icm4
);
g
.
translate
(
incX
,
0
);
}
/* Size is chosen to match default imageable width of a NA letter
* page. This means there will be clipping, what is clipped will
* depend on PageFormat orientation.
*/
public
Dimension
getPreferredSize
()
{
return
new
Dimension
(
468
,
600
);
}
}
test/java/lang/Thread/StopBeforeStart.java
已删除
100644 → 0
浏览文件 @
7137c71c
/*
* Copyright (c) 2005, 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 4519200
* @summary Confirm a Thread.stop before start complies with the spec
* @author Pete Soper
*
* Confirm that a thread that had its stop method invoked before start
* does properly terminate with expected exception behavior. NOTE that
* arbitrary application threads could return from their run methods faster
* than the VM can throw an async exception.
*/
public
class
StopBeforeStart
{
private
static
final
int
JOIN_TIMEOUT
=
10000
;
private
class
MyThrowable
extends
Throwable
{
}
private
class
Catcher
implements
Thread
.
UncaughtExceptionHandler
{
private
boolean
nullaryStop
;
private
Throwable
theThrowable
;
private
Throwable
expectedThrowable
;
private
boolean
exceptionThrown
;
Catcher
(
boolean
nullaryStop
)
{
this
.
nullaryStop
=
nullaryStop
;
if
(!
nullaryStop
)
{
expectedThrowable
=
new
MyThrowable
();
}
}
public
void
uncaughtException
(
Thread
t
,
Throwable
th
)
{
exceptionThrown
=
true
;
theThrowable
=
th
;
}
void
check
(
String
label
)
throws
Throwable
{
if
(!
exceptionThrown
)
{
throw
new
RuntimeException
(
label
+
" test:"
+
" missing uncaught exception"
);
}
if
(
nullaryStop
)
{
if
(!
(
theThrowable
instanceof
ThreadDeath
))
{
throw
new
RuntimeException
(
label
+
" test:"
+
" expected ThreadDeath in uncaught handler"
);
}
}
else
if
(
theThrowable
!=
expectedThrowable
)
{
throw
new
RuntimeException
(
label
+
" test:"
+
" wrong Throwable in uncaught handler"
);
}
}
}
private
class
MyRunnable
implements
Runnable
{
public
void
run
()
{
while
(
true
)
;
}
}
private
class
MyThread
extends
Thread
{
public
void
run
()
{
while
(
true
)
;
}
}
public
static
void
main
(
String
args
[])
throws
Throwable
{
(
new
StopBeforeStart
()).
doit
();
System
.
out
.
println
(
"Test passed"
);
}
private
void
doit
()
throws
Throwable
{
runit
(
false
,
new
Thread
(
new
MyRunnable
()),
"Thread"
);
runit
(
true
,
new
Thread
(
new
MyRunnable
()),
"Thread"
);
runit
(
false
,
new
MyThread
(),
"Runnable"
);
runit
(
true
,
new
MyThread
(),
"Runnable"
);
}
private
void
runit
(
boolean
nullaryStop
,
Thread
thread
,
String
type
)
throws
Throwable
{
Catcher
c
=
new
Catcher
(
nullaryStop
);
thread
.
setUncaughtExceptionHandler
(
c
);
if
(
nullaryStop
)
{
thread
.
stop
();
}
else
{
thread
.
stop
(
c
.
expectedThrowable
);
}
thread
.
start
();
thread
.
join
(
JOIN_TIMEOUT
);
if
(
thread
.
getState
()
!=
Thread
.
State
.
TERMINATED
)
{
thread
.
stop
();
// Under high load this could be a false positive
throw
new
RuntimeException
(
type
+
" test:"
+
" app thread did not terminate"
);
}
c
.
check
(
type
);
}
}
test/java/nio/channels/FileChannel/Position.java
浏览文件 @
dc0440a8
...
@@ -22,13 +22,16 @@
...
@@ -22,13 +22,16 @@
*/
*/
/* @test
/* @test
* @bug 4429043 6526860
* @summary Test position method of FileChannel
* @summary Test position method of FileChannel
*/
*/
import
java.io.*
;
import
java.io.*
;
import
java.nio.MappedByteBuffer
;
import
java.nio.ByteBuffer
;
import
java.nio.channels.*
;
import
java.nio.channels.FileChannel
;
import
java.nio.channels.FileChannel
;
import
java.nio.file.*
;
import
static
java
.
nio
.
file
.
StandardOpenOption
.*;
import
java.nio.charset.Charset
;
import
java.util.Random
;
import
java.util.Random
;
...
@@ -38,32 +41,42 @@ import java.util.Random;
...
@@ -38,32 +41,42 @@ import java.util.Random;
public
class
Position
{
public
class
Position
{
private
static
PrintStream
err
=
System
.
err
;
private
static
final
Charset
ISO8859_1
=
Charset
.
forName
(
"8859_1"
)
;
private
static
Random
generator
=
new
Random
();
private
static
final
Random
generator
=
new
Random
();
private
static
int
CHARS_PER_LINE
=
File
.
separatorChar
==
'/'
?
5
:
6
;
private
static
File
blah
;
public
static
void
main
(
String
[]
args
)
throws
Exception
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
blah
=
File
.
createTempFile
(
"blah"
,
null
);
Path
blah
=
Files
.
createTempFile
(
"blah"
,
null
);
blah
.
deleteOnExit
();
blah
.
toFile
().
deleteOnExit
();
initTestFile
(
blah
);
initTestFile
(
blah
);
FileInputStream
fis
=
new
FileInputStream
(
blah
);
for
(
int
i
=
0
;
i
<
10
;
i
++)
{
FileChannel
c
=
fis
.
getChannel
();
try
(
FileChannel
fc
=
(
generator
.
nextBoolean
())
?
FileChannel
.
open
(
blah
,
READ
)
:
new
FileInputStream
(
blah
.
toFile
()).
getChannel
())
{
for
(
int
j
=
0
;
j
<
100
;
j
++)
{
long
newPos
=
generator
.
nextInt
(
1000
);
fc
.
position
(
newPos
);
if
(
fc
.
position
()
!=
newPos
)
throw
new
RuntimeException
(
"Position failed"
);
}
}
}
for
(
int
i
=
0
;
i
<
100
;
i
++)
{
for
(
int
i
=
0
;
i
<
10
;
i
++)
{
long
newPos
=
generator
.
nextInt
(
1000
);
try
(
FileChannel
fc
=
(
generator
.
nextBoolean
())
?
c
.
position
(
newPos
);
FileChannel
.
open
(
blah
,
APPEND
)
:
if
(
c
.
position
()
!=
newPos
)
new
FileOutputStream
(
blah
.
toFile
(),
true
).
getChannel
())
{
throw
new
RuntimeException
(
"Position failed"
);
for
(
int
j
=
0
;
j
<
10
;
j
++)
{
if
(
fc
.
position
()
!=
fc
.
size
())
throw
new
RuntimeException
(
"Position expected to be size"
);
byte
[]
buf
=
new
byte
[
generator
.
nextInt
(
100
)];
fc
.
write
(
ByteBuffer
.
wrap
(
buf
));
}
}
}
}
c
.
close
();
Files
.
delete
(
blah
);
fis
.
close
();
blah
.
delete
();
}
}
/**
/**
...
@@ -78,19 +91,15 @@ public class Position {
...
@@ -78,19 +91,15 @@ public class Position {
* 3999
* 3999
*
*
*/
*/
private
static
void
initTestFile
(
File
blah
)
throws
Exception
{
private
static
void
initTestFile
(
Path
blah
)
throws
IOException
{
FileOutputStream
fos
=
new
FileOutputStream
(
blah
);
try
(
BufferedWriter
awriter
=
Files
.
newBufferedWriter
(
blah
,
ISO8859_1
))
{
BufferedWriter
awriter
for
(
int
i
=
0
;
i
<
4000
;
i
++)
{
=
new
BufferedWriter
(
new
OutputStreamWriter
(
fos
,
"8859_1"
));
String
number
=
new
Integer
(
i
).
toString
();
for
(
int
h
=
0
;
h
<
4
-
number
.
length
();
h
++)
for
(
int
i
=
0
;
i
<
4000
;
i
++)
{
awriter
.
write
(
"0"
);
String
number
=
new
Integer
(
i
).
toString
();
awriter
.
write
(
""
+
i
);
for
(
int
h
=
0
;
h
<
4
-
number
.
length
();
h
++)
awriter
.
newLine
();
awriter
.
write
(
"0"
);
}
awriter
.
write
(
""
+
i
);
awriter
.
newLine
();
}
}
awriter
.
flush
();
awriter
.
close
();
}
}
}
}
test/java/nio/file/Files/walkFileTree/PrintFileTree.java
浏览文件 @
dc0440a8
...
@@ -54,6 +54,7 @@ public class PrintFileTree {
...
@@ -54,6 +54,7 @@ public class PrintFileTree {
if
(
followLinks
)
if
(
followLinks
)
options
.
add
(
FileVisitOption
.
FOLLOW_LINKS
);
options
.
add
(
FileVisitOption
.
FOLLOW_LINKS
);
final
boolean
follow
=
followLinks
;
final
boolean
reportCycles
=
printCycles
;
final
boolean
reportCycles
=
printCycles
;
Files
.
walkFileTree
(
dir
,
options
,
Integer
.
MAX_VALUE
,
new
FileVisitor
<
Path
>()
{
Files
.
walkFileTree
(
dir
,
options
,
Integer
.
MAX_VALUE
,
new
FileVisitor
<
Path
>()
{
@Override
@Override
...
@@ -63,8 +64,7 @@ public class PrintFileTree {
...
@@ -63,8 +64,7 @@ public class PrintFileTree {
}
}
@Override
@Override
public
FileVisitResult
visitFile
(
Path
file
,
BasicFileAttributes
attrs
)
{
public
FileVisitResult
visitFile
(
Path
file
,
BasicFileAttributes
attrs
)
{
if
(!
attrs
.
isDirectory
()
||
reportCycles
)
System
.
out
.
println
(
file
);
System
.
out
.
println
(
file
);
return
FileVisitResult
.
CONTINUE
;
return
FileVisitResult
.
CONTINUE
;
}
}
@Override
@Override
...
@@ -79,11 +79,13 @@ public class PrintFileTree {
...
@@ -79,11 +79,13 @@ public class PrintFileTree {
public
FileVisitResult
visitFileFailed
(
Path
file
,
IOException
exc
)
public
FileVisitResult
visitFileFailed
(
Path
file
,
IOException
exc
)
throws
IOException
throws
IOException
{
{
if
(
reportCycles
&&
(
exc
instanceof
FileSystemLoopException
))
{
if
(
follow
&&
(
exc
instanceof
FileSystemLoopException
))
{
System
.
out
.
println
(
file
);
if
(
reportCycles
)
System
.
out
.
println
(
file
);
return
FileVisitResult
.
CONTINUE
;
return
FileVisitResult
.
CONTINUE
;
}
else
{
throw
exc
;
}
}
throw
exc
;
}
}
});
});
}
}
...
...
test/java/util/Hashtable/SerializationDeadlock.java
0 → 100644
浏览文件 @
dc0440a8
/*
* Copyright (c) 2010, 2011 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.
*
* -------------------------------------------
*
* Portions Copyright (c) 2010, 2011 IBM Corporation
*/
/*
* @test
* @bug 6927486
* @summary Serializing Hashtable objects which refer to each other should not be able to deadlock.
* @author Neil Richards <neil.richards@ngmr.net>, <neil_richards@uk.ibm.com>
*/
import
java.io.ByteArrayOutputStream
;
import
java.io.IOException
;
import
java.io.ObjectOutputStream
;
import
java.io.PrintWriter
;
import
java.io.Serializable
;
import
java.io.StringWriter
;
import
java.util.ArrayList
;
import
java.util.Hashtable
;
import
java.util.List
;
import
java.util.concurrent.CyclicBarrier
;
public
class
SerializationDeadlock
{
public
static
void
main
(
final
String
[]
args
)
throws
Exception
{
// Test for Hashtable serialization deadlock
final
Hashtable
<
Object
,
Object
>
h1
=
new
Hashtable
<>();
final
Hashtable
<
Object
,
Object
>
h2
=
new
Hashtable
<>();
final
TestBarrier
testStart
=
new
TestBarrier
(
3
);
// Populate the hashtables so that they refer to each other
h1
.
put
(
testStart
,
h2
);
h2
.
put
(
testStart
,
h1
);
final
CyclicBarrier
testEnd
=
new
CyclicBarrier
(
3
);
final
TestThread
t1
=
new
TestThread
(
h1
,
testEnd
);
final
TestThread
t2
=
new
TestThread
(
h2
,
testEnd
);
t1
.
start
();
t2
.
start
();
// Wait for both test threads to have initiated serialization
// of the 'testStart' object (and hence of both 'h1' and 'h2')
testStart
.
await
();
// Wait for both test threads to successfully finish serialization
// of 'h1' and 'h2'.
System
.
out
.
println
(
"Waiting for Hashtable serialization to complete ..."
);
System
.
out
.
println
(
"(This test will hang if serialization deadlocks)"
);
testEnd
.
await
();
System
.
out
.
println
(
"Test PASSED: serialization completed successfully"
);
TestThread
.
handleExceptions
();
}
static
final
class
TestBarrier
extends
CyclicBarrier
implements
Serializable
{
public
TestBarrier
(
final
int
count
)
{
super
(
count
);
}
private
void
writeObject
(
final
ObjectOutputStream
oos
)
throws
IOException
{
oos
.
defaultWriteObject
();
// Wait until all test threads have started serializing data
try
{
await
();
}
catch
(
final
Exception
e
)
{
throw
new
IOException
(
"Test ERROR: Unexpected exception caught"
,
e
);
}
}
}
static
final
class
TestThread
extends
Thread
{
private
static
final
List
<
Exception
>
exceptions
=
new
ArrayList
<>();
private
final
Hashtable
<
Object
,
Object
>
hashtable
;
private
final
CyclicBarrier
testEnd
;
public
TestThread
(
final
Hashtable
<
Object
,
Object
>
hashtable
,
final
CyclicBarrier
testEnd
)
{
this
.
hashtable
=
hashtable
;
this
.
testEnd
=
testEnd
;
setDaemon
(
true
);
}
public
void
run
()
{
try
{
final
ByteArrayOutputStream
baos
=
new
ByteArrayOutputStream
();
final
ObjectOutputStream
oos
=
new
ObjectOutputStream
(
baos
);
oos
.
writeObject
(
hashtable
);
oos
.
close
();
}
catch
(
final
IOException
ioe
)
{
addException
(
ioe
);
}
finally
{
try
{
testEnd
.
await
();
}
catch
(
Exception
e
)
{
addException
(
e
);
}
}
}
private
static
synchronized
void
addException
(
final
Exception
exception
)
{
exceptions
.
add
(
exception
);
}
public
static
synchronized
void
handleExceptions
()
{
if
(
false
==
exceptions
.
isEmpty
())
{
throw
new
RuntimeException
(
getErrorText
(
exceptions
));
}
}
private
static
String
getErrorText
(
final
List
<
Exception
>
exceptions
)
{
final
StringWriter
sw
=
new
StringWriter
();
final
PrintWriter
pw
=
new
PrintWriter
(
sw
);
pw
.
println
(
"Test ERROR: Unexpected exceptions thrown on test threads:"
);
for
(
Exception
exception
:
exceptions
)
{
pw
.
print
(
"\t"
);
pw
.
println
(
exception
);
for
(
StackTraceElement
element
:
exception
.
getStackTrace
())
{
pw
.
print
(
"\t\tat "
);
pw
.
println
(
element
);
}
}
pw
.
close
();
return
sw
.
toString
();
}
}
}
test/java/util/Hashtable/SimpleSerialization.java
0 → 100644
浏览文件 @
dc0440a8
/*
* Copyright (c) 2010, 2011 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.
*
* -------------------------------------------
*
* Portions Copyright (c) 2010, 2011 IBM Corporation
*/
/*
* @test
* @bug 6927486
* @summary A serialized Hashtable can be de-serialized properly.
* @author Neil Richards <neil.richards@ngmr.net>, <neil_richards@uk.ibm.com>
*/
import
java.io.ByteArrayInputStream
;
import
java.io.ByteArrayOutputStream
;
import
java.io.IOException
;
import
java.io.ObjectInputStream
;
import
java.io.ObjectOutputStream
;
import
java.io.PrintWriter
;
import
java.io.StringWriter
;
import
java.util.Hashtable
;
public
class
SimpleSerialization
{
public
static
void
main
(
final
String
[]
args
)
throws
Exception
{
Hashtable
<
String
,
String
>
h1
=
new
Hashtable
<>();
h1
.
put
(
"key"
,
"value"
);
final
ByteArrayOutputStream
baos
=
new
ByteArrayOutputStream
();
final
ObjectOutputStream
oos
=
new
ObjectOutputStream
(
baos
);
oos
.
writeObject
(
h1
);
oos
.
close
();
final
byte
[]
data
=
baos
.
toByteArray
();
final
ByteArrayInputStream
bais
=
new
ByteArrayInputStream
(
data
);
final
ObjectInputStream
ois
=
new
ObjectInputStream
(
bais
);
final
Object
deserializedObject
=
ois
.
readObject
();
ois
.
close
();
if
(
false
==
h1
.
equals
(
deserializedObject
))
{
throw
new
RuntimeException
(
getFailureText
(
h1
,
deserializedObject
));
}
}
private
static
String
getFailureText
(
final
Object
orig
,
final
Object
copy
)
{
final
StringWriter
sw
=
new
StringWriter
();
final
PrintWriter
pw
=
new
PrintWriter
(
sw
);
pw
.
println
(
"Test FAILED: Deserialized object is not equal to the original object"
);
pw
.
print
(
"\tOriginal: "
);
printObject
(
pw
,
orig
).
println
();
pw
.
print
(
"\tCopy: "
);
printObject
(
pw
,
copy
).
println
();
pw
.
close
();
return
sw
.
toString
();
}
private
static
PrintWriter
printObject
(
final
PrintWriter
pw
,
final
Object
o
)
{
pw
.
printf
(
"%s@%08x"
,
o
.
getClass
().
getName
(),
System
.
identityHashCode
(
o
));
return
pw
;
}
}
test/java/util/TimeZone/DaylightTimeTest.java
0 → 100644
浏览文件 @
dc0440a8
/*
* Copyright (c) 2011, 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 6936350
* @summary Test case for TimeZone.observesDaylightTime()
*/
import
java.util.*
;
import
static
java
.
util
.
GregorianCalendar
.*;
public
class
DaylightTimeTest
{
private
static
final
int
ONE_HOUR
=
60
*
60
*
1000
;
// one hour
private
static
final
int
INTERVAL
=
24
*
ONE_HOUR
;
// one day
private
static
final
String
[]
ZONES
=
TimeZone
.
getAvailableIDs
();
private
static
int
errors
=
0
;
public
static
void
main
(
String
[]
args
)
{
// Test default TimeZone
for
(
String
id
:
ZONES
)
{
TimeZone
tz
=
TimeZone
.
getTimeZone
(
id
);
long
now
=
System
.
currentTimeMillis
();
boolean
observes
=
tz
.
observesDaylightTime
();
boolean
found
=
findDSTTransition
(
tz
,
now
);
if
(
observes
!=
found
)
{
// There's a critical section. If DST ends after the
// System.currentTimeMills() call, there should be
// inconsistency in the determination. Try the same
// thing again to see the inconsistency was due to the
// critical section.
now
=
System
.
currentTimeMillis
();
observes
=
tz
.
observesDaylightTime
();
found
=
findDSTTransition
(
tz
,
now
);
if
(
observes
!=
found
)
{
System
.
err
.
printf
(
"%s: observesDaylightTime() should return %s at %d%n"
,
tz
.
getID
(),
found
,
now
);
errors
++;
}
}
}
// Test SimpleTimeZone in which observesDaylightTime() is
// equivalent to useDaylightTime().
testSimpleTimeZone
(
new
SimpleTimeZone
(-
8
*
ONE_HOUR
,
"X"
,
APRIL
,
1
,
-
SUNDAY
,
2
*
ONE_HOUR
,
OCTOBER
,
-
1
,
SUNDAY
,
2
*
ONE_HOUR
,
1
*
ONE_HOUR
));
testSimpleTimeZone
(
new
SimpleTimeZone
(-
8
*
ONE_HOUR
,
"Y"
));
if
(
errors
>
0
)
{
throw
new
RuntimeException
(
"DaylightTimeTest: failed"
);
}
}
/**
* Returns true if it's `now' in DST or there's any
* standard-to-daylight transition within 50 years after `now'.
*/
private
static
boolean
findDSTTransition
(
TimeZone
tz
,
long
now
)
{
GregorianCalendar
cal
=
new
GregorianCalendar
(
tz
,
Locale
.
US
);
cal
.
setTimeInMillis
(
now
);
cal
.
add
(
YEAR
,
50
);
long
end
=
cal
.
getTimeInMillis
();
for
(
long
t
=
now
;
t
<
end
;
t
+=
INTERVAL
)
{
cal
.
setTimeInMillis
(
t
);
if
(
cal
.
get
(
DST_OFFSET
)
>
0
)
{
return
true
;
}
}
return
false
;
}
private
static
void
testSimpleTimeZone
(
SimpleTimeZone
stz
)
{
if
(
stz
.
useDaylightTime
()
!=
stz
.
observesDaylightTime
())
{
System
.
err
.
printf
(
"Failed: useDaylightTime=%b, observesDaylightTime()=%b%n\t%s%n"
,
stz
.
useDaylightTime
(),
stz
.
observesDaylightTime
(),
stz
);
errors
++;
}
}
}
test/java/util/Vector/SerializationDeadlock.java
0 → 100644
浏览文件 @
dc0440a8
/*
* Copyright (c) 2010, 2011 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.
*/
/*
* Portions Copyright (c) 2010, 2011 IBM Corporation
*/
/*
* @test
* @bug 6934356
* @summary Serializing Vector objects which refer to each other should not be able to deadlock.
* @author Neil Richards <neil.richards@ngmr.net>, <neil_richards@uk.ibm.com>
*/
import
java.io.ByteArrayOutputStream
;
import
java.io.IOException
;
import
java.io.ObjectOutputStream
;
import
java.io.PrintWriter
;
import
java.io.Serializable
;
import
java.io.StringWriter
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Vector
;
import
java.util.concurrent.CyclicBarrier
;
public
class
SerializationDeadlock
{
public
static
void
main
(
final
String
[]
args
)
throws
Exception
{
// Test for Vector serialization deadlock
final
Vector
<
Object
>
v1
=
new
Vector
<>();
final
Vector
<
Object
>
v2
=
new
Vector
<>();
final
TestBarrier
testStart
=
new
TestBarrier
(
3
);
// Populate the vectors so that they refer to each other
v1
.
add
(
testStart
);
v1
.
add
(
v2
);
v2
.
add
(
testStart
);
v2
.
add
(
v1
);
final
CyclicBarrier
testEnd
=
new
CyclicBarrier
(
3
);
final
TestThread
t1
=
new
TestThread
(
v1
,
testEnd
);
final
TestThread
t2
=
new
TestThread
(
v2
,
testEnd
);
t1
.
start
();
t2
.
start
();
// Wait for both test threads to have initiated serialization
// of the 'testStart' object (and hence of both 'v1' and 'v2')
testStart
.
await
();
// Wait for both test threads to successfully finish serialization
// of 'v1' and 'v2'.
System
.
out
.
println
(
"Waiting for Vector serialization to complete ..."
);
System
.
out
.
println
(
"(This test will hang if serialization deadlocks)"
);
testEnd
.
await
();
System
.
out
.
println
(
"Test PASSED: serialization completed successfully"
);
TestThread
.
handleExceptions
();
}
static
final
class
TestBarrier
extends
CyclicBarrier
implements
Serializable
{
public
TestBarrier
(
final
int
count
)
{
super
(
count
);
}
private
void
writeObject
(
final
ObjectOutputStream
oos
)
throws
IOException
{
oos
.
defaultWriteObject
();
// Wait until all test threads have started serializing data
try
{
await
();
}
catch
(
final
Exception
e
)
{
throw
new
IOException
(
"Test ERROR: Unexpected exception caught"
,
e
);
}
}
}
static
final
class
TestThread
extends
Thread
{
private
static
final
List
<
Exception
>
exceptions
=
new
ArrayList
<>();
private
final
Vector
vector
;
private
final
CyclicBarrier
testEnd
;
public
TestThread
(
final
Vector
vector
,
final
CyclicBarrier
testEnd
)
{
this
.
vector
=
vector
;
this
.
testEnd
=
testEnd
;
setDaemon
(
true
);
}
public
void
run
()
{
try
{
final
ByteArrayOutputStream
baos
=
new
ByteArrayOutputStream
();
final
ObjectOutputStream
oos
=
new
ObjectOutputStream
(
baos
);
oos
.
writeObject
(
vector
);
oos
.
close
();
}
catch
(
final
IOException
ioe
)
{
addException
(
ioe
);
}
finally
{
try
{
testEnd
.
await
();
}
catch
(
Exception
e
)
{
addException
(
e
);
}
}
}
private
static
synchronized
void
addException
(
final
Exception
exception
)
{
exceptions
.
add
(
exception
);
}
public
static
synchronized
void
handleExceptions
()
{
if
(
false
==
exceptions
.
isEmpty
())
{
throw
new
RuntimeException
(
getErrorText
(
exceptions
));
}
}
private
static
String
getErrorText
(
final
List
<
Exception
>
exceptions
)
{
final
StringWriter
sw
=
new
StringWriter
();
final
PrintWriter
pw
=
new
PrintWriter
(
sw
);
pw
.
println
(
"Test ERROR: Unexpected exceptions thrown on test threads:"
);
for
(
Exception
exception
:
exceptions
)
{
pw
.
print
(
"\t"
);
pw
.
println
(
exception
);
for
(
StackTraceElement
element
:
exception
.
getStackTrace
())
{
pw
.
print
(
"\t\tat "
);
pw
.
println
(
element
);
}
}
pw
.
close
();
return
sw
.
toString
();
}
}
}
test/java/util/Vector/SimpleSerialization.java
0 → 100644
浏览文件 @
dc0440a8
/*
* Copyright (c) 2010, 2011 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.
*/
/*
* Portions Copyright (c) 2010, 2011 IBM Corporation
*/
/*
* @test
* @bug 6934356
* @summary A serialized Vector can be successfully de-serialized.
* @author Neil Richards <neil.richards@ngmr.net>, <neil_richards@uk.ibm.com>
*/
import
java.io.ByteArrayInputStream
;
import
java.io.ByteArrayOutputStream
;
import
java.io.IOException
;
import
java.io.ObjectInputStream
;
import
java.io.ObjectOutputStream
;
import
java.io.PrintWriter
;
import
java.io.StringWriter
;
import
java.util.Vector
;
public
class
SimpleSerialization
{
public
static
void
main
(
final
String
[]
args
)
throws
Exception
{
final
Vector
<
String
>
v1
=
new
Vector
<>();
v1
.
add
(
"entry1"
);
v1
.
add
(
"entry2"
);
final
ByteArrayOutputStream
baos
=
new
ByteArrayOutputStream
();
final
ObjectOutputStream
oos
=
new
ObjectOutputStream
(
baos
);
oos
.
writeObject
(
v1
);
oos
.
close
();
final
byte
[]
data
=
baos
.
toByteArray
();
final
ByteArrayInputStream
bais
=
new
ByteArrayInputStream
(
data
);
final
ObjectInputStream
ois
=
new
ObjectInputStream
(
bais
);
final
Object
deserializedObject
=
ois
.
readObject
();
ois
.
close
();
if
(
false
==
v1
.
equals
(
deserializedObject
))
{
throw
new
RuntimeException
(
getFailureText
(
v1
,
deserializedObject
));
}
}
private
static
String
getFailureText
(
final
Object
orig
,
final
Object
copy
)
{
final
StringWriter
sw
=
new
StringWriter
();
final
PrintWriter
pw
=
new
PrintWriter
(
sw
);
pw
.
println
(
"Test FAILED: Deserialized object is not equal to the original object"
);
pw
.
print
(
"\tOriginal: "
);
printObject
(
pw
,
orig
).
println
();
pw
.
print
(
"\tCopy: "
);
printObject
(
pw
,
copy
).
println
();
pw
.
close
();
return
sw
.
toString
();
}
private
static
PrintWriter
printObject
(
final
PrintWriter
pw
,
final
Object
o
)
{
pw
.
printf
(
"%s@%08x"
,
o
.
getClass
().
getName
(),
System
.
identityHashCode
(
o
));
return
pw
;
}
}
test/java/util/concurrent/BlockingQueue/CancelledProducerConsumerLoops.java
浏览文件 @
dc0440a8
...
@@ -124,11 +124,11 @@ public class CancelledProducerConsumerLoops {
...
@@ -124,11 +124,11 @@ public class CancelledProducerConsumerLoops {
oneRun
(
new
ArrayBlockingQueue
<
Integer
>(
CAPACITY
),
pairs
,
iters
);
oneRun
(
new
ArrayBlockingQueue
<
Integer
>(
CAPACITY
),
pairs
,
iters
);
oneRun
(
new
LinkedBlockingQueue
<
Integer
>(
CAPACITY
),
pairs
,
iters
);
oneRun
(
new
LinkedBlockingQueue
<
Integer
>(
CAPACITY
),
pairs
,
iters
);
oneRun
(
new
LinkedBlockingDeque
<
Integer
>(
CAPACITY
),
pairs
,
iters
);
oneRun
(
new
LinkedBlockingDeque
<
Integer
>(
CAPACITY
),
pairs
,
iters
);
oneRun
(
new
LinkedTransferQueue
<
Integer
>(),
pairs
,
iters
);
oneRun
(
new
SynchronousQueue
<
Integer
>(),
pairs
,
iters
/
8
);
oneRun
(
new
SynchronousQueue
<
Integer
>(),
pairs
,
iters
/
8
);
/*
PriorityBlockingQueue is unbounded
/*
unbounded queue implementations are prone to OOME
oneRun(new PriorityBlockingQueue<Integer>(iters / 2 * pairs), pairs, iters / 4);
oneRun(new PriorityBlockingQueue<Integer>(iters / 2 * pairs), pairs, iters / 4);
oneRun(new LinkedTransferQueue<Integer>(), pairs, iters);
*/
*/
}
}
...
...
test/javax/print/attribute/ServiceDialogTest.java
浏览文件 @
dc0440a8
...
@@ -71,7 +71,7 @@ public class ServiceDialogTest {
...
@@ -71,7 +71,7 @@ public class ServiceDialogTest {
if
(
factories
.
length
>
0
)
{
if
(
factories
.
length
>
0
)
{
services
[
0
]
=
factories
[
0
].
getPrintService
(
fos
);
services
[
0
]
=
factories
[
0
].
getPrintService
(
fos
);
}
else
{
}
else
{
throw
new
RuntimeException
(
"No StreamPrintService available which would support "
+
flavor
"
);
throw
new
RuntimeException
(
"No StreamPrintService available which would support "
+
flavor
);
}
}
services
[
2
]
=
new
TestPrintService
(
"Test Printer"
);
services
[
2
]
=
new
TestPrintService
(
"Test Printer"
);
...
...
test/javax/swing/JComponent/6989617/bug6989617.java
浏览文件 @
dc0440a8
此差异已折叠。
点击以展开。
test/javax/swing/JFileChooser/6798062/bug6798062.html
浏览文件 @
dc0440a8
<html>
<html>
<body>
<body>
<applet
code=
"bug6798062.class"
width=
400
height=
300
></applet>
<applet
code=
"bug6798062.class"
width=
400
height=
300
></applet>
The test is suitable only for Windows
1. Create a link
1. Create a link
2. Copy path to the link into TextField
2. Copy path to the link into TextField
3. Run the Windows Task Manager. Select the Processes tab and find the java process
3. Run the Windows Task Manager. Select the Processes tab and find the java process
...
...
test/javax/swing/JFileChooser/6798062/bug6798062.java
浏览文件 @
dc0440a8
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
@run applet/manual=done bug6798062.html
@run applet/manual=done bug6798062.html
*/
*/
import
sun.awt.OSInfo
;
import
sun.awt.shell.ShellFolder
;
import
sun.awt.shell.ShellFolder
;
import
javax.swing.*
;
import
javax.swing.*
;
...
@@ -68,13 +69,23 @@ public class bug6798062 extends JApplet {
...
@@ -68,13 +69,23 @@ public class bug6798062 extends JApplet {
add
(
initialize
());
add
(
initialize
());
}
}
private
JPanel
initialize
()
{
private
JComponent
initialize
()
{
File
file
=
new
File
(
"c:/"
);
if
(
OSInfo
.
getOSType
()
!=
OSInfo
.
OSType
.
WINDOWS
)
{
return
new
JLabel
(
"The test is suitable only for Windows"
);
}
String
tempDir
=
System
.
getProperty
(
"java.io.tmpdir"
);
if
(
tempDir
.
length
()
==
0
)
{
// 'java.io.tmpdir' isn't guaranteed to be defined
tempDir
=
System
.
getProperty
(
"user.home"
);
}
System
.
out
.
println
(
"Temp directory: "
+
tempDir
);
try
{
try
{
folder
=
ShellFolder
.
getShellFolder
(
file
);
folder
=
ShellFolder
.
getShellFolder
(
new
File
(
tempDir
)
);
}
catch
(
FileNotFoundException
e
)
{
}
catch
(
FileNotFoundException
e
)
{
fail
(
"Directory "
+
file
.
getPath
()
+
" not found"
);
fail
(
"Directory "
+
tempDir
+
" not found"
);
}
}
slider
.
setMajorTickSpacing
(
10
);
slider
.
setMajorTickSpacing
(
10
);
...
...
test/javax/swing/JScrollBar/6542335/bug6542335.java
浏览文件 @
dc0440a8
...
@@ -69,8 +69,6 @@ public class bug6542335 {
...
@@ -69,8 +69,6 @@ public class bug6542335 {
frame
.
setSize
(
200
,
100
);
frame
.
setSize
(
200
,
100
);
frame
.
setVisible
(
true
);
frame
.
setVisible
(
true
);
thumbBounds
[
0
]
=
new
Rectangle
(
ui
.
getThumbBounds
());
}
}
});
});
...
@@ -78,6 +76,8 @@ public class bug6542335 {
...
@@ -78,6 +76,8 @@ public class bug6542335 {
SwingUtilities
.
invokeAndWait
(
new
Runnable
()
{
SwingUtilities
.
invokeAndWait
(
new
Runnable
()
{
public
void
run
()
{
public
void
run
()
{
thumbBounds
[
0
]
=
new
Rectangle
(
ui
.
getThumbBounds
());
Point
l
=
sb
.
getLocationOnScreen
();
Point
l
=
sb
.
getLocationOnScreen
();
robot
.
mouseMove
(
l
.
x
+
(
int
)
(
0.75
*
sb
.
getWidth
()),
l
.
y
+
sb
.
getHeight
()
/
2
);
robot
.
mouseMove
(
l
.
x
+
(
int
)
(
0.75
*
sb
.
getWidth
()),
l
.
y
+
sb
.
getHeight
()
/
2
);
...
...
test/javax/swing/LookAndFeel/6474153/bug6474153.java
0 → 100644
浏览文件 @
dc0440a8
/*
* Copyright (c) 2011, 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 6474153
* @summary LookAndFeel.makeKeyBindings(...) doesn't ignore last element in keyBindingList with odd size
* @author Alexander Potochkin
*/
import
javax.swing.KeyStroke
;
import
javax.swing.LookAndFeel
;
import
javax.swing.text.DefaultEditorKit
;
import
javax.swing.text.JTextComponent
;
public
class
bug6474153
{
public
static
void
main
(
String
...
args
)
throws
Exception
{
checkArray
(
LookAndFeel
.
makeKeyBindings
(
new
Object
[]
{
"UP"
,
DefaultEditorKit
.
upAction
}
));
checkArray
(
LookAndFeel
.
makeKeyBindings
(
new
Object
[]
{
"UP"
,
DefaultEditorKit
.
upAction
,
"PAGE_UP"
}
));
}
private
static
void
checkArray
(
JTextComponent
.
KeyBinding
[]
keyActionArray
)
{
if
(
keyActionArray
.
length
!=
1
)
{
throw
new
RuntimeException
(
"Wrong array lenght!"
);
}
if
(!
DefaultEditorKit
.
upAction
.
equals
(
keyActionArray
[
0
].
actionName
))
{
throw
new
RuntimeException
(
"Wrong action name!"
);
}
if
(!
KeyStroke
.
getKeyStroke
(
"UP"
).
equals
(
keyActionArray
[
0
].
key
))
{
throw
new
RuntimeException
(
"Wrong keystroke!"
);
}
}
}
test/sun/java2d/pipe/RegionOps.java
浏览文件 @
dc0440a8
此差异已折叠。
点击以展开。
test/sun/security/krb5/auto/BadKdc1.java
浏览文件 @
dc0440a8
此差异已折叠。
点击以展开。
test/sun/security/krb5/auto/BadKdc2.java
浏览文件 @
dc0440a8
此差异已折叠。
点击以展开。
test/sun/security/krb5/auto/BadKdc3.java
浏览文件 @
dc0440a8
此差异已折叠。
点击以展开。
test/sun/security/krb5/auto/BadKdc4.java
浏览文件 @
dc0440a8
此差异已折叠。
点击以展开。
test/sun/security/krb5/auto/CleanState.java
浏览文件 @
dc0440a8
此差异已折叠。
点击以展开。
test/sun/security/krb5/auto/CrossRealm.java
浏览文件 @
dc0440a8
此差异已折叠。
点击以展开。
test/sun/security/krb5/auto/HttpNegotiateServer.java
浏览文件 @
dc0440a8
此差异已折叠。
点击以展开。
test/sun/security/krb5/auto/IgnoreChannelBinding.java
浏览文件 @
dc0440a8
此差异已折叠。
点击以展开。
test/sun/security/krb5/auto/KerberosHashEqualsTest.java
浏览文件 @
dc0440a8
此差异已折叠。
点击以展开。
test/sun/security/krb5/auto/LifeTimeInSeconds.java
浏览文件 @
dc0440a8
此差异已折叠。
点击以展开。
test/sun/security/krb5/auto/LoginModuleOptions.java
浏览文件 @
dc0440a8
此差异已折叠。
点击以展开。
test/sun/security/krb5/auto/MaxRetries.java
浏览文件 @
dc0440a8
此差异已折叠。
点击以展开。
test/sun/security/krb5/auto/MoreKvno.java
浏览文件 @
dc0440a8
此差异已折叠。
点击以展开。
test/sun/security/krb5/auto/NewSalt.java
浏览文件 @
dc0440a8
此差异已折叠。
点击以展开。
test/sun/security/krb5/auto/NonMutualSpnego.java
浏览文件 @
dc0440a8
此差异已折叠。
点击以展开。
test/sun/security/krb5/auto/SSL.java
浏览文件 @
dc0440a8
此差异已折叠。
点击以展开。
test/sun/security/krb5/auto/SpnegoReqFlags.java
浏览文件 @
dc0440a8
此差异已折叠。
点击以展开。
test/sun/security/krb5/auto/Test5653.java
浏览文件 @
dc0440a8
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录