--- a/.hgtags-top-repo Thu Sep 01 13:54:50 2011 -0700
+++ b/.hgtags-top-repo Wed Jul 05 17:49:56 2017 +0200
@@ -124,3 +124,4 @@
d91364304d7c4ecd34caffdba2b840aeb0d10b51 jdk7-b147
f42e3d9394b40a423d345b8da22687b5462e5f25 jdk8-b01
69f592185747226a9c765a9fe139c1d34d616f9c jdk8-b02
+587bb549dff83131b65f40aa51864f69562f34a7 jdk8-b03
--- a/corba/.hgtags Thu Sep 01 13:54:50 2011 -0700
+++ b/corba/.hgtags Wed Jul 05 17:49:56 2017 +0200
@@ -124,3 +124,4 @@
73323cb3396260d93e0ab731fd2d431096ceed0f jdk7-b147
949fb60ca830364571e7c4c9964e6b351ca929ec jdk8-b01
ed8d94519a87b4adac270c3eec9134ff1f62bff5 jdk8-b02
+cd0da00694fbce642db9be936d3e4909a71d911d jdk8-b03
--- a/hotspot/.hgtags Thu Sep 01 13:54:50 2011 -0700
+++ b/hotspot/.hgtags Wed Jul 05 17:49:56 2017 +0200
@@ -176,3 +176,4 @@
c149193c768b8b7233da4c3a3fdc0756b975848e jdk7-b143
0cc8a70952c368e06de2adab1f2649a408f5e577 jdk8-b01
31e253c1da429124bb87570ab095d9bc89850d0a jdk8-b02
+3a2fb61165dfc72e398179a2796d740c8da5b8c0 jdk8-b03
--- a/jaxp/.hgtags Thu Sep 01 13:54:50 2011 -0700
+++ b/jaxp/.hgtags Wed Jul 05 17:49:56 2017 +0200
@@ -124,3 +124,4 @@
fc268cd1dd5d2e903ccd4b0275e1f9c2461ed30c jdk7-b147
4f0fcb812767594fe9de509f946b56942db5a2f0 jdk8-b01
ca4d6ad55a660f0469882e85b4dacf7822d50abf jdk8-b02
+7a74371ce0c64108b857c497ae130dfe9514532c jdk8-b03
--- a/jaxws/.hgtags Thu Sep 01 13:54:50 2011 -0700
+++ b/jaxws/.hgtags Wed Jul 05 17:49:56 2017 +0200
@@ -124,3 +124,4 @@
d13b1f877bb5ed8dceb2f7ec10365d1db5f70b2d jdk7-b147
64df57a1edeca74388bd62f0a87d056db981fbdf jdk8-b01
1034127ed402e9d0f1ed1477238ef594e9cc8da6 jdk8-b02
+7dcb0307508f408507d878cd7c2048c102b15158 jdk8-b03
--- a/jdk/.hgtags Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/.hgtags Wed Jul 05 17:49:56 2017 +0200
@@ -124,3 +124,4 @@
f097ca2434b1412b12ab4a5c2397ce271bf681e7 jdk7-b147
2cdbbc4a63592be7f1556fffe37b1253a77bd481 jdk8-b01
13e70aa1398eb959c54bc68b783ca0eef1286ad2 jdk8-b02
+7989ee9fe673a87f4db3917fa6a005732a6a9b85 jdk8-b03
--- a/jdk/make/com/oracle/Makefile Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/make/com/oracle/Makefile Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# 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
@@ -27,8 +27,13 @@
PRODUCT = oracle
include $(BUILDDIR)/common/Defs.gmk
-SUBDIRS = net
-include $(BUILDDIR)/common/Subdirs.gmk
+#
+# Files to compile
+#
+AUTO_FILES_JAVA_DIRS = com/oracle
-all build clean clobber::
- $(SUBDIRS-loop)
+#
+# Rules
+#
+include $(BUILDDIR)/common/Classes.gmk
+
--- a/jdk/make/com/oracle/net/Makefile Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-#
-# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation. Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-BUILDDIR = ../../..
-PRODUCT = oracle
-include $(BUILDDIR)/common/Defs.gmk
-
-#
-# Files to compile
-#
-AUTO_FILES_JAVA_DIRS = com/oracle/net
-
-#
-# Rules
-#
-include $(BUILDDIR)/common/Classes.gmk
-
--- a/jdk/make/com/sun/crypto/provider/Makefile Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/make/com/sun/crypto/provider/Makefile Wed Jul 05 17:49:56 2017 +0200
@@ -113,6 +113,9 @@
endif
endif
+JAVAC_MAX_WARNINGS = false
+JAVAC_LINT_OPTIONS = -Xlint:all,-deprecation
+JAVAC_WARNINGS_FATAL = true
include $(BUILDDIR)/common/Defs.gmk
#
--- a/jdk/make/com/sun/jndi/Makefile Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/make/com/sun/jndi/Makefile Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 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
@@ -28,6 +28,8 @@
#
BUILDDIR = ../../..
+SUBDIRS_MAKEFLAGS += JAVAC_MAX_WARNINGS=true
+SUBDIRS_MAKEFLAGS += JAVAC_WARNINGS_FATAL=true
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = toolkit cosnaming ldap rmi dns
--- a/jdk/make/com/sun/security/Makefile Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/make/com/sun/security/Makefile Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 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
@@ -28,6 +28,10 @@
#
BUILDDIR = ../../..
+SUBDIRS_MAKEFLAGS += JAVAC_MAX_WARNINGS=false
+# TODO: Workaround for CR 7063027. Remove -path eventually.
+SUBDIRS_MAKEFLAGS += JAVAC_LINT_OPTIONS=-Xlint:all,-deprecation,-path
+SUBDIRS_MAKEFLAGS += JAVAC_WARNINGS_FATAL=true
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = auth
--- a/jdk/make/common/Release.gmk Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/make/common/Release.gmk Wed Jul 05 17:49:56 2017 +0200
@@ -60,7 +60,8 @@
# with a new module system (being discussed for JDK 8).
#
EXPORTED_PRIVATE_PKGS = com.sun.servicetag \
- com.oracle.net
+ com.oracle.net \
+ com.oracle.nio
# 64-bit solaris has a few special cases. We define the variable
# SOLARIS64 for use in this Makefile to easily test those cases
--- a/jdk/make/java/java/Makefile Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/make/java/java/Makefile Wed Jul 05 17:49:56 2017 +0200
@@ -34,6 +34,7 @@
PRODUCT = java
SUBDIRS_MAKEFLAGS += JAVAC_MAX_WARNINGS=true
SUBDIRS_MAKEFLAGS += JAVAC_WARNINGS_FATAL=true
+JAVAC_MAX_WARNINGS=true
include $(BUILDDIR)/common/Defs.gmk
# windows compiler flags
--- a/jdk/make/java/security/Makefile Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/make/java/security/Makefile Wed Jul 05 17:49:56 2017 +0200
@@ -26,6 +26,9 @@
BUILDDIR = ../..
PACKAGE = java.security
PRODUCT = sun
+JAVAC_MAX_WARNINGS = false
+JAVAC_LINT_OPTIONS = -Xlint:all,-deprecation
+JAVAC_WARNINGS_FATAL = true
include $(BUILDDIR)/common/Defs.gmk
#
--- a/jdk/make/java/sun_nio/FILES_java.gmk Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/make/java/sun_nio/FILES_java.gmk Wed Jul 05 17:49:56 2017 +0200
@@ -76,63 +76,3 @@
sun/nio/cs/UTF_32BE_BOM.java \
sun/nio/cs/UTF_32LE_BOM.java
-
-FILES_java += \
- sun/io/Converters.java \
- sun/io/ByteToCharConverter.java \
- sun/io/ByteToCharASCII.java \
- sun/io/ByteToCharUTF8.java \
- sun/io/ByteToCharUTF16.java \
- sun/io/ByteToCharUnicode.java \
- sun/io/ByteToCharUnicodeBig.java \
- sun/io/ByteToCharUnicodeBigUnmarked.java \
- sun/io/ByteToCharUnicodeLittle.java \
- sun/io/ByteToCharUnicodeLittleUnmarked.java \
- sun/io/CharToByteConverter.java \
- sun/io/CharToByteASCII.java \
- sun/io/CharToByteUTF8.java \
- sun/io/CharToByteUTF16.java \
- sun/io/CharToByteUnicode.java \
- sun/io/CharToByteUnicodeBig.java \
- sun/io/CharToByteUnicodeBigUnmarked.java \
- sun/io/CharToByteUnicodeLittle.java \
- sun/io/CharToByteUnicodeLittleUnmarked.java \
- sun/io/CharacterEncoding.java \
- sun/io/ConversionBufferFullException.java \
- sun/io/MalformedInputException.java \
- sun/io/UnknownCharacterException.java \
- sun/io/ByteToCharISO8859_1.java \
- sun/io/CharToByteISO8859_1.java \
- sun/io/ByteToCharISO8859_2.java \
- sun/io/CharToByteISO8859_2.java \
- sun/io/ByteToCharISO8859_4.java \
- sun/io/CharToByteISO8859_4.java \
- sun/io/ByteToCharISO8859_5.java \
- sun/io/CharToByteISO8859_5.java \
- sun/io/ByteToCharISO8859_7.java \
- sun/io/CharToByteISO8859_7.java \
- sun/io/ByteToCharISO8859_9.java \
- sun/io/CharToByteISO8859_9.java \
- sun/io/ByteToCharISO8859_13.java \
- sun/io/CharToByteISO8859_13.java \
- sun/io/ByteToCharISO8859_15.java \
- sun/io/CharToByteISO8859_15.java \
- sun/io/ByteToCharCp1250.java \
- sun/io/CharToByteCp1250.java \
- sun/io/ByteToCharCp1251.java \
- sun/io/CharToByteCp1251.java \
- sun/io/ByteToCharCp1252.java \
- sun/io/CharToByteCp1252.java \
- sun/io/ByteToCharCp1253.java \
- sun/io/CharToByteCp1253.java \
- sun/io/ByteToCharCp1254.java \
- sun/io/CharToByteCp1254.java \
- sun/io/ByteToCharCp1257.java \
- sun/io/CharToByteCp1257.java \
- sun/io/ByteToCharKOI8_R.java \
- sun/io/CharToByteKOI8_R.java \
- sun/io/ByteToCharSingleByte.java \
- sun/io/CharToByteSingleByte.java
-
-
-
--- a/jdk/make/java/sun_nio/Makefile Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/make/java/sun_nio/Makefile Wed Jul 05 17:49:56 2017 +0200
@@ -31,8 +31,7 @@
PACKAGE = sun.nio
PRODUCT = sun
-JAVAC_MAX_WARNINGS = false
-JAVAC_LINT_OPTIONS = -Xlint:all,-deprecation
+JAVAC_MAX_WARNINGS = true
JAVAC_WARNINGS_FATAL = true
include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/javax/crypto/Makefile Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/make/javax/crypto/Makefile Wed Jul 05 17:49:56 2017 +0200
@@ -128,6 +128,8 @@
endif
endif
+JAVAC_MAX_WARNINGS = true
+JAVAC_WARNINGS_FATAL = true
include $(BUILDDIR)/common/Defs.gmk
#
--- a/jdk/make/javax/others/Makefile Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/make/javax/others/Makefile Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 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
@@ -28,6 +28,7 @@
#
BUILDDIR = ../..
+JAVAC_MAX_WARNINGS = true
include $(BUILDDIR)/common/Defs.gmk
#
--- a/jdk/make/sun/nio/cs/FILES_java.gmk Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/make/sun/nio/cs/FILES_java.gmk Wed Jul 05 17:49:56 2017 +0200
@@ -29,277 +29,6 @@
# Core character converters are built from make/java/java.
#
-FILES_src = \
- sun/io/ByteToCharDoubleByte.java \
- sun/io/ByteToCharDBCS_ASCII.java \
- sun/io/ByteToCharDBCS_EBCDIC.java \
- sun/io/ByteToCharEUC.java \
- sun/io/CharToByteDoubleByte.java \
- sun/io/CharToByteDBCS_ASCII.java \
- sun/io/CharToByteDBCS_EBCDIC.java \
- sun/io/CharToByteEUC.java \
- sun/io/ByteToCharBig5.java \
- sun/io/ByteToCharBig5_Solaris.java \
- sun/io/ByteToCharBig5_HKSCS.java \
- sun/io/ByteToCharMS950_HKSCS.java \
- sun/io/ByteToCharGB18030.java \
- sun/io/ByteToCharGB18030DB.java \
- sun/io/ByteToCharCp037.java \
- sun/io/ByteToCharCp1006.java \
- sun/io/ByteToCharCp1025.java \
- sun/io/ByteToCharCp1026.java \
- sun/io/ByteToCharCp1046.java \
- sun/io/ByteToCharCp1047.java \
- sun/io/ByteToCharCp1097.java \
- sun/io/ByteToCharCp1098.java \
- sun/io/ByteToCharCp1112.java \
- sun/io/ByteToCharCp1122.java \
- sun/io/ByteToCharCp1123.java \
- sun/io/ByteToCharCp1124.java \
- sun/io/ByteToCharCp1140.java \
- sun/io/ByteToCharCp1141.java \
- sun/io/ByteToCharCp1142.java \
- sun/io/ByteToCharCp1143.java \
- sun/io/ByteToCharCp1144.java \
- sun/io/ByteToCharCp1145.java \
- sun/io/ByteToCharCp1146.java \
- sun/io/ByteToCharCp1147.java \
- sun/io/ByteToCharCp1148.java \
- sun/io/ByteToCharCp1149.java \
- sun/io/ByteToCharCp1255.java \
- sun/io/ByteToCharCp1256.java \
- sun/io/ByteToCharCp1258.java \
- sun/io/ByteToCharCp1381.java \
- sun/io/ByteToCharCp1383.java \
- sun/io/ByteToCharCp273.java \
- sun/io/ByteToCharCp277.java \
- sun/io/ByteToCharCp278.java \
- sun/io/ByteToCharCp280.java \
- sun/io/ByteToCharCp284.java \
- sun/io/ByteToCharCp285.java \
- sun/io/ByteToCharCp297.java \
- sun/io/ByteToCharCp33722.java \
- sun/io/ByteToCharCp420.java \
- sun/io/ByteToCharCp424.java \
- sun/io/ByteToCharCp437.java \
- sun/io/ByteToCharCp500.java \
- sun/io/ByteToCharCp737.java \
- sun/io/ByteToCharCp775.java \
- sun/io/ByteToCharCp833.java \
- sun/io/ByteToCharCp834.java \
- sun/io/ByteToCharCp838.java \
- sun/io/ByteToCharCp850.java \
- sun/io/ByteToCharCp852.java \
- sun/io/ByteToCharCp855.java \
- sun/io/ByteToCharCp856.java \
- sun/io/ByteToCharCp857.java \
- sun/io/ByteToCharCp858.java \
- sun/io/ByteToCharCp860.java \
- sun/io/ByteToCharCp861.java \
- sun/io/ByteToCharCp862.java \
- sun/io/ByteToCharCp863.java \
- sun/io/ByteToCharCp864.java \
- sun/io/ByteToCharCp865.java \
- sun/io/ByteToCharCp866.java \
- sun/io/ByteToCharCp868.java \
- sun/io/ByteToCharCp869.java \
- sun/io/ByteToCharCp870.java \
- sun/io/ByteToCharCp871.java \
- sun/io/ByteToCharCp874.java \
- sun/io/ByteToCharCp875.java \
- sun/io/ByteToCharCp918.java \
- sun/io/ByteToCharCp921.java \
- sun/io/ByteToCharCp922.java \
- sun/io/ByteToCharCp930.java \
- sun/io/ByteToCharCp933.java \
- sun/io/ByteToCharCp935.java \
- sun/io/ByteToCharCp937.java \
- sun/io/ByteToCharCp939.java \
- sun/io/ByteToCharCp942.java \
- sun/io/ByteToCharCp942C.java \
- sun/io/ByteToCharCp943.java \
- sun/io/ByteToCharCp943C.java \
- sun/io/ByteToCharCp948.java \
- sun/io/ByteToCharCp949.java \
- sun/io/ByteToCharCp949C.java \
- sun/io/ByteToCharCp950.java \
- sun/io/ByteToCharCp964.java \
- sun/io/ByteToCharCp970.java \
- sun/io/ByteToCharJIS0201.java \
- sun/io/ByteToCharJIS0208.java \
- sun/io/ByteToCharJIS0208_Solaris.java \
- sun/io/ByteToCharJIS0212.java \
- sun/io/ByteToCharJIS0212_Solaris.java \
- sun/io/ByteToCharEUC_CN.java \
- sun/io/ByteToCharEUC_JP.java \
- sun/io/ByteToCharEUC_JP_LINUX.java \
- sun/io/ByteToCharEUC_JP_Solaris.java \
- sun/io/ByteToCharEUC_KR.java \
- sun/io/ByteToCharEUC_TW.java \
- sun/io/ByteToCharSJIS.java \
- sun/io/ByteToCharPCK.java \
- sun/io/ByteToCharGBK.java \
- sun/io/ByteToCharISCII91.java \
- sun/io/ByteToCharISO2022.java \
- sun/io/ByteToCharISO2022CN.java \
- sun/io/ByteToCharISO2022JP.java \
- sun/io/ByteToCharISO2022KR.java \
- sun/io/ByteToCharISO8859_3.java \
- sun/io/ByteToCharISO8859_6.java \
- sun/io/ByteToCharISO8859_8.java \
- sun/io/ByteToCharJISAutoDetect.java \
- sun/io/ByteToCharJohab.java \
- sun/io/ByteToCharMS874.java \
- sun/io/ByteToCharMS932.java \
- sun/io/ByteToCharMS936.java \
- sun/io/ByteToCharMS949.java \
- sun/io/ByteToCharMS950.java \
- sun/io/ByteToCharMacArabic.java \
- sun/io/ByteToCharMacCentralEurope.java \
- sun/io/ByteToCharMacCroatian.java \
- sun/io/ByteToCharMacCyrillic.java \
- sun/io/ByteToCharMacDingbat.java \
- sun/io/ByteToCharMacGreek.java \
- sun/io/ByteToCharMacHebrew.java \
- sun/io/ByteToCharMacIceland.java \
- sun/io/ByteToCharMacRoman.java \
- sun/io/ByteToCharMacRomania.java \
- sun/io/ByteToCharMacSymbol.java \
- sun/io/ByteToCharMacThai.java \
- sun/io/ByteToCharMacTurkish.java \
- sun/io/ByteToCharMacUkraine.java \
- sun/io/ByteToCharTIS620.java \
- sun/io/CharToByteBig5.java \
- sun/io/CharToByteBig5_Solaris.java \
- sun/io/CharToByteBig5_HKSCS.java \
- sun/io/CharToByteMS950_HKSCS.java \
- sun/io/CharToByteGB18030.java \
- sun/io/CharToByteCp037.java \
- sun/io/CharToByteCp1006.java \
- sun/io/CharToByteCp1025.java \
- sun/io/CharToByteCp1026.java \
- sun/io/CharToByteCp1046.java \
- sun/io/CharToByteCp1047.java \
- sun/io/CharToByteCp1097.java \
- sun/io/CharToByteCp1098.java \
- sun/io/CharToByteCp1112.java \
- sun/io/CharToByteCp1122.java \
- sun/io/CharToByteCp1123.java \
- sun/io/CharToByteCp1124.java \
- sun/io/CharToByteCp1140.java \
- sun/io/CharToByteCp1141.java \
- sun/io/CharToByteCp1142.java \
- sun/io/CharToByteCp1143.java \
- sun/io/CharToByteCp1144.java \
- sun/io/CharToByteCp1145.java \
- sun/io/CharToByteCp1146.java \
- sun/io/CharToByteCp1147.java \
- sun/io/CharToByteCp1148.java \
- sun/io/CharToByteCp1149.java \
- sun/io/CharToByteCp1255.java \
- sun/io/CharToByteCp1256.java \
- sun/io/CharToByteCp1258.java \
- sun/io/CharToByteCp1381.java \
- sun/io/CharToByteCp1383.java \
- sun/io/CharToByteCp273.java \
- sun/io/CharToByteCp277.java \
- sun/io/CharToByteCp278.java \
- sun/io/CharToByteCp280.java \
- sun/io/CharToByteCp284.java \
- sun/io/CharToByteCp285.java \
- sun/io/CharToByteCp297.java \
- sun/io/CharToByteCp33722.java \
- sun/io/CharToByteCp420.java \
- sun/io/CharToByteCp424.java \
- sun/io/CharToByteCp437.java \
- sun/io/CharToByteCp500.java \
- sun/io/CharToByteCp737.java \
- sun/io/CharToByteCp775.java \
- sun/io/CharToByteCp833.java \
- sun/io/CharToByteCp834.java \
- sun/io/CharToByteCp838.java \
- sun/io/CharToByteCp850.java \
- sun/io/CharToByteCp852.java \
- sun/io/CharToByteCp855.java \
- sun/io/CharToByteCp856.java \
- sun/io/CharToByteCp857.java \
- sun/io/CharToByteCp858.java \
- sun/io/CharToByteCp860.java \
- sun/io/CharToByteCp861.java \
- sun/io/CharToByteCp862.java \
- sun/io/CharToByteCp863.java \
- sun/io/CharToByteCp864.java \
- sun/io/CharToByteCp865.java \
- sun/io/CharToByteCp866.java \
- sun/io/CharToByteCp868.java \
- sun/io/CharToByteCp869.java \
- sun/io/CharToByteCp870.java \
- sun/io/CharToByteCp871.java \
- sun/io/CharToByteCp874.java \
- sun/io/CharToByteCp875.java \
- sun/io/CharToByteCp918.java \
- sun/io/CharToByteCp921.java \
- sun/io/CharToByteCp922.java \
- sun/io/CharToByteCp930.java \
- sun/io/CharToByteCp933.java \
- sun/io/CharToByteCp935.java \
- sun/io/CharToByteCp937.java \
- sun/io/CharToByteCp939.java \
- sun/io/CharToByteCp942.java \
- sun/io/CharToByteCp942C.java \
- sun/io/CharToByteCp943.java \
- sun/io/CharToByteCp943C.java \
- sun/io/CharToByteCp948.java \
- sun/io/CharToByteCp949.java \
- sun/io/CharToByteCp949C.java \
- sun/io/CharToByteCp950.java \
- sun/io/CharToByteCp964.java \
- sun/io/CharToByteCp970.java \
- sun/io/CharToByteJIS0201.java \
- sun/io/CharToByteJIS0208.java \
- sun/io/CharToByteJIS0208_Solaris.java \
- sun/io/CharToByteJIS0212.java \
- sun/io/CharToByteJIS0212_Solaris.java \
- sun/io/CharToByteEUC_CN.java \
- sun/io/CharToByteEUC_JP.java \
- sun/io/CharToByteEUC_JP_LINUX.java \
- sun/io/CharToByteEUC_JP_Solaris.java \
- sun/io/CharToByteEUC_KR.java \
- sun/io/CharToByteEUC_TW.java \
- sun/io/CharToByteSJIS.java \
- sun/io/CharToBytePCK.java \
- sun/io/CharToByteGBK.java \
- sun/io/CharToByteISCII91.java \
- sun/io/CharToByteISO2022.java \
- sun/io/CharToByteISO2022CN_CNS.java \
- sun/io/CharToByteISO2022CN_GB.java \
- sun/io/CharToByteISO2022JP.java \
- sun/io/CharToByteISO2022KR.java \
- sun/io/CharToByteISO8859_3.java \
- sun/io/CharToByteISO8859_6.java \
- sun/io/CharToByteISO8859_8.java \
- sun/io/CharToByteJohab.java \
- sun/io/CharToByteMS874.java \
- sun/io/CharToByteMS932.java \
- sun/io/CharToByteMS936.java \
- sun/io/CharToByteMS949.java \
- sun/io/CharToByteMS950.java \
- sun/io/CharToByteMacArabic.java \
- sun/io/CharToByteMacCentralEurope.java \
- sun/io/CharToByteMacCroatian.java \
- sun/io/CharToByteMacCyrillic.java \
- sun/io/CharToByteMacDingbat.java \
- sun/io/CharToByteMacGreek.java \
- sun/io/CharToByteMacHebrew.java \
- sun/io/CharToByteMacIceland.java \
- sun/io/CharToByteMacRoman.java \
- sun/io/CharToByteMacRomania.java \
- sun/io/CharToByteMacSymbol.java \
- sun/io/CharToByteMacThai.java \
- sun/io/CharToByteMacTurkish.java \
- sun/io/CharToByteMacUkraine.java \
- sun/io/CharToByteTIS620.java
-
FILES_gen_extcs = \
sun/nio/cs/ext/IBM037.java \
sun/nio/cs/ext/IBM1006.java \
--- a/jdk/make/sun/security/Makefile Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/make/sun/security/Makefile Wed Jul 05 17:49:56 2017 +0200
@@ -34,6 +34,8 @@
#
BUILDDIR = ../..
+SUBDIRS_MAKEFLAGS += JAVAC_MAX_WARNINGS=true
+SUBDIRS_MAKEFLAGS += JAVAC_WARNINGS_FATAL=true
include $(BUILDDIR)/common/Defs.gmk
# build sun/security/jgss/wrapper on non-windows platform
--- a/jdk/make/sun/security/ec/Makefile Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/make/sun/security/ec/Makefile Wed Jul 05 17:49:56 2017 +0200
@@ -109,6 +109,9 @@
endif
endif
+JAVAC_MAX_WARNINGS=false
+JAVAC_LINT_OPTIONS=-Xlint:all,-deprecation
+JAVAC_WARNINGS_FATAL=true
include $(BUILDDIR)/common/Defs.gmk
#
--- a/jdk/make/sun/security/other/Makefile Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/make/sun/security/other/Makefile Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1996, 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1996, 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
@@ -26,6 +26,9 @@
BUILDDIR = ../../..
PACKAGE = sun.security.other
PRODUCT = sun
+JAVAC_MAX_WARNINGS=false
+JAVAC_LINT_OPTIONS=-Xlint:all,-deprecation
+JAVAC_WARNINGS_FATAL=true
include $(BUILDDIR)/common/Defs.gmk
#
--- a/jdk/make/sun/security/pkcs11/Makefile Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/make/sun/security/pkcs11/Makefile Wed Jul 05 17:49:56 2017 +0200
@@ -110,6 +110,9 @@
endif
endif
+JAVAC_MAX_WARNINGS=false
+JAVAC_LINT_OPTIONS=-Xlint:all,-deprecation
+JAVAC_WARNINGS_FATAL=true
include $(BUILDDIR)/common/Defs.gmk
#
--- a/jdk/make/tools/CharsetMapping/SingleByte-X.java.template Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/make/tools/CharsetMapping/SingleByte-X.java.template Wed Jul 05 17:49:56 2017 +0200
@@ -55,18 +55,6 @@
return new SingleByte.Encoder(this, c2b, c2bIndex);
}
- public String getDecoderSingleByteMappings() {
- return b2cTable;
- }
-
- public char[] getEncoderIndex2() {
- return c2b;
- }
-
- public char[] getEncoderIndex1() {
- return c2bIndex;
- }
-
private final static String b2cTable = $B2CTABLE$
private final static char[] b2c = b2cTable.toCharArray();
--- a/jdk/src/share/classes/com/sun/crypto/provider/AESCrypt.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/AESCrypt.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2010, 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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -245,7 +245,7 @@
for (j = 0; j < 8; j++) {
tmp = AA[i][j];
AA[i][j] = AA[t][j];
- AA[t][j] = (byte) tmp;
+ AA[t][j] = tmp;
}
pivot = AA[i][i];
}
--- a/jdk/src/share/classes/com/sun/crypto/provider/AESParameters.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/AESParameters.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2007, 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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,13 +25,10 @@
package com.sun.crypto.provider;
-import java.util.*;
import java.io.*;
-import sun.security.util.*;
import java.security.AlgorithmParametersSpi;
import java.security.spec.AlgorithmParameterSpec;
import java.security.spec.InvalidParameterSpecException;
-import javax.crypto.spec.IvParameterSpec;
/**
* This class implements the parameter (IV) used with the AES algorithm
@@ -67,9 +64,15 @@
core.init(encoded, decodingMethod);
}
- protected AlgorithmParameterSpec engineGetParameterSpec(Class paramSpec)
+ protected <T extends AlgorithmParameterSpec>
+ T engineGetParameterSpec(Class<T> paramSpec)
throws InvalidParameterSpecException {
- return core.getParameterSpec(paramSpec);
+ if (AlgorithmParameterSpec.class.isAssignableFrom(paramSpec)) {
+ return core.getParameterSpec(paramSpec);
+ } else {
+ throw new InvalidParameterSpecException
+ ("Inappropriate parameter Specification");
+ }
}
protected byte[] engineGetEncoded() throws IOException {
--- a/jdk/src/share/classes/com/sun/crypto/provider/BlockCipherParamsCore.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/BlockCipherParamsCore.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2007, 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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,6 @@
package com.sun.crypto.provider;
-import java.util.*;
import java.io.*;
import sun.security.util.*;
import sun.misc.HexDumpEncoder;
@@ -64,7 +63,7 @@
throw new InvalidParameterSpecException("IV not " +
block_size + " bytes long");
}
- iv = (byte[]) tmpIv.clone();
+ iv = tmpIv.clone();
}
void init(byte[] encoded) throws IOException {
@@ -90,11 +89,11 @@
init(encoded);
}
- AlgorithmParameterSpec getParameterSpec(Class paramSpec)
+ <T extends AlgorithmParameterSpec> T getParameterSpec(Class<T> paramSpec)
throws InvalidParameterSpecException
{
if (IvParameterSpec.class.isAssignableFrom(paramSpec)) {
- return new IvParameterSpec(this.iv);
+ return paramSpec.cast(new IvParameterSpec(this.iv));
} else {
throw new InvalidParameterSpecException
("Inappropriate parameter specification");
--- a/jdk/src/share/classes/com/sun/crypto/provider/BlowfishParameters.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/BlowfishParameters.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -25,13 +25,10 @@
package com.sun.crypto.provider;
-import java.util.*;
import java.io.*;
-import sun.security.util.*;
import java.security.AlgorithmParametersSpi;
import java.security.spec.AlgorithmParameterSpec;
import java.security.spec.InvalidParameterSpecException;
-import javax.crypto.spec.IvParameterSpec;
/**
* This class implements the parameter (IV) used with the Blowfish algorithm in
@@ -68,9 +65,15 @@
core.init(encoded, decodingMethod);
}
- protected AlgorithmParameterSpec engineGetParameterSpec(Class paramSpec)
+ protected <T extends AlgorithmParameterSpec>
+ T engineGetParameterSpec(Class<T> paramSpec)
throws InvalidParameterSpecException {
- return core.getParameterSpec(paramSpec);
+ if (AlgorithmParameterSpec.class.isAssignableFrom(paramSpec)) {
+ return core.getParameterSpec(paramSpec);
+ } else {
+ throw new InvalidParameterSpecException
+ ("Inappropriate parameter Specification");
+ }
}
protected byte[] engineGetEncoded() throws IOException {
--- a/jdk/src/share/classes/com/sun/crypto/provider/CipherBlockChaining.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/CipherBlockChaining.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -193,7 +193,7 @@
// This is necessary because in this constellation, a
// ciphertext block (or parts of it) will be overridden by
// the plaintext result.
- cipherOrig = (byte[])cipher.clone();
+ cipherOrig = cipher.clone();
}
for (; cipherOffset < endIndex;
--- a/jdk/src/share/classes/com/sun/crypto/provider/CipherCore.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/CipherCore.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2007, 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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -301,7 +301,7 @@
*/
byte[] getIV() {
byte[] iv = cipher.getIV();
- return (iv == null) ? null : (byte[])iv.clone();
+ return (iv == null) ? null : iv.clone();
}
/**
@@ -475,8 +475,7 @@
IvParameterSpec ivSpec = null;
if (params != null) {
try {
- ivSpec = (IvParameterSpec)params.getParameterSpec
- (IvParameterSpec.class);
+ ivSpec = params.getParameterSpec(IvParameterSpec.class);
} catch (InvalidParameterSpecException ipse) {
throw new InvalidAlgorithmParameterException("Wrong parameter "
+ "type: IV "
@@ -832,7 +831,7 @@
buffered = 0;
diffBlocksize = blockSize;
if (cipherMode != ECB_MODE) {
- ((FeedbackCipher)cipher).reset();
+ cipher.reset();
}
return totalLen;
}
--- a/jdk/src/share/classes/com/sun/crypto/provider/DESCrypt.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/DESCrypt.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -622,17 +622,17 @@
// mangler function:
// every 6 bit is fed into the sbox, which
// produces 4-bit output
- left ^= s0p[(int)((temp & 0x3f) ^ key[j+0])]
- ^ s1p[(int)(((temp >> 4) & 0x3f) ^ key[j+1])]
- ^ s2p[(int)(((temp >> 8) & 0x3f) ^ key[j+2])]
- ^ s3p[(int)(((temp >> 12) & 0x3f) ^ key[j+3])]
- ^ s4p[(int)(((temp >> 16) & 0x3f) ^ key[j+4])]
- ^ s5p[(int)(((temp >> 20) & 0x3f) ^ key[j+5])]
- ^ s6p[(int)(((temp >> 24) & 0x3f) ^ key[j+6])];
+ left ^= s0p[(temp & 0x3f) ^ key[j+0]]
+ ^ s1p[((temp >> 4) & 0x3f) ^ key[j+1]]
+ ^ s2p[((temp >> 8) & 0x3f) ^ key[j+2]]
+ ^ s3p[((temp >> 12) & 0x3f) ^ key[j+3]]
+ ^ s4p[((temp >> 16) & 0x3f) ^ key[j+4]]
+ ^ s5p[((temp >> 20) & 0x3f) ^ key[j+5]]
+ ^ s6p[((temp >> 24) & 0x3f) ^ key[j+6]];
// make the last sbox input the last bit from right[0]
temp = ((right & 1) << 5) | ((right >> 27) & 0x1f);
- left ^= s7p[(int)(temp ^ key[j+7])];
+ left ^= s7p[temp ^ key[j+7]];
temp = left;
left = right;
right = temp;
--- a/jdk/src/share/classes/com/sun/crypto/provider/DESKey.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/DESKey.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -78,7 +78,7 @@
public byte[] getEncoded() {
// Return a copy of the key, rather than a reference,
// so that the key data cannot be modified from outside
- return (byte[])this.key.clone();
+ return this.key.clone();
}
public String getAlgorithm() {
@@ -126,7 +126,7 @@
throws java.io.IOException, ClassNotFoundException
{
s.defaultReadObject();
- key = (byte[])key.clone();
+ key = key.clone();
}
/**
--- a/jdk/src/share/classes/com/sun/crypto/provider/DESKeyFactory.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/DESKeyFactory.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -92,7 +92,7 @@
* inappropriate for the given key, or the given key cannot be processed
* (e.g., the given key has an unrecognized algorithm or format).
*/
- protected KeySpec engineGetKeySpec(SecretKey key, Class keySpec)
+ protected KeySpec engineGetKeySpec(SecretKey key, Class<?> keySpec)
throws InvalidKeySpecException {
try {
--- a/jdk/src/share/classes/com/sun/crypto/provider/DESParameters.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/DESParameters.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -25,13 +25,10 @@
package com.sun.crypto.provider;
-import java.util.*;
import java.io.*;
-import sun.security.util.*;
import java.security.AlgorithmParametersSpi;
import java.security.spec.AlgorithmParameterSpec;
import java.security.spec.InvalidParameterSpecException;
-import javax.crypto.spec.IvParameterSpec;
/**
* This class implements the parameter (IV) used with the DES algorithm in
@@ -68,9 +65,15 @@
core.init(encoded, decodingMethod);
}
- protected AlgorithmParameterSpec engineGetParameterSpec(Class paramSpec)
+ protected <T extends AlgorithmParameterSpec>
+ T engineGetParameterSpec(Class<T> paramSpec)
throws InvalidParameterSpecException {
- return core.getParameterSpec(paramSpec);
+ if (AlgorithmParameterSpec.class.isAssignableFrom(paramSpec)) {
+ return core.getParameterSpec(paramSpec);
+ } else {
+ throw new InvalidParameterSpecException
+ ("Inappropriate parameter Specification");
+ }
}
protected byte[] engineGetEncoded() throws IOException {
--- a/jdk/src/share/classes/com/sun/crypto/provider/DESedeKey.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/DESedeKey.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -78,7 +78,7 @@
}
public byte[] getEncoded() {
- return (byte[])this.key.clone();
+ return this.key.clone();
}
public String getAlgorithm() {
@@ -127,7 +127,7 @@
throws java.io.IOException, ClassNotFoundException
{
s.defaultReadObject();
- key = (byte[])key.clone();
+ key = key.clone();
}
/**
--- a/jdk/src/share/classes/com/sun/crypto/provider/DESedeKeyFactory.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/DESedeKeyFactory.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -92,7 +92,7 @@
* inappropriate for the given key, or the given key cannot be processed
* (e.g., the given key has an unrecognized algorithm or format).
*/
- protected KeySpec engineGetKeySpec(SecretKey key, Class keySpec)
+ protected KeySpec engineGetKeySpec(SecretKey key, Class<?> keySpec)
throws InvalidKeySpecException {
try {
--- a/jdk/src/share/classes/com/sun/crypto/provider/DESedeParameters.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/DESedeParameters.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -25,13 +25,10 @@
package com.sun.crypto.provider;
-import java.util.*;
import java.io.*;
-import sun.security.util.*;
import java.security.AlgorithmParametersSpi;
import java.security.spec.AlgorithmParameterSpec;
import java.security.spec.InvalidParameterSpecException;
-import javax.crypto.spec.IvParameterSpec;
/**
* This class implements the parameter (IV) used with the Triple DES algorithm
@@ -67,9 +64,15 @@
core.init(encoded, decodingMethod);
}
- protected AlgorithmParameterSpec engineGetParameterSpec(Class paramSpec)
+ protected <T extends AlgorithmParameterSpec>
+ T engineGetParameterSpec(Class<T> paramSpec)
throws InvalidParameterSpecException {
- return core.getParameterSpec(paramSpec);
+ if (AlgorithmParameterSpec.class.isAssignableFrom(paramSpec)) {
+ return core.getParameterSpec(paramSpec);
+ } else {
+ throw new InvalidParameterSpecException
+ ("Inappropriate parameter Specification");
+ }
}
protected byte[] engineGetEncoded() throws IOException {
--- a/jdk/src/share/classes/com/sun/crypto/provider/DESedeWrapCipher.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/DESedeWrapCipher.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2009, 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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,6 @@
package com.sun.crypto.provider;
-import java.util.Arrays;
import java.security.*;
import java.security.spec.*;
import javax.crypto.*;
@@ -151,7 +150,7 @@
* been set.
*/
protected byte[] engineGetIV() {
- return (iv == null? null:(byte[]) iv.clone());
+ return (iv == null) ? null : iv.clone();
}
/**
@@ -277,8 +276,7 @@
try {
DESedeParameters paramsEng = new DESedeParameters();
paramsEng.engineInit(params.getEncoded());
- ivSpec = (IvParameterSpec)
- paramsEng.engineGetParameterSpec(IvParameterSpec.class);
+ ivSpec = paramsEng.engineGetParameterSpec(IvParameterSpec.class);
} catch (Exception ex) {
InvalidAlgorithmParameterException iape =
new InvalidAlgorithmParameterException
--- a/jdk/src/share/classes/com/sun/crypto/provider/DHKeyFactory.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/DHKeyFactory.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -25,8 +25,6 @@
package com.sun.crypto.provider;
-import java.util.*;
-import java.lang.*;
import java.security.Key;
import java.security.PublicKey;
import java.security.PrivateKey;
@@ -140,7 +138,8 @@
* inappropriate for the given key, or the given key cannot be processed
* (e.g., the given key has an unrecognized algorithm or format).
*/
- protected KeySpec engineGetKeySpec(Key key, Class keySpec)
+ protected <T extends KeySpec>
+ T engineGetKeySpec(Key key, Class<T> keySpec)
throws InvalidKeySpecException {
DHParameterSpec params;
@@ -150,12 +149,12 @@
javax.crypto.interfaces.DHPublicKey dhPubKey
= (javax.crypto.interfaces.DHPublicKey) key;
params = dhPubKey.getParams();
- return new DHPublicKeySpec(dhPubKey.getY(),
- params.getP(),
- params.getG());
+ return keySpec.cast(new DHPublicKeySpec(dhPubKey.getY(),
+ params.getP(),
+ params.getG()));
} else if (X509EncodedKeySpec.class.isAssignableFrom(keySpec)) {
- return new X509EncodedKeySpec(key.getEncoded());
+ return keySpec.cast(new X509EncodedKeySpec(key.getEncoded()));
} else {
throw new InvalidKeySpecException
@@ -168,12 +167,12 @@
javax.crypto.interfaces.DHPrivateKey dhPrivKey
= (javax.crypto.interfaces.DHPrivateKey)key;
params = dhPrivKey.getParams();
- return new DHPrivateKeySpec(dhPrivKey.getX(),
- params.getP(),
- params.getG());
+ return keySpec.cast(new DHPrivateKeySpec(dhPrivKey.getX(),
+ params.getP(),
+ params.getG()));
} else if (PKCS8EncodedKeySpec.class.isAssignableFrom(keySpec)) {
- return new PKCS8EncodedKeySpec(key.getEncoded());
+ return keySpec.cast(new PKCS8EncodedKeySpec(key.getEncoded()));
} else {
throw new InvalidKeySpecException
@@ -208,8 +207,7 @@
}
// Convert key to spec
DHPublicKeySpec dhPubKeySpec
- = (DHPublicKeySpec)engineGetKeySpec
- (key, DHPublicKeySpec.class);
+ = engineGetKeySpec(key, DHPublicKeySpec.class);
// Create key from spec, and return it
return engineGeneratePublic(dhPubKeySpec);
@@ -220,8 +218,7 @@
}
// Convert key to spec
DHPrivateKeySpec dhPrivKeySpec
- = (DHPrivateKeySpec)engineGetKeySpec
- (key, DHPrivateKeySpec.class);
+ = engineGetKeySpec(key, DHPrivateKeySpec.class);
// Create key from spec, and return it
return engineGeneratePrivate(dhPrivKeySpec);
--- a/jdk/src/share/classes/com/sun/crypto/provider/DHParameterGenerator.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/DHParameterGenerator.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -25,7 +25,6 @@
package com.sun.crypto.provider;
-import java.math.BigInteger;
import java.security.*;
import java.security.spec.*;
import javax.crypto.spec.DHParameterSpec;
@@ -141,8 +140,7 @@
paramGen = AlgorithmParameterGenerator.getInstance("DSA");
paramGen.init(this.primeSize, random);
algParams = paramGen.generateParameters();
- dsaParamSpec = (DSAParameterSpec)
- algParams.getParameterSpec(DSAParameterSpec.class);
+ dsaParamSpec = algParams.getParameterSpec(DSAParameterSpec.class);
DHParameterSpec dhParamSpec;
if (this.exponentSize > 0) {
--- a/jdk/src/share/classes/com/sun/crypto/provider/DHParameters.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/DHParameters.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -25,7 +25,6 @@
package com.sun.crypto.provider;
-import java.util.*;
import java.io.*;
import sun.security.util.*;
import java.math.BigInteger;
@@ -95,11 +94,12 @@
engineInit(params);
}
- protected AlgorithmParameterSpec engineGetParameterSpec(Class paramSpec)
+ protected <T extends AlgorithmParameterSpec>
+ T engineGetParameterSpec(Class<T> paramSpec)
throws InvalidParameterSpecException {
if (DHParameterSpec.class.isAssignableFrom(paramSpec)) {
- return new DHParameterSpec(this.p, this.g, this.l);
+ return paramSpec.cast(new DHParameterSpec(this.p, this.g, this.l));
} else {
throw new InvalidParameterSpecException
("Inappropriate parameter Specification");
--- a/jdk/src/share/classes/com/sun/crypto/provider/DHPrivateKey.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/DHPrivateKey.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -31,7 +31,6 @@
import java.security.PrivateKey;
import java.security.InvalidKeyException;
import java.security.ProviderException;
-import javax.crypto.*;
import javax.crypto.spec.DHParameterSpec;
import sun.security.util.*;
@@ -182,7 +181,7 @@
// ignore OPTIONAL attributes
- this.encodedKey = (byte[])encodedKey.clone();
+ this.encodedKey = encodedKey.clone();
} catch (NumberFormatException e) {
InvalidKeyException ike = new InvalidKeyException(
@@ -256,7 +255,7 @@
return null;
}
}
- return (byte[])this.encodedKey.clone();
+ return this.encodedKey.clone();
}
/**
--- a/jdk/src/share/classes/com/sun/crypto/provider/DHPublicKey.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/DHPublicKey.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -29,10 +29,8 @@
import java.math.BigInteger;
import java.security.KeyRep;
import java.security.InvalidKeyException;
-import java.security.InvalidAlgorithmParameterException;
import java.security.ProviderException;
import java.security.PublicKey;
-import javax.crypto.*;
import javax.crypto.spec.DHParameterSpec;
import sun.security.util.*;
@@ -174,7 +172,7 @@
throw new InvalidKeyException("Excess key data");
}
- this.encodedKey = (byte[])encodedKey.clone();
+ this.encodedKey = encodedKey.clone();
} catch (NumberFormatException e) {
throw new InvalidKeyException("Private-value length too big");
@@ -237,7 +235,7 @@
return null;
}
}
- return (byte[])this.encodedKey.clone();
+ return this.encodedKey.clone();
}
/**
--- a/jdk/src/share/classes/com/sun/crypto/provider/EncryptedPrivateKeyInfo.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/EncryptedPrivateKeyInfo.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -77,7 +77,7 @@
if (seq[1].data.available() != 0)
throw new IOException("encryptedData field overrun");
- this.encoded = (byte[])encoded.clone();
+ this.encoded = encoded.clone();
}
/**
@@ -86,7 +86,7 @@
*/
EncryptedPrivateKeyInfo(AlgorithmId algid, byte[] encryptedData) {
this.algid = algid;
- this.encryptedData = (byte[])encryptedData.clone();
+ this.encryptedData = encryptedData.clone();
this.encoded = null; // lazy generation of encoding
}
@@ -101,7 +101,7 @@
* Returns the encrypted data.
*/
byte[] getEncryptedData() {
- return (byte[])this.encryptedData.clone();
+ return this.encryptedData.clone();
}
/**
@@ -110,7 +110,7 @@
byte[] getEncoded()
throws IOException
{
- if (this.encoded != null) return (byte[])this.encoded.clone();
+ if (this.encoded != null) return this.encoded.clone();
DerOutputStream out = new DerOutputStream();
DerOutputStream tmp = new DerOutputStream();
@@ -125,6 +125,6 @@
out.write(DerValue.tag_Sequence, tmp);
this.encoded = out.toByteArray();
- return (byte[])this.encoded.clone();
+ return this.encoded.clone();
}
}
--- a/jdk/src/share/classes/com/sun/crypto/provider/HmacCore.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/HmacCore.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2009, 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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -78,8 +78,8 @@
private HmacCore(HmacCore other) throws CloneNotSupportedException {
this.md = (MessageDigest)other.md.clone();
this.blockLen = other.blockLen;
- this.k_ipad = (byte[])other.k_ipad.clone();
- this.k_opad = (byte[])other.k_opad.clone();
+ this.k_ipad = other.k_ipad.clone();
+ this.k_opad = other.k_opad.clone();
this.first = other.first;
}
--- a/jdk/src/share/classes/com/sun/crypto/provider/JceKeyStore.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/JceKeyStore.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -38,9 +38,7 @@
import java.security.UnrecoverableKeyException;
import java.security.cert.Certificate;
import java.security.cert.CertificateFactory;
-import java.security.cert.X509Certificate;
import java.security.cert.CertificateException;
-import java.security.spec.InvalidKeySpecException;
import javax.crypto.SealedObject;
/**
@@ -87,7 +85,7 @@
* Private keys and certificates are stored in a hashtable.
* Hash entries are keyed by alias names.
*/
- private Hashtable entries = new Hashtable();
+ private Hashtable<String, Object> entries = new Hashtable<String, Object>();
/**
* Returns the key associated with the given alias, using the given
@@ -156,7 +154,7 @@
if ((entry instanceof PrivateKeyEntry)
&& (((PrivateKeyEntry)entry).chain != null)) {
- chain = (Certificate[])((PrivateKeyEntry)entry).chain.clone();
+ chain = ((PrivateKeyEntry)entry).chain.clone();
}
return chain;
@@ -262,7 +260,7 @@
// clone the chain
if ((chain != null) &&
(chain.length !=0)) {
- entry.chain = (Certificate[])chain.clone();
+ entry.chain = chain.clone();
} else {
entry.chain = null;
}
@@ -316,10 +314,10 @@
PrivateKeyEntry entry = new PrivateKeyEntry();
entry.date = new Date();
- entry.protectedKey = (byte[])key.clone();
+ entry.protectedKey = key.clone();
if ((chain != null) &&
(chain.length != 0)) {
- entry.chain = (Certificate[])chain.clone();
+ entry.chain = chain.clone();
} else {
entry.chain = null;
}
@@ -384,7 +382,7 @@
*
* @return enumeration of the alias names
*/
- public Enumeration engineAliases() {
+ public Enumeration<String> engineAliases() {
return entries.keys();
}
@@ -462,9 +460,9 @@
public String engineGetCertificateAlias(Certificate cert) {
Certificate certElem;
- Enumeration e = entries.keys();
+ Enumeration<String> e = entries.keys();
while (e.hasMoreElements()) {
- String alias = (String)e.nextElement();
+ String alias = e.nextElement();
Object entry = entries.get(alias);
if (entry instanceof TrustedCertEntry) {
certElem = ((TrustedCertEntry)entry).cert;
@@ -560,10 +558,10 @@
dos.writeInt(entries.size());
- Enumeration e = entries.keys();
+ Enumeration<String> e = entries.keys();
while (e.hasMoreElements()) {
- String alias = (String)e.nextElement();
+ String alias = e.nextElement();
Object entry = entries.get(alias);
if (entry instanceof PrivateKeyEntry) {
@@ -677,7 +675,7 @@
DataInputStream dis;
MessageDigest md = null;
CertificateFactory cf = null;
- Hashtable cfs = null;
+ Hashtable<String, CertificateFactory> cfs = null;
ByteArrayInputStream bais = null;
byte[] encoded = null;
@@ -713,7 +711,7 @@
cf = CertificateFactory.getInstance("X509");
} else {
// version 2
- cfs = new Hashtable(3);
+ cfs = new Hashtable<String, CertificateFactory>(3);
}
entries.clear();
@@ -761,7 +759,7 @@
String certType = dis.readUTF();
if (cfs.containsKey(certType)) {
// reuse certificate factory
- cf = (CertificateFactory)cfs.get(certType);
+ cf = cfs.get(certType);
} else {
// create new certificate factory
cf = CertificateFactory.getInstance(
@@ -803,7 +801,7 @@
String certType = dis.readUTF();
if (cfs.containsKey(certType)) {
// reuse certificate factory
- cf = (CertificateFactory)cfs.get(certType);
+ cf = cfs.get(certType);
} else {
// create new certificate factory
cf = CertificateFactory.getInstance(certType);
--- a/jdk/src/share/classes/com/sun/crypto/provider/KeyProtector.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/KeyProtector.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -25,14 +25,8 @@
package com.sun.crypto.provider;
-import java.io.UnsupportedEncodingException;
import java.io.IOException;
import java.io.Serializable;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.ObjectInputStream.GetField;
import java.security.Security;
import java.security.Key;
import java.security.PrivateKey;
@@ -42,22 +36,14 @@
import java.security.GeneralSecurityException;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
-import java.security.SecureRandom;
import java.security.UnrecoverableKeyException;
-import java.security.InvalidParameterException;
-import java.security.InvalidAlgorithmParameterException;
-import java.security.InvalidKeyException;
import java.security.AlgorithmParameters;
-import java.security.spec.InvalidParameterSpecException;
-import java.security.spec.InvalidKeySpecException;
import java.security.spec.PKCS8EncodedKeySpec;
import javax.crypto.Cipher;
import javax.crypto.CipherSpi;
import javax.crypto.SecretKey;
-import javax.crypto.NoSuchPaddingException;
import javax.crypto.IllegalBlockSizeException;
-import javax.crypto.BadPaddingException;
import javax.crypto.SealedObject;
import javax.crypto.spec.*;
import sun.security.x509.AlgorithmId;
@@ -127,7 +113,7 @@
PBEWithMD5AndTripleDESCipher cipher;
cipher = new PBEWithMD5AndTripleDESCipher();
cipher.engineInit(Cipher.ENCRYPT_MODE, sKey, pbeSpec, null);
- byte[] plain = (byte[])key.getEncoded();
+ byte[] plain = key.getEncoded();
byte[] encrKey = cipher.engineDoFinal(plain, 0, plain.length);
// wrap encrypted private key in EncryptedPrivateKeyInfo
@@ -169,8 +155,8 @@
AlgorithmParameters pbeParams =
AlgorithmParameters.getInstance("PBE");
pbeParams.init(encodedParams);
- PBEParameterSpec pbeSpec = (PBEParameterSpec)
- pbeParams.getParameterSpec(PBEParameterSpec.class);
+ PBEParameterSpec pbeSpec =
+ pbeParams.getParameterSpec(PBEParameterSpec.class);
// create PBE key from password
PBEKeySpec pbeKeySpec = new PBEKeySpec(this.password);
--- a/jdk/src/share/classes/com/sun/crypto/provider/OAEPParameters.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/OAEPParameters.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -26,7 +26,6 @@
package com.sun.crypto.provider;
import java.math.BigInteger;
-import java.util.*;
import java.io.*;
import sun.security.util.*;
import sun.security.x509.*;
@@ -180,11 +179,13 @@
engineInit(encoded);
}
- protected AlgorithmParameterSpec engineGetParameterSpec(Class paramSpec)
+ protected <T extends AlgorithmParameterSpec>
+ T engineGetParameterSpec(Class<T> paramSpec)
throws InvalidParameterSpecException {
if (OAEPParameterSpec.class.isAssignableFrom(paramSpec)) {
- return new OAEPParameterSpec(mdName, "MGF1", mgfSpec,
- new PSource.PSpecified(p));
+ return paramSpec.cast(
+ new OAEPParameterSpec(mdName, "MGF1", mgfSpec,
+ new PSource.PSpecified(p)));
} else {
throw new InvalidParameterSpecException
("Inappropriate parameter specification");
--- a/jdk/src/share/classes/com/sun/crypto/provider/PBECipherCore.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/PBECipherCore.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2007, 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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,6 @@
package com.sun.crypto.provider;
-import java.io.UnsupportedEncodingException;
import java.security.*;
import java.security.spec.*;
import javax.crypto.*;
@@ -326,8 +325,7 @@
PBEParameterSpec pbeSpec = null;
if (params != null) {
try {
- pbeSpec = (PBEParameterSpec) params.getParameterSpec
- (PBEParameterSpec.class);
+ pbeSpec = params.getParameterSpec(PBEParameterSpec.class);
} catch (InvalidParameterSpecException ipse) {
throw new InvalidAlgorithmParameterException("Wrong parameter "
+ "type: PBE "
--- a/jdk/src/share/classes/com/sun/crypto/provider/PBEKey.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/PBEKey.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -25,7 +25,6 @@
package com.sun.crypto.provider;
-import java.io.UnsupportedEncodingException;
import java.security.KeyRep;
import java.security.spec.InvalidKeySpecException;
import javax.crypto.SecretKey;
@@ -69,7 +68,7 @@
}
public byte[] getEncoded() {
- return (byte[])this.key.clone();
+ return this.key.clone();
}
public String getAlgorithm() {
@@ -118,7 +117,7 @@
throws java.io.IOException, ClassNotFoundException
{
s.defaultReadObject();
- key = (byte[])key.clone();
+ key = key.clone();
}
--- a/jdk/src/share/classes/com/sun/crypto/provider/PBEKeyFactory.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/PBEKeyFactory.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -25,7 +25,6 @@
package com.sun.crypto.provider;
-import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException;
import java.security.spec.KeySpec;
import java.security.spec.InvalidKeySpecException;
@@ -132,7 +131,7 @@
* inappropriate for the given key, or the given key cannot be processed
* (e.g., the given key has an unrecognized algorithm or format).
*/
- protected KeySpec engineGetKeySpec(SecretKey key, Class keySpecCl)
+ protected KeySpec engineGetKeySpec(SecretKey key, Class<?> keySpecCl)
throws InvalidKeySpecException {
if ((key instanceof SecretKey)
&& (validTypes.contains(key.getAlgorithm().toUpperCase()))
--- a/jdk/src/share/classes/com/sun/crypto/provider/PBEParameters.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/PBEParameters.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -25,7 +25,6 @@
package com.sun.crypto.provider;
-import java.util.*;
import java.io.*;
import java.math.BigInteger;
import java.security.AlgorithmParametersSpi;
@@ -65,7 +64,7 @@
throw new InvalidParameterSpecException
("Inappropriate parameter specification");
}
- this.salt = (byte[])((PBEParameterSpec)paramSpec).getSalt().clone();
+ this.salt = ((PBEParameterSpec)paramSpec).getSalt().clone();
this.iCount = ((PBEParameterSpec)paramSpec).getIterationCount();
}
@@ -98,11 +97,12 @@
engineInit(encoded);
}
- protected AlgorithmParameterSpec engineGetParameterSpec(Class paramSpec)
+ protected <T extends AlgorithmParameterSpec>
+ T engineGetParameterSpec(Class<T> paramSpec)
throws InvalidParameterSpecException
{
if (PBEParameterSpec.class.isAssignableFrom(paramSpec)) {
- return new PBEParameterSpec(this.salt, this.iCount);
+ return paramSpec.cast(new PBEParameterSpec(this.salt, this.iCount));
} else {
throw new InvalidParameterSpecException
("Inappropriate parameter specification");
--- a/jdk/src/share/classes/com/sun/crypto/provider/PBKDF2HmacSHA1Factory.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/PBKDF2HmacSHA1Factory.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -25,14 +25,12 @@
package com.sun.crypto.provider;
-import java.io.*;
import java.security.InvalidKeyException;
import java.security.spec.KeySpec;
import java.security.spec.InvalidKeySpecException;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactorySpi;
import javax.crypto.spec.PBEKeySpec;
-import javax.crypto.spec.SecretKeySpec;
/**
* This class implements a key factory for PBE keys derived using
@@ -88,7 +86,7 @@
* given key cannot be processed (e.g., the given key has an
* unrecognized algorithm or format).
*/
- protected KeySpec engineGetKeySpec(SecretKey key, Class keySpecCl)
+ protected KeySpec engineGetKeySpec(SecretKey key, Class<?> keySpecCl)
throws InvalidKeySpecException {
if (key instanceof javax.crypto.interfaces.PBEKey) {
// Check if requested key spec is amongst the valid ones
--- a/jdk/src/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -133,6 +133,7 @@
byte[] ti = new byte[hlen];
// SecretKeySpec cannot be used, since password can be empty here.
SecretKey macKey = new SecretKey() {
+ private static final long serialVersionUID = 7874493593505141603L;
@Override
public String getAlgorithm() {
return prf.getAlgorithm();
@@ -194,7 +195,7 @@
}
public byte[] getEncoded() {
- return (byte[]) key.clone();
+ return key.clone();
}
public String getAlgorithm() {
@@ -206,7 +207,7 @@
}
public char[] getPassword() {
- return (char[]) passwd.clone();
+ return passwd.clone();
}
public byte[] getSalt() {
@@ -268,7 +269,7 @@
protected void finalize() throws Throwable {
try {
if (this.passwd != null) {
- java.util.Arrays.fill(this.passwd, (char) '0');
+ java.util.Arrays.fill(this.passwd, '0');
this.passwd = null;
}
if (this.key != null) {
--- a/jdk/src/share/classes/com/sun/crypto/provider/PCBC.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/PCBC.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -145,7 +145,7 @@
for (; plainOffset < endIndex;
plainOffset += blockSize, cipherOffset += blockSize) {
for (i=0; i<blockSize; i++) {
- k[i] ^= (byte)(plain[i+plainOffset]);
+ k[i] ^= plain[i+plainOffset];
}
embeddedCipher.encryptBlock(k, 0, cipher, cipherOffset);
for (i = 0; i < blockSize; i++) {
--- a/jdk/src/share/classes/com/sun/crypto/provider/RC2Cipher.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/RC2Cipher.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -98,8 +98,8 @@
throws InvalidKeyException, InvalidAlgorithmParameterException {
if (params != null && params.getAlgorithm().equals("RC2")) {
try {
- RC2ParameterSpec rc2Params = (RC2ParameterSpec)
- params.getParameterSpec(RC2ParameterSpec.class);
+ RC2ParameterSpec rc2Params =
+ params.getParameterSpec(RC2ParameterSpec.class);
engineInit(opmode, key, rc2Params, random);
} catch (InvalidParameterSpecException ipse) {
throw new InvalidAlgorithmParameterException
--- a/jdk/src/share/classes/com/sun/crypto/provider/RC2Parameters.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/RC2Parameters.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -55,7 +55,6 @@
* @author Sean Mullan
* @since 1.5
*/
-
public final class RC2Parameters extends AlgorithmParametersSpi {
// TABLE[EKB] from section 6 of RFC 2268, used to convert effective key
@@ -177,13 +176,14 @@
engineInit(encoded);
}
- protected AlgorithmParameterSpec engineGetParameterSpec(Class paramSpec)
+ protected <T extends AlgorithmParameterSpec>
+ T engineGetParameterSpec(Class<T> paramSpec)
throws InvalidParameterSpecException {
if (RC2ParameterSpec.class.isAssignableFrom(paramSpec)) {
- return (iv == null ?
- new RC2ParameterSpec(effectiveKeySize) :
- new RC2ParameterSpec(effectiveKeySize, iv));
+ return paramSpec.cast((iv == null ?
+ new RC2ParameterSpec(effectiveKeySize) :
+ new RC2ParameterSpec(effectiveKeySize, iv)));
} else {
throw new InvalidParameterSpecException
("Inappropriate parameter specification");
--- a/jdk/src/share/classes/com/sun/crypto/provider/RSACipher.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/RSACipher.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -227,8 +227,8 @@
init(opmode, key, random, null);
} else {
try {
- OAEPParameterSpec spec = (OAEPParameterSpec)
- params.getParameterSpec(OAEPParameterSpec.class);
+ OAEPParameterSpec spec =
+ params.getParameterSpec(OAEPParameterSpec.class);
init(opmode, key, random, spec);
} catch (InvalidParameterSpecException ipse) {
InvalidAlgorithmParameterException iape =
--- a/jdk/src/share/classes/com/sun/crypto/provider/SunJCE.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/SunJCE.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -27,11 +27,6 @@
import java.security.AccessController;
import java.security.Provider;
-import java.security.PrivilegedAction;
-import java.security.cert.*;
-import java.net.URL;
-import java.io.ByteArrayInputStream;
-import java.security.CodeSource;
import java.security.SecureRandom;
@@ -105,352 +100,353 @@
"|OFB72|OFB80|OFB88|OFB96|OFB104|OFB112|OFB120|OFB128";
final String BLOCK_PADS = "NOPADDING|PKCS5PADDING|ISO10126PADDING";
- AccessController.doPrivileged(new java.security.PrivilegedAction() {
+ AccessController.doPrivileged(
+ new java.security.PrivilegedAction<Object>() {
public Object run() {
- /*
- * Cipher engines
- */
- put("Cipher.RSA", "com.sun.crypto.provider.RSACipher");
- put("Cipher.RSA SupportedModes", "ECB");
- put("Cipher.RSA SupportedPaddings",
- "NOPADDING|PKCS1PADDING|OAEPWITHMD5ANDMGF1PADDING"
- + "|OAEPWITHSHA1ANDMGF1PADDING"
- + "|OAEPWITHSHA-1ANDMGF1PADDING"
- + "|OAEPWITHSHA-256ANDMGF1PADDING"
- + "|OAEPWITHSHA-384ANDMGF1PADDING"
- + "|OAEPWITHSHA-512ANDMGF1PADDING");
- put("Cipher.RSA SupportedKeyClasses",
- "java.security.interfaces.RSAPublicKey" +
- "|java.security.interfaces.RSAPrivateKey");
+ /*
+ * Cipher engines
+ */
+ put("Cipher.RSA", "com.sun.crypto.provider.RSACipher");
+ put("Cipher.RSA SupportedModes", "ECB");
+ put("Cipher.RSA SupportedPaddings",
+ "NOPADDING|PKCS1PADDING|OAEPWITHMD5ANDMGF1PADDING"
+ + "|OAEPWITHSHA1ANDMGF1PADDING"
+ + "|OAEPWITHSHA-1ANDMGF1PADDING"
+ + "|OAEPWITHSHA-256ANDMGF1PADDING"
+ + "|OAEPWITHSHA-384ANDMGF1PADDING"
+ + "|OAEPWITHSHA-512ANDMGF1PADDING");
+ put("Cipher.RSA SupportedKeyClasses",
+ "java.security.interfaces.RSAPublicKey" +
+ "|java.security.interfaces.RSAPrivateKey");
- put("Cipher.DES", "com.sun.crypto.provider.DESCipher");
- put("Cipher.DES SupportedModes", BLOCK_MODES);
- put("Cipher.DES SupportedPaddings", BLOCK_PADS);
- put("Cipher.DES SupportedKeyFormats", "RAW");
+ put("Cipher.DES", "com.sun.crypto.provider.DESCipher");
+ put("Cipher.DES SupportedModes", BLOCK_MODES);
+ put("Cipher.DES SupportedPaddings", BLOCK_PADS);
+ put("Cipher.DES SupportedKeyFormats", "RAW");
- put("Cipher.DESede", "com.sun.crypto.provider.DESedeCipher");
- put("Alg.Alias.Cipher.TripleDES", "DESede");
- put("Cipher.DESede SupportedModes", BLOCK_MODES);
- put("Cipher.DESede SupportedPaddings", BLOCK_PADS);
- put("Cipher.DESede SupportedKeyFormats", "RAW");
+ put("Cipher.DESede", "com.sun.crypto.provider.DESedeCipher");
+ put("Alg.Alias.Cipher.TripleDES", "DESede");
+ put("Cipher.DESede SupportedModes", BLOCK_MODES);
+ put("Cipher.DESede SupportedPaddings", BLOCK_PADS);
+ put("Cipher.DESede SupportedKeyFormats", "RAW");
- put("Cipher.DESedeWrap",
- "com.sun.crypto.provider.DESedeWrapCipher");
- put("Cipher.DESedeWrap SupportedModes", "CBC");
- put("Cipher.DESedeWrap SupportedPaddings", "NOPADDING");
- put("Cipher.DESedeWrap SupportedKeyFormats", "RAW");
+ put("Cipher.DESedeWrap",
+ "com.sun.crypto.provider.DESedeWrapCipher");
+ put("Cipher.DESedeWrap SupportedModes", "CBC");
+ put("Cipher.DESedeWrap SupportedPaddings", "NOPADDING");
+ put("Cipher.DESedeWrap SupportedKeyFormats", "RAW");
- put("Cipher.PBEWithMD5AndDES",
- "com.sun.crypto.provider.PBEWithMD5AndDESCipher");
- put("Alg.Alias.Cipher.OID."+OID_PKCS5_MD5_DES,
- "PBEWithMD5AndDES");
- put("Alg.Alias.Cipher."+OID_PKCS5_MD5_DES,
- "PBEWithMD5AndDES");
- put("Cipher.PBEWithMD5AndTripleDES",
- "com.sun.crypto.provider.PBEWithMD5AndTripleDESCipher");
- put("Cipher.PBEWithSHA1AndRC2_40",
- "com.sun.crypto.provider.PKCS12PBECipherCore$" +
- "PBEWithSHA1AndRC2_40");
- put("Alg.Alias.Cipher.OID." + OID_PKCS12_RC2_40,
- "PBEWithSHA1AndRC2_40");
- put("Alg.Alias.Cipher." + OID_PKCS12_RC2_40,
- "PBEWithSHA1AndRC2_40");
- put("Cipher.PBEWithSHA1AndDESede",
- "com.sun.crypto.provider.PKCS12PBECipherCore$" +
- "PBEWithSHA1AndDESede");
- put("Alg.Alias.Cipher.OID." + OID_PKCS12_DESede,
- "PBEWithSHA1AndDESede");
- put("Alg.Alias.Cipher." + OID_PKCS12_DESede,
- "PBEWithSHA1AndDESede");
+ put("Cipher.PBEWithMD5AndDES",
+ "com.sun.crypto.provider.PBEWithMD5AndDESCipher");
+ put("Alg.Alias.Cipher.OID."+OID_PKCS5_MD5_DES,
+ "PBEWithMD5AndDES");
+ put("Alg.Alias.Cipher."+OID_PKCS5_MD5_DES,
+ "PBEWithMD5AndDES");
+ put("Cipher.PBEWithMD5AndTripleDES",
+ "com.sun.crypto.provider.PBEWithMD5AndTripleDESCipher");
+ put("Cipher.PBEWithSHA1AndRC2_40",
+ "com.sun.crypto.provider.PKCS12PBECipherCore$" +
+ "PBEWithSHA1AndRC2_40");
+ put("Alg.Alias.Cipher.OID." + OID_PKCS12_RC2_40,
+ "PBEWithSHA1AndRC2_40");
+ put("Alg.Alias.Cipher." + OID_PKCS12_RC2_40,
+ "PBEWithSHA1AndRC2_40");
+ put("Cipher.PBEWithSHA1AndDESede",
+ "com.sun.crypto.provider.PKCS12PBECipherCore$" +
+ "PBEWithSHA1AndDESede");
+ put("Alg.Alias.Cipher.OID." + OID_PKCS12_DESede,
+ "PBEWithSHA1AndDESede");
+ put("Alg.Alias.Cipher." + OID_PKCS12_DESede,
+ "PBEWithSHA1AndDESede");
- put("Cipher.Blowfish",
- "com.sun.crypto.provider.BlowfishCipher");
- put("Cipher.Blowfish SupportedModes", BLOCK_MODES);
- put("Cipher.Blowfish SupportedPaddings", BLOCK_PADS);
- put("Cipher.Blowfish SupportedKeyFormats", "RAW");
+ put("Cipher.Blowfish",
+ "com.sun.crypto.provider.BlowfishCipher");
+ put("Cipher.Blowfish SupportedModes", BLOCK_MODES);
+ put("Cipher.Blowfish SupportedPaddings", BLOCK_PADS);
+ put("Cipher.Blowfish SupportedKeyFormats", "RAW");
- put("Cipher.AES", "com.sun.crypto.provider.AESCipher");
- put("Alg.Alias.Cipher.Rijndael", "AES");
- put("Cipher.AES SupportedModes", BLOCK_MODES128);
- put("Cipher.AES SupportedPaddings", BLOCK_PADS);
- put("Cipher.AES SupportedKeyFormats", "RAW");
+ put("Cipher.AES", "com.sun.crypto.provider.AESCipher");
+ put("Alg.Alias.Cipher.Rijndael", "AES");
+ put("Cipher.AES SupportedModes", BLOCK_MODES128);
+ put("Cipher.AES SupportedPaddings", BLOCK_PADS);
+ put("Cipher.AES SupportedKeyFormats", "RAW");
- put("Cipher.AESWrap", "com.sun.crypto.provider.AESWrapCipher");
- put("Cipher.AESWrap SupportedModes", "ECB");
- put("Cipher.AESWrap SupportedPaddings", "NOPADDING");
- put("Cipher.AESWrap SupportedKeyFormats", "RAW");
+ put("Cipher.AESWrap", "com.sun.crypto.provider.AESWrapCipher");
+ put("Cipher.AESWrap SupportedModes", "ECB");
+ put("Cipher.AESWrap SupportedPaddings", "NOPADDING");
+ put("Cipher.AESWrap SupportedKeyFormats", "RAW");
- put("Cipher.RC2",
- "com.sun.crypto.provider.RC2Cipher");
- put("Cipher.RC2 SupportedModes", BLOCK_MODES);
- put("Cipher.RC2 SupportedPaddings", BLOCK_PADS);
- put("Cipher.RC2 SupportedKeyFormats", "RAW");
+ put("Cipher.RC2",
+ "com.sun.crypto.provider.RC2Cipher");
+ put("Cipher.RC2 SupportedModes", BLOCK_MODES);
+ put("Cipher.RC2 SupportedPaddings", BLOCK_PADS);
+ put("Cipher.RC2 SupportedKeyFormats", "RAW");
- put("Cipher.ARCFOUR",
- "com.sun.crypto.provider.ARCFOURCipher");
- put("Alg.Alias.Cipher.RC4", "ARCFOUR");
- put("Cipher.ARCFOUR SupportedModes", "ECB");
- put("Cipher.ARCFOUR SupportedPaddings", "NOPADDING");
- put("Cipher.ARCFOUR SupportedKeyFormats", "RAW");
+ put("Cipher.ARCFOUR",
+ "com.sun.crypto.provider.ARCFOURCipher");
+ put("Alg.Alias.Cipher.RC4", "ARCFOUR");
+ put("Cipher.ARCFOUR SupportedModes", "ECB");
+ put("Cipher.ARCFOUR SupportedPaddings", "NOPADDING");
+ put("Cipher.ARCFOUR SupportedKeyFormats", "RAW");
- /*
- * Key(pair) Generator engines
- */
- put("KeyGenerator.DES",
- "com.sun.crypto.provider.DESKeyGenerator");
+ /*
+ * Key(pair) Generator engines
+ */
+ put("KeyGenerator.DES",
+ "com.sun.crypto.provider.DESKeyGenerator");
- put("KeyGenerator.DESede",
- "com.sun.crypto.provider.DESedeKeyGenerator");
- put("Alg.Alias.KeyGenerator.TripleDES", "DESede");
+ put("KeyGenerator.DESede",
+ "com.sun.crypto.provider.DESedeKeyGenerator");
+ put("Alg.Alias.KeyGenerator.TripleDES", "DESede");
- put("KeyGenerator.Blowfish",
- "com.sun.crypto.provider.BlowfishKeyGenerator");
+ put("KeyGenerator.Blowfish",
+ "com.sun.crypto.provider.BlowfishKeyGenerator");
- put("KeyGenerator.AES",
- "com.sun.crypto.provider.AESKeyGenerator");
- put("Alg.Alias.KeyGenerator.Rijndael", "AES");
+ put("KeyGenerator.AES",
+ "com.sun.crypto.provider.AESKeyGenerator");
+ put("Alg.Alias.KeyGenerator.Rijndael", "AES");
- put("KeyGenerator.RC2",
- "com.sun.crypto.provider.KeyGeneratorCore$" +
- "RC2KeyGenerator");
- put("KeyGenerator.ARCFOUR",
- "com.sun.crypto.provider.KeyGeneratorCore$" +
- "ARCFOURKeyGenerator");
- put("Alg.Alias.KeyGenerator.RC4", "ARCFOUR");
+ put("KeyGenerator.RC2",
+ "com.sun.crypto.provider.KeyGeneratorCore$" +
+ "RC2KeyGenerator");
+ put("KeyGenerator.ARCFOUR",
+ "com.sun.crypto.provider.KeyGeneratorCore$" +
+ "ARCFOURKeyGenerator");
+ put("Alg.Alias.KeyGenerator.RC4", "ARCFOUR");
- put("KeyGenerator.HmacMD5",
- "com.sun.crypto.provider.HmacMD5KeyGenerator");
+ put("KeyGenerator.HmacMD5",
+ "com.sun.crypto.provider.HmacMD5KeyGenerator");
- put("KeyGenerator.HmacSHA1",
- "com.sun.crypto.provider.HmacSHA1KeyGenerator");
+ put("KeyGenerator.HmacSHA1",
+ "com.sun.crypto.provider.HmacSHA1KeyGenerator");
- put("KeyGenerator.HmacSHA256",
- "com.sun.crypto.provider.KeyGeneratorCore$HmacSHA256KG");
- put("KeyGenerator.HmacSHA384",
- "com.sun.crypto.provider.KeyGeneratorCore$HmacSHA384KG");
- put("KeyGenerator.HmacSHA512",
- "com.sun.crypto.provider.KeyGeneratorCore$HmacSHA512KG");
+ put("KeyGenerator.HmacSHA256",
+ "com.sun.crypto.provider.KeyGeneratorCore$HmacSHA256KG");
+ put("KeyGenerator.HmacSHA384",
+ "com.sun.crypto.provider.KeyGeneratorCore$HmacSHA384KG");
+ put("KeyGenerator.HmacSHA512",
+ "com.sun.crypto.provider.KeyGeneratorCore$HmacSHA512KG");
- put("KeyPairGenerator.DiffieHellman",
- "com.sun.crypto.provider.DHKeyPairGenerator");
- put("Alg.Alias.KeyPairGenerator.DH", "DiffieHellman");
- put("Alg.Alias.KeyPairGenerator.OID."+OID_PKCS3,
- "DiffieHellman");
- put("Alg.Alias.KeyPairGenerator."+OID_PKCS3,
- "DiffieHellman");
- /*
- * Algorithm parameter generation engines
- */
- put("AlgorithmParameterGenerator.DiffieHellman",
- "com.sun.crypto.provider.DHParameterGenerator");
- put("Alg.Alias.AlgorithmParameterGenerator.DH",
- "DiffieHellman");
- put("Alg.Alias.AlgorithmParameterGenerator.OID."+OID_PKCS3,
- "DiffieHellman");
- put("Alg.Alias.AlgorithmParameterGenerator."+OID_PKCS3,
- "DiffieHellman");
+ put("KeyPairGenerator.DiffieHellman",
+ "com.sun.crypto.provider.DHKeyPairGenerator");
+ put("Alg.Alias.KeyPairGenerator.DH", "DiffieHellman");
+ put("Alg.Alias.KeyPairGenerator.OID."+OID_PKCS3,
+ "DiffieHellman");
+ put("Alg.Alias.KeyPairGenerator."+OID_PKCS3,
+ "DiffieHellman");
+ /*
+ * Algorithm parameter generation engines
+ */
+ put("AlgorithmParameterGenerator.DiffieHellman",
+ "com.sun.crypto.provider.DHParameterGenerator");
+ put("Alg.Alias.AlgorithmParameterGenerator.DH",
+ "DiffieHellman");
+ put("Alg.Alias.AlgorithmParameterGenerator.OID."+OID_PKCS3,
+ "DiffieHellman");
+ put("Alg.Alias.AlgorithmParameterGenerator."+OID_PKCS3,
+ "DiffieHellman");
- /*
- * Key Agreement engines
- */
- put("KeyAgreement.DiffieHellman",
- "com.sun.crypto.provider.DHKeyAgreement");
- put("Alg.Alias.KeyAgreement.DH", "DiffieHellman");
- put("Alg.Alias.KeyAgreement.OID."+OID_PKCS3, "DiffieHellman");
- put("Alg.Alias.KeyAgreement."+OID_PKCS3, "DiffieHellman");
+ /*
+ * Key Agreement engines
+ */
+ put("KeyAgreement.DiffieHellman",
+ "com.sun.crypto.provider.DHKeyAgreement");
+ put("Alg.Alias.KeyAgreement.DH", "DiffieHellman");
+ put("Alg.Alias.KeyAgreement.OID."+OID_PKCS3, "DiffieHellman");
+ put("Alg.Alias.KeyAgreement."+OID_PKCS3, "DiffieHellman");
- put("KeyAgreement.DiffieHellman SupportedKeyClasses",
- "javax.crypto.interfaces.DHPublicKey" +
- "|javax.crypto.interfaces.DHPrivateKey");
+ put("KeyAgreement.DiffieHellman SupportedKeyClasses",
+ "javax.crypto.interfaces.DHPublicKey" +
+ "|javax.crypto.interfaces.DHPrivateKey");
- /*
- * Algorithm Parameter engines
- */
- put("AlgorithmParameters.DiffieHellman",
- "com.sun.crypto.provider.DHParameters");
- put("Alg.Alias.AlgorithmParameters.DH", "DiffieHellman");
- put("Alg.Alias.AlgorithmParameters.OID."+OID_PKCS3,
- "DiffieHellman");
- put("Alg.Alias.AlgorithmParameters."+OID_PKCS3,
- "DiffieHellman");
+ /*
+ * Algorithm Parameter engines
+ */
+ put("AlgorithmParameters.DiffieHellman",
+ "com.sun.crypto.provider.DHParameters");
+ put("Alg.Alias.AlgorithmParameters.DH", "DiffieHellman");
+ put("Alg.Alias.AlgorithmParameters.OID."+OID_PKCS3,
+ "DiffieHellman");
+ put("Alg.Alias.AlgorithmParameters."+OID_PKCS3,
+ "DiffieHellman");
- put("AlgorithmParameters.DES",
- "com.sun.crypto.provider.DESParameters");
+ put("AlgorithmParameters.DES",
+ "com.sun.crypto.provider.DESParameters");
- put("AlgorithmParameters.DESede",
- "com.sun.crypto.provider.DESedeParameters");
- put("Alg.Alias.AlgorithmParameters.TripleDES", "DESede");
+ put("AlgorithmParameters.DESede",
+ "com.sun.crypto.provider.DESedeParameters");
+ put("Alg.Alias.AlgorithmParameters.TripleDES", "DESede");
- put("AlgorithmParameters.PBE",
- "com.sun.crypto.provider.PBEParameters");
+ put("AlgorithmParameters.PBE",
+ "com.sun.crypto.provider.PBEParameters");
- put("AlgorithmParameters.PBEWithMD5AndDES",
- "com.sun.crypto.provider.PBEParameters");
- put("Alg.Alias.AlgorithmParameters.OID."+OID_PKCS5_MD5_DES,
- "PBEWithMD5AndDES");
- put("Alg.Alias.AlgorithmParameters."+OID_PKCS5_MD5_DES,
- "PBEWithMD5AndDES");
+ put("AlgorithmParameters.PBEWithMD5AndDES",
+ "com.sun.crypto.provider.PBEParameters");
+ put("Alg.Alias.AlgorithmParameters.OID."+OID_PKCS5_MD5_DES,
+ "PBEWithMD5AndDES");
+ put("Alg.Alias.AlgorithmParameters."+OID_PKCS5_MD5_DES,
+ "PBEWithMD5AndDES");
- put("AlgorithmParameters.PBEWithMD5AndTripleDES",
- "com.sun.crypto.provider.PBEParameters");
+ put("AlgorithmParameters.PBEWithMD5AndTripleDES",
+ "com.sun.crypto.provider.PBEParameters");
- put("AlgorithmParameters.PBEWithSHA1AndDESede",
- "com.sun.crypto.provider.PBEParameters");
- put("Alg.Alias.AlgorithmParameters.OID."+OID_PKCS12_DESede,
- "PBEWithSHA1AndDESede");
- put("Alg.Alias.AlgorithmParameters."+OID_PKCS12_DESede,
- "PBEWithSHA1AndDESede");
+ put("AlgorithmParameters.PBEWithSHA1AndDESede",
+ "com.sun.crypto.provider.PBEParameters");
+ put("Alg.Alias.AlgorithmParameters.OID."+OID_PKCS12_DESede,
+ "PBEWithSHA1AndDESede");
+ put("Alg.Alias.AlgorithmParameters."+OID_PKCS12_DESede,
+ "PBEWithSHA1AndDESede");
- put("AlgorithmParameters.PBEWithSHA1AndRC2_40",
- "com.sun.crypto.provider.PBEParameters");
- put("Alg.Alias.AlgorithmParameters.OID."+OID_PKCS12_RC2_40,
- "PBEWithSHA1AndRC2_40");
- put("Alg.Alias.AlgorithmParameters." + OID_PKCS12_RC2_40,
- "PBEWithSHA1AndRC2_40");
+ put("AlgorithmParameters.PBEWithSHA1AndRC2_40",
+ "com.sun.crypto.provider.PBEParameters");
+ put("Alg.Alias.AlgorithmParameters.OID."+OID_PKCS12_RC2_40,
+ "PBEWithSHA1AndRC2_40");
+ put("Alg.Alias.AlgorithmParameters." + OID_PKCS12_RC2_40,
+ "PBEWithSHA1AndRC2_40");
- put("AlgorithmParameters.Blowfish",
- "com.sun.crypto.provider.BlowfishParameters");
+ put("AlgorithmParameters.Blowfish",
+ "com.sun.crypto.provider.BlowfishParameters");
- put("AlgorithmParameters.AES",
- "com.sun.crypto.provider.AESParameters");
- put("Alg.Alias.AlgorithmParameters.Rijndael", "AES");
+ put("AlgorithmParameters.AES",
+ "com.sun.crypto.provider.AESParameters");
+ put("Alg.Alias.AlgorithmParameters.Rijndael", "AES");
- put("AlgorithmParameters.RC2",
- "com.sun.crypto.provider.RC2Parameters");
+ put("AlgorithmParameters.RC2",
+ "com.sun.crypto.provider.RC2Parameters");
- put("AlgorithmParameters.OAEP",
- "com.sun.crypto.provider.OAEPParameters");
+ put("AlgorithmParameters.OAEP",
+ "com.sun.crypto.provider.OAEPParameters");
- /*
- * Key factories
- */
- put("KeyFactory.DiffieHellman",
- "com.sun.crypto.provider.DHKeyFactory");
- put("Alg.Alias.KeyFactory.DH", "DiffieHellman");
- put("Alg.Alias.KeyFactory.OID."+OID_PKCS3,
- "DiffieHellman");
- put("Alg.Alias.KeyFactory."+OID_PKCS3, "DiffieHellman");
- /*
- * Secret-key factories
- */
- put("SecretKeyFactory.DES",
- "com.sun.crypto.provider.DESKeyFactory");
+ /*
+ * Key factories
+ */
+ put("KeyFactory.DiffieHellman",
+ "com.sun.crypto.provider.DHKeyFactory");
+ put("Alg.Alias.KeyFactory.DH", "DiffieHellman");
+ put("Alg.Alias.KeyFactory.OID."+OID_PKCS3,
+ "DiffieHellman");
+ put("Alg.Alias.KeyFactory."+OID_PKCS3, "DiffieHellman");
+ /*
+ * Secret-key factories
+ */
+ put("SecretKeyFactory.DES",
+ "com.sun.crypto.provider.DESKeyFactory");
- put("SecretKeyFactory.DESede",
- "com.sun.crypto.provider.DESedeKeyFactory");
- put("Alg.Alias.SecretKeyFactory.TripleDES", "DESede");
+ put("SecretKeyFactory.DESede",
+ "com.sun.crypto.provider.DESedeKeyFactory");
+ put("Alg.Alias.SecretKeyFactory.TripleDES", "DESede");
- put("SecretKeyFactory.PBEWithMD5AndDES",
- "com.sun.crypto.provider.PBEKeyFactory$PBEWithMD5AndDES"
- );
- put("Alg.Alias.SecretKeyFactory.OID."+OID_PKCS5_MD5_DES,
- "PBEWithMD5AndDES");
- put("Alg.Alias.SecretKeyFactory."+OID_PKCS5_MD5_DES,
- "PBEWithMD5AndDES");
+ put("SecretKeyFactory.PBEWithMD5AndDES",
+ "com.sun.crypto.provider.PBEKeyFactory$PBEWithMD5AndDES"
+ );
+ put("Alg.Alias.SecretKeyFactory.OID."+OID_PKCS5_MD5_DES,
+ "PBEWithMD5AndDES");
+ put("Alg.Alias.SecretKeyFactory."+OID_PKCS5_MD5_DES,
+ "PBEWithMD5AndDES");
- put("Alg.Alias.SecretKeyFactory.PBE",
- "PBEWithMD5AndDES");
+ put("Alg.Alias.SecretKeyFactory.PBE",
+ "PBEWithMD5AndDES");
- /*
- * Internal in-house crypto algorithm used for
- * the JCEKS keystore type. Since this was developed
- * internally, there isn't an OID corresponding to this
- * algorithm.
- */
- put("SecretKeyFactory.PBEWithMD5AndTripleDES",
- "com.sun.crypto.provider.PBEKeyFactory$" +
- "PBEWithMD5AndTripleDES"
- );
+ /*
+ * Internal in-house crypto algorithm used for
+ * the JCEKS keystore type. Since this was developed
+ * internally, there isn't an OID corresponding to this
+ * algorithm.
+ */
+ put("SecretKeyFactory.PBEWithMD5AndTripleDES",
+ "com.sun.crypto.provider.PBEKeyFactory$" +
+ "PBEWithMD5AndTripleDES"
+ );
- put("SecretKeyFactory.PBEWithSHA1AndDESede",
- "com.sun.crypto.provider.PBEKeyFactory$PBEWithSHA1AndDESede"
- );
- put("Alg.Alias.SecretKeyFactory.OID."+OID_PKCS12_DESede,
- "PBEWithSHA1AndDESede");
- put("Alg.Alias.SecretKeyFactory." + OID_PKCS12_DESede,
- "PBEWithSHA1AndDESede");
+ put("SecretKeyFactory.PBEWithSHA1AndDESede",
+ "com.sun.crypto.provider.PBEKeyFactory$PBEWithSHA1AndDESede"
+ );
+ put("Alg.Alias.SecretKeyFactory.OID."+OID_PKCS12_DESede,
+ "PBEWithSHA1AndDESede");
+ put("Alg.Alias.SecretKeyFactory." + OID_PKCS12_DESede,
+ "PBEWithSHA1AndDESede");
- put("SecretKeyFactory.PBEWithSHA1AndRC2_40",
- "com.sun.crypto.provider.PBEKeyFactory$PBEWithSHA1AndRC2_40"
- );
- put("Alg.Alias.SecretKeyFactory.OID." + OID_PKCS12_RC2_40,
- "PBEWithSHA1AndRC2_40");
- put("Alg.Alias.SecretKeyFactory." + OID_PKCS12_RC2_40,
- "PBEWithSHA1AndRC2_40");
+ put("SecretKeyFactory.PBEWithSHA1AndRC2_40",
+ "com.sun.crypto.provider.PBEKeyFactory$PBEWithSHA1AndRC2_40"
+ );
+ put("Alg.Alias.SecretKeyFactory.OID." + OID_PKCS12_RC2_40,
+ "PBEWithSHA1AndRC2_40");
+ put("Alg.Alias.SecretKeyFactory." + OID_PKCS12_RC2_40,
+ "PBEWithSHA1AndRC2_40");
- put("SecretKeyFactory.PBKDF2WithHmacSHA1",
- "com.sun.crypto.provider.PBKDF2HmacSHA1Factory");
- put("Alg.Alias.SecretKeyFactory.OID." + OID_PKCS5_PBKDF2,
- "PBKDF2WithHmacSHA1");
- put("Alg.Alias.SecretKeyFactory." + OID_PKCS5_PBKDF2,
- "PBKDF2WithHmacSHA1");
+ put("SecretKeyFactory.PBKDF2WithHmacSHA1",
+ "com.sun.crypto.provider.PBKDF2HmacSHA1Factory");
+ put("Alg.Alias.SecretKeyFactory.OID." + OID_PKCS5_PBKDF2,
+ "PBKDF2WithHmacSHA1");
+ put("Alg.Alias.SecretKeyFactory." + OID_PKCS5_PBKDF2,
+ "PBKDF2WithHmacSHA1");
- /*
- * MAC
- */
- put("Mac.HmacMD5", "com.sun.crypto.provider.HmacMD5");
- put("Mac.HmacSHA1", "com.sun.crypto.provider.HmacSHA1");
- put("Mac.HmacSHA256",
- "com.sun.crypto.provider.HmacCore$HmacSHA256");
- put("Mac.HmacSHA384",
- "com.sun.crypto.provider.HmacCore$HmacSHA384");
- put("Mac.HmacSHA512",
- "com.sun.crypto.provider.HmacCore$HmacSHA512");
- put("Mac.HmacPBESHA1",
- "com.sun.crypto.provider.HmacPKCS12PBESHA1");
+ /*
+ * MAC
+ */
+ put("Mac.HmacMD5", "com.sun.crypto.provider.HmacMD5");
+ put("Mac.HmacSHA1", "com.sun.crypto.provider.HmacSHA1");
+ put("Mac.HmacSHA256",
+ "com.sun.crypto.provider.HmacCore$HmacSHA256");
+ put("Mac.HmacSHA384",
+ "com.sun.crypto.provider.HmacCore$HmacSHA384");
+ put("Mac.HmacSHA512",
+ "com.sun.crypto.provider.HmacCore$HmacSHA512");
+ put("Mac.HmacPBESHA1",
+ "com.sun.crypto.provider.HmacPKCS12PBESHA1");
- put("Mac.SslMacMD5",
- "com.sun.crypto.provider.SslMacCore$SslMacMD5");
- put("Mac.SslMacSHA1",
- "com.sun.crypto.provider.SslMacCore$SslMacSHA1");
+ put("Mac.SslMacMD5",
+ "com.sun.crypto.provider.SslMacCore$SslMacMD5");
+ put("Mac.SslMacSHA1",
+ "com.sun.crypto.provider.SslMacCore$SslMacSHA1");
- put("Mac.HmacMD5 SupportedKeyFormats", "RAW");
- put("Mac.HmacSHA1 SupportedKeyFormats", "RAW");
- put("Mac.HmacSHA256 SupportedKeyFormats", "RAW");
- put("Mac.HmacSHA384 SupportedKeyFormats", "RAW");
- put("Mac.HmacSHA512 SupportedKeyFormats", "RAW");
- put("Mac.HmacPBESHA1 SupportedKeyFormats", "RAW");
- put("Mac.SslMacMD5 SupportedKeyFormats", "RAW");
- put("Mac.SslMacSHA1 SupportedKeyFormats", "RAW");
+ put("Mac.HmacMD5 SupportedKeyFormats", "RAW");
+ put("Mac.HmacSHA1 SupportedKeyFormats", "RAW");
+ put("Mac.HmacSHA256 SupportedKeyFormats", "RAW");
+ put("Mac.HmacSHA384 SupportedKeyFormats", "RAW");
+ put("Mac.HmacSHA512 SupportedKeyFormats", "RAW");
+ put("Mac.HmacPBESHA1 SupportedKeyFormats", "RAW");
+ put("Mac.SslMacMD5 SupportedKeyFormats", "RAW");
+ put("Mac.SslMacSHA1 SupportedKeyFormats", "RAW");
- /*
- * KeyStore
- */
- put("KeyStore.JCEKS", "com.sun.crypto.provider.JceKeyStore");
+ /*
+ * KeyStore
+ */
+ put("KeyStore.JCEKS", "com.sun.crypto.provider.JceKeyStore");
- /*
- * SSL/TLS mechanisms
- *
- * These are strictly internal implementations and may
- * be changed at any time. These names were chosen
- * because PKCS11/SunPKCS11 does not yet have TLS1.2
- * mechanisms, and it will cause calls to come here.
- */
- put("KeyGenerator.SunTlsPrf",
- "com.sun.crypto.provider.TlsPrfGenerator$V10");
- put("KeyGenerator.SunTls12Prf",
- "com.sun.crypto.provider.TlsPrfGenerator$V12");
+ /*
+ * SSL/TLS mechanisms
+ *
+ * These are strictly internal implementations and may
+ * be changed at any time. These names were chosen
+ * because PKCS11/SunPKCS11 does not yet have TLS1.2
+ * mechanisms, and it will cause calls to come here.
+ */
+ put("KeyGenerator.SunTlsPrf",
+ "com.sun.crypto.provider.TlsPrfGenerator$V10");
+ put("KeyGenerator.SunTls12Prf",
+ "com.sun.crypto.provider.TlsPrfGenerator$V12");
- put("KeyGenerator.SunTlsMasterSecret",
- "com.sun.crypto.provider.TlsMasterSecretGenerator");
- put("Alg.Alias.KeyGenerator.SunTls12MasterSecret",
- "SunTlsMasterSecret");
+ put("KeyGenerator.SunTlsMasterSecret",
+ "com.sun.crypto.provider.TlsMasterSecretGenerator");
+ put("Alg.Alias.KeyGenerator.SunTls12MasterSecret",
+ "SunTlsMasterSecret");
- put("KeyGenerator.SunTlsKeyMaterial",
- "com.sun.crypto.provider.TlsKeyMaterialGenerator");
- put("Alg.Alias.KeyGenerator.SunTls12KeyMaterial",
- "SunTlsKeyMaterial");
+ put("KeyGenerator.SunTlsKeyMaterial",
+ "com.sun.crypto.provider.TlsKeyMaterialGenerator");
+ put("Alg.Alias.KeyGenerator.SunTls12KeyMaterial",
+ "SunTlsKeyMaterial");
- put("KeyGenerator.SunTlsRsaPremasterSecret",
- "com.sun.crypto.provider.TlsRsaPremasterSecretGenerator");
- put("Alg.Alias.KeyGenerator.SunTls12RsaPremasterSecret",
- "SunTlsRsaPremasterSecret");
+ put("KeyGenerator.SunTlsRsaPremasterSecret",
+ "com.sun.crypto.provider.TlsRsaPremasterSecretGenerator");
+ put("Alg.Alias.KeyGenerator.SunTls12RsaPremasterSecret",
+ "SunTlsRsaPremasterSecret");
- return null;
- }
- });
+ return null;
+ }
+ });
}
}
--- a/jdk/src/share/classes/com/sun/crypto/provider/TlsKeyMaterialGenerator.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/TlsKeyMaterialGenerator.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -31,7 +31,6 @@
import javax.crypto.*;
import javax.crypto.spec.*;
-import sun.security.internal.interfaces.TlsMasterSecret;
import sun.security.internal.spec.*;
import static com.sun.crypto.provider.TlsPrfGenerator.*;
--- a/jdk/src/share/classes/com/sun/crypto/provider/TlsMasterSecretGenerator.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/crypto/provider/TlsMasterSecretGenerator.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -140,6 +140,7 @@
}
private static final class TlsMasterSecretKey implements TlsMasterSecret {
+ private static final long serialVersionUID = 1019571680375368880L;
private byte[] key;
private final int majorVersion, minorVersion;
--- a/jdk/src/share/classes/com/sun/jndi/cosnaming/CNBindingEnumeration.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/cosnaming/CNBindingEnumeration.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -32,8 +32,6 @@
import java.util.Hashtable;
import org.omg.CosNaming.*;
-import org.omg.CosNaming.NamingContextPackage.*;
-import org.omg.CORBA.*;
/**
* Implements the JNDI NamingEnumeration interface for COS
@@ -44,7 +42,8 @@
* @author Rosanna Lee
*/
-final class CNBindingEnumeration implements NamingEnumeration {
+final class CNBindingEnumeration
+ implements NamingEnumeration<javax.naming.Binding> {
private static final int DEFAULT_BATCHSIZE = 100;
private BindingListHolder _bindingList; // list of bindings
@@ -52,105 +51,105 @@
private int counter; // pointer in _bindingList
private int batchsize = DEFAULT_BATCHSIZE; // how many to ask for each time
private CNCtx _ctx; // ctx to list
- private Hashtable _env; // environment for getObjectInstance
+ private Hashtable<?,?> _env; // environment for getObjectInstance
private boolean more = false; // iterator done?
private boolean isLookedUpCtx = false; // iterating on a context beneath this context ?
- /**
- * Creates a CNBindingEnumeration object.
- * @param ctx Context to enumerate
- */
- CNBindingEnumeration(CNCtx ctx, boolean isLookedUpCtx, Hashtable env) {
- // Get batch size to use
- String batch = (env != null ?
- (String)env.get(javax.naming.Context.BATCHSIZE) : null);
- if (batch != null) {
- try {
- batchsize = Integer.parseInt(batch);
- } catch (NumberFormatException e) {
- throw new IllegalArgumentException("Batch size not numeric: " + batch);
+ /**
+ * Creates a CNBindingEnumeration object.
+ * @param ctx Context to enumerate
+ */
+ CNBindingEnumeration(CNCtx ctx, boolean isLookedUpCtx, Hashtable<?,?> env) {
+ // Get batch size to use
+ String batch = (env != null ?
+ (String)env.get(javax.naming.Context.BATCHSIZE) : null);
+ if (batch != null) {
+ try {
+ batchsize = Integer.parseInt(batch);
+ } catch (NumberFormatException e) {
+ throw new IllegalArgumentException("Batch size not numeric: " + batch);
+ }
+ }
+ _ctx = ctx;
+ _ctx.incEnumCount();
+ this.isLookedUpCtx = isLookedUpCtx;
+ _env = env;
+ _bindingList = new BindingListHolder();
+ BindingIteratorHolder _bindingIterH = new BindingIteratorHolder();
+
+ // Perform listing and request that bindings be returned in _bindingIter
+ // Upon return,_bindingList returns a zero length list
+ _ctx._nc.list(0, _bindingList, _bindingIterH);
+
+ _bindingIter = _bindingIterH.value;
+
+ // Get first batch using _bindingIter
+ if (_bindingIter != null) {
+ more = _bindingIter.next_n(batchsize, _bindingList);
+ } else {
+ more = false;
+ }
+ counter = 0;
+ }
+
+ /**
+ * Returns the next binding in the list.
+ * @exception NamingException any naming exception.
+ */
+
+ public javax.naming.Binding next() throws NamingException {
+ if (more && counter >= _bindingList.value.length) {
+ getMore();
+ }
+ if (more && counter < _bindingList.value.length) {
+ org.omg.CosNaming.Binding bndg = _bindingList.value[counter];
+ counter++;
+ return mapBinding(bndg);
+ } else {
+ throw new NoSuchElementException();
}
}
- _ctx = ctx;
- _ctx.incEnumCount();
- this.isLookedUpCtx = isLookedUpCtx;
- _env = env;
- _bindingList = new BindingListHolder();
- BindingIteratorHolder _bindingIterH = new BindingIteratorHolder();
-
- // Perform listing and request that bindings be returned in _bindingIter
- // Upon return,_bindingList returns a zero length list
- _ctx._nc.list(0, _bindingList, _bindingIterH);
-
- _bindingIter = _bindingIterH.value;
-
- // Get first batch using _bindingIter
- if (_bindingIter != null) {
- more = _bindingIter.next_n(batchsize, _bindingList);
- } else {
- more = false;
- }
- counter = 0;
- }
-
- /**
- * Returns the next binding in the list.
- * @exception NamingException any naming exception.
- */
-
- public java.lang.Object next() throws NamingException {
- if (more && counter >= _bindingList.value.length) {
- getMore();
- }
- if (more && counter < _bindingList.value.length) {
- org.omg.CosNaming.Binding bndg = _bindingList.value[counter];
- counter++;
- return mapBinding(bndg);
- } else {
- throw new NoSuchElementException();
- }
- }
- /**
+ /**
* Returns true or false depending on whether there are more bindings.
* @return boolean value
*/
- public boolean hasMore() throws NamingException {
- // If there's more, check whether current bindingList has been exhausted,
- // and if so, try to get more.
- // If no more, just say so.
- return more ? (counter < _bindingList.value.length || getMore()) : false;
- }
+ public boolean hasMore() throws NamingException {
+ // If there's more, check whether current bindingList has been exhausted,
+ // and if so, try to get more.
+ // If no more, just say so.
+ return more ? (counter < _bindingList.value.length || getMore()) : false;
+ }
- /**
- * Returns true or false depending on whether there are more bindings.
- * Need to define this to satisfy the Enumeration api requirement.
- * @return boolean value
- */
+ /**
+ * Returns true or false depending on whether there are more bindings.
+ * Need to define this to satisfy the Enumeration api requirement.
+ * @return boolean value
+ */
- public boolean hasMoreElements() {
- try {
- return hasMore();
- } catch (NamingException e) {
- return false;
- }
- }
+ public boolean hasMoreElements() {
+ try {
+ return hasMore();
+ } catch (NamingException e) {
+ return false;
+ }
+ }
- /**
+ /**
* Returns the next binding in the list.
* @exception NoSuchElementException Thrown when the end of the
* list is reached.
*/
- public java.lang.Object nextElement() {
+ public javax.naming.Binding nextElement() {
try {
return next();
} catch (NamingException ne) {
throw new NoSuchElementException();
}
- }
+ }
public void close() throws NamingException {
more = false;
@@ -197,7 +196,7 @@
return more;
}
- /**
+ /**
* Constructs a JNDI Binding object from the COS Naming binding
* object.
* @exception NameNotFound No objects under the name.
@@ -232,5 +231,5 @@
String fullName = CNNameParser.cosNameToInsString(comps);
jbndg.setNameInNamespace(fullName);
return jbndg;
- }
+ }
}
--- a/jdk/src/share/classes/com/sun/jndi/cosnaming/CNCtx.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/cosnaming/CNCtx.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -30,7 +30,6 @@
import javax.naming.spi.ResolveResult;
import java.util.Hashtable;
-import java.util.Vector;
import java.net.MalformedURLException;
import java.net.URL;
import java.io.InputStream;
@@ -63,7 +62,7 @@
public NamingContext _nc; // public for accessing underlying NamingContext
private NameComponent[] _name = null;
- Hashtable _env; // used by ExceptionMapper
+ Hashtable<String, java.lang.Object> _env; // used by ExceptionMapper
static final CNNameParser parser = new CNNameParser();
private static final String FED_PROP = "com.sun.jndi.cosnaming.federation";
@@ -82,11 +81,12 @@
* @param env Environment properties for initializing name service.
* @exception NamingException Cannot initialize ORB or naming context.
*/
- CNCtx(Hashtable env) throws NamingException {
+ @SuppressWarnings("unchecked")
+ CNCtx(Hashtable<?,?> env) throws NamingException {
if (env != null) {
- env = (Hashtable) env.clone();
+ env = (Hashtable<?,?>)env.clone();
}
- _env = env;
+ _env = (Hashtable<String, java.lang.Object>)env;
federation = "true".equals(env != null ? env.get(FED_PROP) : null);
initOrbAndRootContext(env);
}
@@ -97,13 +97,14 @@
/**
* This method is used by the iiop and iiopname URL Context factories.
*/
- public static ResolveResult createUsingURL(String url, Hashtable env)
+ @SuppressWarnings("unchecked")
+ public static ResolveResult createUsingURL(String url, Hashtable<?,?> env)
throws NamingException {
CNCtx ctx = new CNCtx();
if (env != null) {
- env = (Hashtable) env.clone();
+ env = (Hashtable<?,?>) env.clone();
}
- ctx._env = env;
+ ctx._env = (Hashtable<String, java.lang.Object>)env;
String rest = ctx.initUsingUrl(
env != null ?
(org.omg.CORBA.ORB) env.get("java.naming.corba.orb")
@@ -128,8 +129,8 @@
* @param name The name of this context relative to the root
*/
- CNCtx(ORB orb, OrbReuseTracker tracker, NamingContext nctx, Hashtable env,
- NameComponent[]name)
+ CNCtx(ORB orb, OrbReuseTracker tracker, NamingContext nctx,
+ Hashtable<String, java.lang.Object> env, NameComponent[]name)
throws NamingException {
if (orb == null || nctx == null)
throw new ConfigurationException(
@@ -207,7 +208,7 @@
* @exception NamingException When an error occurs while initializing the
* ORB or the naming context.
*/
- private void initOrbAndRootContext(Hashtable env) throws NamingException {
+ private void initOrbAndRootContext(Hashtable<?,?> env) throws NamingException {
org.omg.CORBA.ORB inOrb = null;
String ncIor = null;
@@ -240,7 +241,7 @@
// If name supplied in URL, resolve it to a NamingContext
if (insName.length() > 0) {
- _name = parser.nameToCosName(parser.parse(insName));
+ _name = CNNameParser.nameToCosName(parser.parse(insName));
try {
org.omg.CORBA.Object obj = _nc.resolve(_name);
_nc = NamingContextHelper.narrow(obj);
@@ -271,7 +272,7 @@
}
- private String initUsingUrl(ORB orb, String url, Hashtable env)
+ private String initUsingUrl(ORB orb, String url, Hashtable<?,?> env)
throws NamingException {
if (url.startsWith("iiop://") || url.startsWith("iiopname://")) {
return initUsingIiopUrl(orb, url, env);
@@ -283,17 +284,14 @@
/**
* Handles "iiop" and "iiopname" URLs (INS 98-10-11)
*/
- private String initUsingIiopUrl(ORB defOrb, String url, Hashtable env)
+ private String initUsingIiopUrl(ORB defOrb, String url, Hashtable<?,?> env)
throws NamingException {
try {
IiopUrl parsedUrl = new IiopUrl(url);
- Vector addrs = parsedUrl.getAddresses();
- IiopUrl.Address addr;
NamingException savedException = null;
- for (int i = 0; i < addrs.size(); i++) {
- addr = (IiopUrl.Address)addrs.elementAt(i);
+ for (IiopUrl.Address addr : parsedUrl.getAddresses()) {
try {
if (defOrb != null) {
@@ -341,7 +339,7 @@
/**
* Initializes using "corbaname" URL (INS 99-12-03)
*/
- private String initUsingCorbanameUrl(ORB orb, String url, Hashtable env)
+ private String initUsingCorbanameUrl(ORB orb, String url, Hashtable<?,?> env)
throws NamingException {
try {
CorbanameUrl parsedUrl = new CorbanameUrl(url);
@@ -731,7 +729,7 @@
// as per JNDI spec
if (leafNotFound(e, path[path.length-1])) {
- ; // do nothing
+ // do nothing
} else {
throw ExceptionMapper.mapException(e, this, path);
}
@@ -829,7 +827,7 @@
* with a non-null argument
* @return a list of name-class objects as a NameClassEnumeration.
*/
- public NamingEnumeration list(String name) throws NamingException {
+ public NamingEnumeration<NameClassPair> list(String name) throws NamingException {
return list(new CompositeName(name));
}
@@ -840,9 +838,10 @@
* @exception NamingException All exceptions thrown by lookup
* @return a list of name-class objects as a NameClassEnumeration.
*/
- public NamingEnumeration list(Name name)
+ @SuppressWarnings("unchecked")
+ public NamingEnumeration<NameClassPair> list(Name name)
throws NamingException {
- return listBindings(name);
+ return (NamingEnumeration)listBindings(name);
}
/**
@@ -852,7 +851,7 @@
* @exception NamingException all exceptions returned by lookup
* @return a list of bindings as a BindingEnumeration.
*/
- public NamingEnumeration listBindings(String name)
+ public NamingEnumeration<javax.naming.Binding> listBindings(String name)
throws NamingException {
return listBindings(new CompositeName(name));
}
@@ -864,7 +863,7 @@
* @exception NamingException all exceptions returned by lookup.
* @return a list of bindings as a BindingEnumeration.
*/
- public NamingEnumeration listBindings(Name name)
+ public NamingEnumeration<javax.naming.Binding> listBindings(Name name)
throws NamingException {
if (_nc == null)
throw new ConfigurationException(
@@ -1064,11 +1063,12 @@
* Returns the current environment.
* @return Environment.
*/
- public Hashtable getEnvironment() throws NamingException {
+ @SuppressWarnings("unchecked")
+ public Hashtable<String, java.lang.Object> getEnvironment() throws NamingException {
if (_env == null) {
- return new Hashtable(5, 0.75f);
+ return new Hashtable<>(5, 0.75f);
} else {
- return (Hashtable)_env.clone();
+ return (Hashtable<String, java.lang.Object>)_env.clone();
}
}
@@ -1090,25 +1090,27 @@
* @param propVal The ORB.
* @return the previous value of this property if any.
*/
+ @SuppressWarnings("unchecked")
public java.lang.Object addToEnvironment(String propName,
java.lang.Object propValue)
throws NamingException {
if (_env == null) {
- _env = new Hashtable(7, 0.75f);
+ _env = new Hashtable<>(7, 0.75f);
} else {
// copy-on-write
- _env = (Hashtable)_env.clone();
+ _env = (Hashtable<String, java.lang.Object>)_env.clone();
}
return _env.put(propName, propValue);
}
// Record change but do not reinitialize ORB
+ @SuppressWarnings("unchecked")
public java.lang.Object removeFromEnvironment(String propName)
throws NamingException {
if (_env != null && _env.get(propName) != null) {
// copy-on-write
- _env = (Hashtable)_env.clone();
+ _env = (Hashtable<String, java.lang.Object>)_env.clone();
return _env.remove(propName);
}
return null;
--- a/jdk/src/share/classes/com/sun/jndi/cosnaming/CNNameParser.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/cosnaming/CNNameParser.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -67,7 +67,7 @@
* @return a non-null CompoundName
*/
public Name parse(String name) throws NamingException {
- Vector comps = insStringToStringifiedComps(name);
+ Vector<String> comps = insStringToStringifiedComps(name);
return new CNCompoundName(comps.elements());
}
@@ -128,11 +128,11 @@
* each element of the vector contains a stringified form of
* a NameComponent.
*/
- private static Vector insStringToStringifiedComps(String str)
+ private static Vector<String> insStringToStringifiedComps(String str)
throws InvalidNameException {
int len = str.length();
- Vector components = new Vector(10);
+ Vector<String> components = new Vector<>(10);
char[] id = new char[len];
char[] kind = new char[len];
int idCount, kindCount;
@@ -306,7 +306,7 @@
* and stringifying code of the default CompoundName.
*/
static final class CNCompoundName extends CompoundName {
- CNCompoundName(Enumeration enum_) {
+ CNCompoundName(Enumeration<String> enum_) {
super(enum_, CNNameParser.mySyntax);
}
@@ -315,12 +315,12 @@
}
public Name getPrefix(int posn) {
- Enumeration comps = super.getPrefix(posn).getAll();
+ Enumeration<String> comps = super.getPrefix(posn).getAll();
return new CNCompoundName(comps);
}
public Name getSuffix(int posn) {
- Enumeration comps = super.getSuffix(posn).getAll();
+ Enumeration<String> comps = super.getSuffix(posn).getAll();
return new CNCompoundName(comps);
}
--- a/jdk/src/share/classes/com/sun/jndi/cosnaming/ExceptionMapper.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/cosnaming/ExceptionMapper.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -102,10 +102,10 @@
private static final NamingException tryFed(NotFound e, CNCtx ctx,
NameComponent[] inputName) throws NamingException {
- NameComponent[] rest = ((NotFound) e).rest_of_name;
+ NameComponent[] rest = e.rest_of_name;
if (debug) {
- System.out.println(((NotFound)e).why.value());
+ System.out.println(e.why.value());
System.out.println(rest.length);
}
--- a/jdk/src/share/classes/com/sun/jndi/cosnaming/IiopUrl.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/cosnaming/IiopUrl.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -68,7 +68,7 @@
static final private int DEFAULT_IIOPNAME_PORT = 9999;
static final private int DEFAULT_IIOP_PORT = 900;
static final private String DEFAULT_HOST = "localhost";
- private Vector addresses;
+ private Vector<Address> addresses;
private String stringName;
public static class Address {
@@ -149,7 +149,7 @@
}
}
- public Vector getAddresses() {
+ public Vector<Address> getAddresses() {
return addresses;
}
@@ -185,7 +185,7 @@
} else {
stringName = UrlUtil.decode(url.substring(addrEnd+1));
}
- addresses = new Vector(3);
+ addresses = new Vector<>(3);
if (oldFormat) {
// Only one host:port part, not multiple
addresses.addElement(
--- a/jdk/src/share/classes/com/sun/jndi/dns/DnsClient.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/dns/DnsClient.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -524,7 +524,7 @@
"\tResponse Q:" + resps);
}
byte[] pkt;
- if ((pkt = (byte[]) resps.get(xid)) != null) {
+ if ((pkt = resps.get(xid)) != null) {
checkResponseCode(new Header(pkt, pkt.length));
synchronized (queuesLock) {
resps.remove(xid);
--- a/jdk/src/share/classes/com/sun/jndi/dns/DnsContext.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/dns/DnsContext.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -47,7 +47,7 @@
DnsName domain; // fully-qualified domain name of this context,
// with a root (empty) label at position 0
- Hashtable environment;
+ Hashtable<Object,Object> environment;
private boolean envShared; // true if environment is possibly shared
// and so must be copied on write
private boolean parentIsDns; // was this DnsContext created by
@@ -95,14 +95,15 @@
* There must be at least one server.
* The environment must not be null; it is cloned before being stored.
*/
- public DnsContext(String domain, String[] servers, Hashtable environment)
+ @SuppressWarnings("unchecked")
+ public DnsContext(String domain, String[] servers, Hashtable<?,?> environment)
throws NamingException {
this.domain = new DnsName(domain.endsWith(".")
? domain
: domain + ".");
this.servers = servers;
- this.environment = (Hashtable) environment.clone();
+ this.environment = (Hashtable<Object,Object>) environment.clone();
envShared = false;
parentIsDns = false;
resolver = null;
@@ -154,14 +155,15 @@
/*
* Override default with a noncloning version.
*/
- protected Hashtable p_getEnvironment() {
+ protected Hashtable<?,?> p_getEnvironment() {
return environment;
}
- public Hashtable getEnvironment() throws NamingException {
- return (Hashtable) environment.clone();
+ public Hashtable<?,?> getEnvironment() throws NamingException {
+ return (Hashtable<?,?>) environment.clone();
}
+ @SuppressWarnings("unchecked")
public Object addToEnvironment(String propName, Object propVal)
throws NamingException {
@@ -189,7 +191,7 @@
return environment.put(propName, propVal);
} else if (environment.get(propName) != propVal) {
// copy on write
- environment = (Hashtable) environment.clone();
+ environment = (Hashtable<Object,Object>) environment.clone();
envShared = false;
return environment.put(propName, propVal);
} else {
@@ -197,6 +199,7 @@
}
}
+ @SuppressWarnings("unchecked")
public Object removeFromEnvironment(String propName)
throws NamingException {
@@ -222,7 +225,7 @@
return environment.remove(propName);
} else if (environment.get(propName) != null) {
// copy-on-write
- environment = (Hashtable) environment.clone();
+ environment = (Hashtable<Object,Object>) environment.clone();
envShared = false;
return environment.remove(propName);
} else {
@@ -307,7 +310,7 @@
return c_lookup(name, cont);
}
- public NamingEnumeration c_list(Name name, Continuation cont)
+ public NamingEnumeration<NameClassPair> c_list(Name name, Continuation cont)
throws NamingException {
cont.setSuccess();
try {
@@ -322,7 +325,7 @@
}
}
- public NamingEnumeration c_listBindings(Name name, Continuation cont)
+ public NamingEnumeration<Binding> c_listBindings(Name name, Continuation cont)
throws NamingException {
cont.setSuccess();
try {
@@ -457,7 +460,7 @@
new OperationNotSupportedException());
}
- public NamingEnumeration c_search(Name name,
+ public NamingEnumeration<SearchResult> c_search(Name name,
Attributes matchingAttributes,
String[] attributesToReturn,
Continuation cont)
@@ -465,7 +468,7 @@
throw new OperationNotSupportedException();
}
- public NamingEnumeration c_search(Name name,
+ public NamingEnumeration<SearchResult> c_search(Name name,
String filter,
SearchControls cons,
Continuation cont)
@@ -473,7 +476,7 @@
throw new OperationNotSupportedException();
}
- public NamingEnumeration c_search(Name name,
+ public NamingEnumeration<SearchResult> c_search(Name name,
String filterExpr,
Object[] filterArgs,
SearchControls cons,
@@ -608,7 +611,7 @@
BasicAttributes attrs = new BasicAttributes(true);
for (int i = 0; i < rrs.answer.size(); i++) {
- ResourceRecord rr = (ResourceRecord) rrs.answer.elementAt(i);
+ ResourceRecord rr = rrs.answer.elementAt(i);
int rrtype = rr.getType();
int rrclass = rr.getRrclass();
@@ -952,19 +955,14 @@
//----------
/*
- * An enumeration of name/classname pairs.
- *
- * Nodes that have children or that are zone cuts are returned with
- * classname DirContext. Other nodes are returned with classname
- * Object even though they are DirContexts as well, since this might
- * make the namespace easier to browse.
+ * Common base class for NameClassPairEnumeration and BindingEnumeration.
*/
-class NameClassPairEnumeration implements NamingEnumeration {
+abstract class BaseNameClassPairEnumeration<T> implements NamingEnumeration<T> {
- protected Enumeration nodes; // nodes to be enumerated, or null if none
+ protected Enumeration<NameNode> nodes; // nodes to be enumerated, or null if none
protected DnsContext ctx; // context being enumerated
- NameClassPairEnumeration(DnsContext ctx, Hashtable nodes) {
+ BaseNameClassPairEnumeration(DnsContext ctx, Hashtable<String,NameNode> nodes) {
this.ctx = ctx;
this.nodes = (nodes != null)
? nodes.elements()
@@ -974,12 +972,12 @@
/*
* ctx will be set to null when no longer needed by the enumeration.
*/
- public void close() {
+ public final void close() {
nodes = null;
ctx = null;
}
- public boolean hasMore() {
+ public final boolean hasMore() {
boolean more = ((nodes != null) && nodes.hasMoreElements());
if (!more) {
close();
@@ -987,11 +985,46 @@
return more;
}
- public Object next() throws NamingException {
+ public final boolean hasMoreElements() {
+ return hasMore();
+ }
+
+ abstract public T next() throws NamingException;
+
+ public final T nextElement() {
+ try {
+ return next();
+ } catch (NamingException e) {
+ java.util.NoSuchElementException nsee =
+ new java.util.NoSuchElementException();
+ nsee.initCause(e);
+ throw nsee;
+ }
+ }
+}
+
+/*
+ * An enumeration of name/classname pairs.
+ *
+ * Nodes that have children or that are zone cuts are returned with
+ * classname DirContext. Other nodes are returned with classname
+ * Object even though they are DirContexts as well, since this might
+ * make the namespace easier to browse.
+ */
+final class NameClassPairEnumeration
+ extends BaseNameClassPairEnumeration<NameClassPair>
+ implements NamingEnumeration<NameClassPair> {
+
+ NameClassPairEnumeration(DnsContext ctx, Hashtable<String,NameNode> nodes) {
+ super(ctx, nodes);
+ }
+
+ @Override
+ public NameClassPair next() throws NamingException {
if (!hasMore()) {
throw new java.util.NoSuchElementException();
}
- NameNode nnode = (NameNode) nodes.nextElement();
+ NameNode nnode = nodes.nextElement();
String className = (nnode.isZoneCut() ||
(nnode.getChildren() != null))
? "javax.naming.directory.DirContext"
@@ -1005,28 +1038,15 @@
ncp.setNameInNamespace(ctx.fullyQualify(cname).toString());
return ncp;
}
-
- public boolean hasMoreElements() {
- return hasMore();
- }
-
- public Object nextElement() {
- try {
- return next();
- } catch (NamingException e) {
- throw (new java.util.NoSuchElementException(
- "javax.naming.NamingException was thrown: " +
- e.getMessage()));
- }
- }
}
/*
* An enumeration of Bindings.
*/
-class BindingEnumeration extends NameClassPairEnumeration {
+final class BindingEnumeration extends BaseNameClassPairEnumeration<Binding>
+ implements NamingEnumeration<Binding> {
- BindingEnumeration(DnsContext ctx, Hashtable nodes) {
+ BindingEnumeration(DnsContext ctx, Hashtable<String,NameNode> nodes) {
super(ctx, nodes);
}
@@ -1035,11 +1055,12 @@
// close();
// }
- public Object next() throws NamingException {
+ @Override
+ public Binding next() throws NamingException {
if (!hasMore()) {
throw (new java.util.NoSuchElementException());
}
- NameNode nnode = (NameNode) nodes.nextElement();
+ NameNode nnode = nodes.nextElement();
String label = nnode.getLabel();
Name compName = (new DnsName()).add(label);
--- a/jdk/src/share/classes/com/sun/jndi/dns/DnsContextFactory.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/dns/DnsContextFactory.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -59,7 +59,7 @@
public Context getInitialContext(Hashtable<?,?> env) throws NamingException {
if (env == null) {
- env = new Hashtable(5);
+ env = new Hashtable<>(5);
}
return urlToContext(getInitCtxUrl(env), env);
}
@@ -75,7 +75,7 @@
* components are overridden by "domain".
*/
public static DnsContext getContext(String domain,
- DnsUrl[] urls, Hashtable env)
+ DnsUrl[] urls, Hashtable<?,?> env)
throws NamingException {
String[] servers = serversForUrls(urls);
@@ -95,7 +95,7 @@
).isEmpty();
}
- private static Context urlToContext(String url, Hashtable env)
+ private static Context urlToContext(String url, Hashtable<?,?> env)
throws NamingException {
DnsUrl[] urls;
@@ -212,7 +212,7 @@
* Reads environment to find URL(s) of initial context.
* Default URL is "dns:".
*/
- private static String getInitCtxUrl(Hashtable env) {
+ private static String getInitCtxUrl(Hashtable<?,?> env) {
String url = (String) env.get(Context.PROVIDER_URL);
return ((url != null) ? url : DEFAULT_URL);
}
@@ -223,34 +223,31 @@
* @param oneIsEnough return output once there exists one ok
* @return the filtered list, all non-permitted input removed
*/
- private static List filterNameServers(List input, boolean oneIsEnough) {
+ private static List<String> filterNameServers(List<String> input, boolean oneIsEnough) {
SecurityManager security = System.getSecurityManager();
if (security == null || input == null || input.isEmpty()) {
return input;
} else {
- List output = new ArrayList();
- for (Object o: input) {
- if (o instanceof String) {
- String platformServer = (String)o;
- int colon = platformServer.indexOf(':',
- platformServer.indexOf(']') + 1);
+ List<String> output = new ArrayList<>();
+ for (String platformServer: input) {
+ int colon = platformServer.indexOf(':',
+ platformServer.indexOf(']') + 1);
- int p = (colon < 0)
- ? DEFAULT_PORT
- : Integer.parseInt(
- platformServer.substring(colon + 1));
- String s = (colon < 0)
- ? platformServer
- : platformServer.substring(0, colon);
- try {
- security.checkConnect(s, p);
- output.add(platformServer);
- if (oneIsEnough) {
- return output;
- }
- } catch (SecurityException se) {
- continue;
+ int p = (colon < 0)
+ ? DEFAULT_PORT
+ : Integer.parseInt(
+ platformServer.substring(colon + 1));
+ String s = (colon < 0)
+ ? platformServer
+ : platformServer.substring(0, colon);
+ try {
+ security.checkConnect(s, p);
+ output.add(platformServer);
+ if (oneIsEnough) {
+ return output;
}
+ } catch (SecurityException se) {
+ continue;
}
}
return output;
--- a/jdk/src/share/classes/com/sun/jndi/dns/DnsName.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/dns/DnsName.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -29,7 +29,6 @@
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Enumeration;
-import java.util.Iterator;
import javax.naming.*;
@@ -111,7 +110,7 @@
// The labels of this domain name, as a list of strings. Index 0
// corresponds to the leftmost (least significant) label: note that
// this is the reverse of the ordering used by the Name interface.
- private ArrayList labels = new ArrayList();
+ private ArrayList<String> labels = new ArrayList<>();
// The number of octets needed to carry this domain name in a DNS
// packet. Equal to the sum of the lengths of each label, plus the
@@ -152,9 +151,7 @@
domain = n.domain;
octets = n.octets;
} else {
- Iterator iter = labels.iterator();
- while (iter.hasNext()) {
- String label = (String) iter.next();
+ for (String label: labels) {
if (label.length() > 0) {
octets += (short) (label.length() + 1);
}
@@ -165,10 +162,8 @@
public String toString() {
if (domain == null) {
- StringBuffer buf = new StringBuffer();
- Iterator iter = labels.iterator();
- while (iter.hasNext()) {
- String label = (String) iter.next();
+ StringBuilder buf = new StringBuilder();
+ for (String label: labels) {
if (buf.length() > 0 || label.length() == 0) {
buf.append('.');
}
@@ -183,9 +178,8 @@
* Does this domain name follow <em>host name</em> syntax?
*/
public boolean isHostName() {
- Iterator iter = labels.iterator();
- while (iter.hasNext()) {
- if (!isHostNameLabel((String) iter.next())) {
+ for (String label: labels) {
+ if (!isHostNameLabel(label)) {
return false;
}
}
@@ -241,16 +235,16 @@
throw new ArrayIndexOutOfBoundsException();
}
int i = size() - pos - 1; // index of "pos" component in "labels"
- return (String) labels.get(i);
+ return labels.get(i);
}
- public Enumeration getAll() {
- return new Enumeration() {
+ public Enumeration<String> getAll() {
+ return new Enumeration<String>() {
int pos = 0;
public boolean hasMoreElements() {
return (pos < size());
}
- public Object nextElement() {
+ public String nextElement() {
if (pos < size()) {
return get(pos++);
}
@@ -276,7 +270,7 @@
throw new ArrayIndexOutOfBoundsException();
}
int i = size() - pos - 1; // index of element to remove in "labels"
- String label = (String) labels.remove(i);
+ String label = labels.remove(i);
int len = label.length();
if (len > 0) {
octets -= (short) (len + 1);
@@ -530,7 +524,7 @@
/*
* Append a label to buf, escaping as needed.
*/
- private static void escape(StringBuffer buf, String label) {
+ private static void escape(StringBuilder buf, String label) {
for (int i = 0; i < label.length(); i++) {
char c = label.charAt(i);
if (c == '.' || c == '\\') {
--- a/jdk/src/share/classes/com/sun/jndi/dns/NameNode.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/dns/NameNode.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -52,7 +52,7 @@
private String label; // name of this node relative to its
// parent, or null for root of a tree
- private Hashtable children = null; // child nodes
+ private Hashtable<String,NameNode> children = null; // child nodes
private boolean isZoneCut = false; // true if this node is a zone cut
private int depth = 0; // depth in tree (0 for root)
@@ -97,7 +97,7 @@
* Returns the children of this node, or null if there are none.
* The caller must not modify the Hashtable returned.
*/
- Hashtable getChildren() {
+ Hashtable<String,NameNode> getChildren() {
return children;
}
@@ -108,7 +108,7 @@
*/
NameNode get(String key) {
return (children != null)
- ? (NameNode) children.get(key)
+ ? children.get(key)
: null;
}
@@ -140,9 +140,9 @@
NameNode child = null;
if (node.children == null) {
- node.children = new Hashtable();
+ node.children = new Hashtable<>();
} else {
- child = (NameNode) node.children.get(key);
+ child = node.children.get(key);
}
if (child == null) {
child = newNameNode(label);
--- a/jdk/src/share/classes/com/sun/jndi/dns/Resolver.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/dns/Resolver.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -125,8 +125,7 @@
}
// Look for an SOA record giving the zone's top node.
for (int i = 0; i < rrs.authority.size(); i++) {
- ResourceRecord rr = (ResourceRecord)
- rrs.authority.elementAt(i);
+ ResourceRecord rr = rrs.authority.elementAt(i);
if (rr.getType() == ResourceRecord.TYPE_SOA) {
DnsName zone = rr.getName();
if (fqdn.endsWith(zone)) {
@@ -152,7 +151,7 @@
ResourceRecords rrs = query(zone, rrclass, ResourceRecord.TYPE_SOA,
recursion, false);
for (int i = 0; i < rrs.answer.size(); i++) {
- ResourceRecord rr = (ResourceRecord) rrs.answer.elementAt(i);
+ ResourceRecord rr = rrs.answer.elementAt(i);
if (rr.getType() == ResourceRecord.TYPE_SOA) {
return rr;
}
@@ -175,8 +174,7 @@
recursion, false);
String[] ns = new String[rrs.answer.size()];
for (int i = 0; i < ns.length; i++) {
- ResourceRecord rr = (ResourceRecord)
- rrs.answer.elementAt(i);
+ ResourceRecord rr = rrs.answer.elementAt(i);
if (rr.getType() != ResourceRecord.TYPE_NS) {
throw new CommunicationException("Corrupted DNS message");
}
--- a/jdk/src/share/classes/com/sun/jndi/dns/ResourceRecords.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/dns/ResourceRecords.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -45,10 +45,10 @@
// Four sections: question, answer, authority, additional.
// The question section is treated as being made up of (shortened)
// resource records, although this isn't technically how it's defined.
- Vector question = new Vector();
- Vector answer = new Vector();
- Vector authority = new Vector();
- Vector additional = new Vector();
+ Vector<ResourceRecord> question = new Vector<>();
+ Vector<ResourceRecord> answer = new Vector<>();
+ Vector<ResourceRecord> authority = new Vector<>();
+ Vector<ResourceRecord> additional = new Vector<>();
/*
* True if these resource records are from a zone transfer. In
@@ -80,7 +80,7 @@
if (answer.size() == 0) {
return -1;
}
- return ((ResourceRecord) answer.firstElement()).getType();
+ return answer.firstElement().getType();
}
/*
@@ -91,7 +91,7 @@
if (answer.size() == 0) {
return -1;
}
- return ((ResourceRecord) answer.lastElement()).getType();
+ return answer.lastElement().getType();
}
/*
--- a/jdk/src/share/classes/com/sun/jndi/dns/ZoneNode.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/dns/ZoneNode.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -55,7 +55,7 @@
class ZoneNode extends NameNode {
- private SoftReference contentsRef = null; // the zone's namespace
+ private SoftReference<NameNode> contentsRef = null; // the zone's namespace
private long serialNumber = -1; // the zone data's serial number
private Date expiration = null; // time when the zone's data expires
@@ -88,7 +88,7 @@
*/
synchronized NameNode getContents() {
return (contentsRef != null)
- ? (NameNode) contentsRef.get()
+ ? contentsRef.get()
: null;
}
@@ -130,7 +130,7 @@
NameNode newContents = new NameNode(null);
for (int i = 0; i < rrs.answer.size(); i++) {
- ResourceRecord rr = (ResourceRecord) rrs.answer.elementAt(i);
+ ResourceRecord rr = rrs.answer.elementAt(i);
DnsName n = rr.getName();
// Ignore resource records whose names aren't within the zone's
@@ -144,9 +144,9 @@
}
}
// The zone's SOA record is the first record in the answer section.
- ResourceRecord soa = (ResourceRecord) rrs.answer.firstElement();
+ ResourceRecord soa = rrs.answer.firstElement();
synchronized (this) {
- contentsRef = new SoftReference(newContents);
+ contentsRef = new SoftReference<NameNode>(newContents);
serialNumber = getSerialNumber(soa);
setExpiration(getMinimumTtl(soa));
return newContents;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java Wed Jul 05 17:49:56 2017 +0200
@@ -0,0 +1,408 @@
+/*
+ * Copyright (c) 1999, 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. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.jndi.ldap;
+
+import com.sun.jndi.toolkit.ctx.Continuation;
+import java.util.NoSuchElementException;
+import java.util.Vector;
+
+import javax.naming.*;
+import javax.naming.directory.Attributes;
+import javax.naming.ldap.Control;
+
+/**
+ * Basic enumeration for NameClassPair, Binding, and SearchResults.
+ */
+
+abstract class AbstractLdapNamingEnumeration<T extends NameClassPair>
+ implements NamingEnumeration<T>, ReferralEnumeration<T> {
+
+ protected Name listArg;
+
+ private boolean cleaned = false;
+ private LdapResult res;
+ private LdapClient enumClnt;
+ private Continuation cont; // used to fill in exceptions
+ private Vector<LdapEntry> entries = null;
+ private int limit = 0;
+ private int posn = 0;
+ protected LdapCtx homeCtx;
+ private LdapReferralException refEx = null;
+ private NamingException errEx = null;
+
+ /*
+ * Record the next set of entries and/or referrals.
+ */
+ AbstractLdapNamingEnumeration(LdapCtx homeCtx, LdapResult answer, Name listArg,
+ Continuation cont) throws NamingException {
+
+ // These checks are to accommodate referrals and limit exceptions
+ // which will generate an enumeration and defer the exception
+ // to be thrown at the end of the enumeration.
+ // All other exceptions are thrown immediately.
+ // Exceptions shouldn't be thrown here anyhow because
+ // process_return_code() is called before the constructor
+ // is called, so these are just safety checks.
+
+ if ((answer.status != LdapClient.LDAP_SUCCESS) &&
+ (answer.status != LdapClient.LDAP_SIZE_LIMIT_EXCEEDED) &&
+ (answer.status != LdapClient.LDAP_TIME_LIMIT_EXCEEDED) &&
+ (answer.status != LdapClient.LDAP_ADMIN_LIMIT_EXCEEDED) &&
+ (answer.status != LdapClient.LDAP_REFERRAL) &&
+ (answer.status != LdapClient.LDAP_PARTIAL_RESULTS)) {
+
+ // %%% need to deal with referral
+ NamingException e = new NamingException(
+ LdapClient.getErrorMessage(
+ answer.status, answer.errorMessage));
+
+ throw cont.fillInException(e);
+ }
+
+ // otherwise continue
+
+ res = answer;
+ entries = answer.entries;
+ limit = (entries == null) ? 0 : entries.size(); // handle empty set
+ this.listArg = listArg;
+ this.cont = cont;
+
+ if (answer.refEx != null) {
+ refEx = answer.refEx;
+ }
+
+ // Ensures that context won't get closed from underneath us
+ this.homeCtx = homeCtx;
+ homeCtx.incEnumCount();
+ enumClnt = homeCtx.clnt; // remember
+ }
+
+ @Override
+ public final T nextElement() {
+ try {
+ return next();
+ } catch (NamingException e) {
+ // can't throw exception
+ cleanup();
+ return null;
+ }
+ }
+
+ @Override
+ public final boolean hasMoreElements() {
+ try {
+ return hasMore();
+ } catch (NamingException e) {
+ // can't throw exception
+ cleanup();
+ return false;
+ }
+ }
+
+ /*
+ * Retrieve the next set of entries and/or referrals.
+ */
+ private void getNextBatch() throws NamingException {
+
+ res = homeCtx.getSearchReply(enumClnt, res);
+ if (res == null) {
+ limit = posn = 0;
+ return;
+ }
+
+ entries = res.entries;
+ limit = (entries == null) ? 0 : entries.size(); // handle empty set
+ posn = 0; // reset
+
+ // mimimize the number of calls to processReturnCode()
+ // (expensive when batchSize is small and there are many results)
+ if ((res.status != LdapClient.LDAP_SUCCESS) ||
+ ((res.status == LdapClient.LDAP_SUCCESS) &&
+ (res.referrals != null))) {
+
+ try {
+ // convert referrals into a chain of LdapReferralException
+ homeCtx.processReturnCode(res, listArg);
+
+ } catch (LimitExceededException | PartialResultException e) {
+ setNamingException(e);
+
+ }
+ }
+
+ // merge any newly received referrals with any current referrals
+ if (res.refEx != null) {
+ if (refEx == null) {
+ refEx = res.refEx;
+ } else {
+ refEx = refEx.appendUnprocessedReferrals(res.refEx);
+ }
+ res.refEx = null; // reset
+ }
+
+ if (res.resControls != null) {
+ homeCtx.respCtls = res.resControls;
+ }
+ }
+
+ private boolean more = true; // assume we have something to start with
+ private boolean hasMoreCalled = false;
+
+ /*
+ * Test if unprocessed entries or referrals exist.
+ */
+ @Override
+ public final boolean hasMore() throws NamingException {
+
+ if (hasMoreCalled) {
+ return more;
+ }
+
+ hasMoreCalled = true;
+
+ if (!more) {
+ return false;
+ } else {
+ return (more = hasMoreImpl());
+ }
+ }
+
+ /*
+ * Retrieve the next entry.
+ */
+ @Override
+ public final T next() throws NamingException {
+
+ if (!hasMoreCalled) {
+ hasMore();
+ }
+ hasMoreCalled = false;
+ return nextImpl();
+ }
+
+ /*
+ * Test if unprocessed entries or referrals exist.
+ */
+ private boolean hasMoreImpl() throws NamingException {
+ // when page size is supported, this
+ // might generate an exception while attempting
+ // to fetch the next batch to determine
+ // whether there are any more elements
+
+ // test if the current set of entries has been processed
+ if (posn == limit) {
+ getNextBatch();
+ }
+
+ // test if any unprocessed entries exist
+ if (posn < limit) {
+ return true;
+ } else {
+
+ try {
+ // try to process another referral
+ return hasMoreReferrals();
+
+ } catch (LdapReferralException |
+ LimitExceededException |
+ PartialResultException e) {
+ cleanup();
+ throw e;
+
+ } catch (NamingException e) {
+ cleanup();
+ PartialResultException pre = new PartialResultException();
+ pre.setRootCause(e);
+ throw pre;
+ }
+ }
+ }
+
+ /*
+ * Retrieve the next entry.
+ */
+ private T nextImpl() throws NamingException {
+ try {
+ return nextAux();
+ } catch (NamingException e) {
+ cleanup();
+ throw cont.fillInException(e);
+ }
+ }
+
+ private T nextAux() throws NamingException {
+ if (posn == limit) {
+ getNextBatch(); // updates posn and limit
+ }
+
+ if (posn >= limit) {
+ cleanup();
+ throw new NoSuchElementException("invalid enumeration handle");
+ }
+
+ LdapEntry result = entries.elementAt(posn++);
+
+ // gets and outputs DN from the entry
+ return createItem(result.DN, result.attributes, result.respCtls);
+ }
+
+ protected final String getAtom(String dn) {
+ // need to strip off all but lowest component of dn
+ // so that is relative to current context (currentDN)
+ try {
+ Name parsed = new LdapName(dn);
+ return parsed.get(parsed.size() - 1);
+ } catch (NamingException e) {
+ return dn;
+ }
+ }
+
+ protected abstract T createItem(String dn, Attributes attrs,
+ Vector<Control> respCtls) throws NamingException;
+
+ /*
+ * Append the supplied (chain of) referrals onto the
+ * end of the current (chain of) referrals.
+ */
+ @Override
+ public void appendUnprocessedReferrals(LdapReferralException ex) {
+ if (refEx != null) {
+ refEx = refEx.appendUnprocessedReferrals(ex);
+ } else {
+ refEx = ex.appendUnprocessedReferrals(refEx);
+ }
+ }
+
+ final void setNamingException(NamingException e) {
+ errEx = e;
+ }
+
+ protected abstract AbstractLdapNamingEnumeration<T> getReferredResults(
+ LdapReferralContext refCtx) throws NamingException;
+
+ /*
+ * Iterate through the URLs of a referral. If successful then perform
+ * a search operation and merge the received results with the current
+ * results.
+ */
+ protected final boolean hasMoreReferrals() throws NamingException {
+
+ if ((refEx != null) &&
+ (refEx.hasMoreReferrals() ||
+ refEx.hasMoreReferralExceptions())) {
+
+ if (homeCtx.handleReferrals == LdapClient.LDAP_REF_THROW) {
+ throw (NamingException)(refEx.fillInStackTrace());
+ }
+
+ // process the referrals sequentially
+ while (true) {
+
+ LdapReferralContext refCtx =
+ (LdapReferralContext)refEx.getReferralContext(
+ homeCtx.envprops, homeCtx.reqCtls);
+
+ try {
+
+ update(getReferredResults(refCtx));
+ break;
+
+ } catch (LdapReferralException re) {
+
+ // record a previous exception
+ if (errEx == null) {
+ errEx = re.getNamingException();
+ }
+ refEx = re;
+ continue;
+
+ } finally {
+ // Make sure we close referral context
+ refCtx.close();
+ }
+ }
+ return hasMoreImpl();
+
+ } else {
+ cleanup();
+
+ if (errEx != null) {
+ throw errEx;
+ }
+ return (false);
+ }
+ }
+
+ /*
+ * Merge the entries and/or referrals from the supplied enumeration
+ * with those of the current enumeration.
+ */
+ protected void update(AbstractLdapNamingEnumeration<T> ne) {
+ // Cleanup previous context first
+ homeCtx.decEnumCount();
+
+ // New enum will have already incremented enum count and recorded clnt
+ homeCtx = ne.homeCtx;
+ enumClnt = ne.enumClnt;
+
+ // Do this to prevent referral enumeration (ne) from decrementing
+ // enum count because we'll be doing that here from this
+ // enumeration.
+ ne.homeCtx = null;
+
+ // Record rest of information from new enum
+ posn = ne.posn;
+ limit = ne.limit;
+ res = ne.res;
+ entries = ne.entries;
+ refEx = ne.refEx;
+ listArg = ne.listArg;
+ }
+
+ protected final void finalize() {
+ cleanup();
+ }
+
+ protected final void cleanup() {
+ if (cleaned) return; // been there; done that
+
+ if(enumClnt != null) {
+ enumClnt.clearSearchReply(res, homeCtx.reqCtls);
+ }
+
+ enumClnt = null;
+ cleaned = true;
+ if (homeCtx != null) {
+ homeCtx.decEnumCount();
+ homeCtx = null;
+ }
+ }
+
+ @Override
+ public final void close() {
+ cleanup();
+ }
+}
--- a/jdk/src/share/classes/com/sun/jndi/ldap/Ber.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/Ber.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -94,12 +94,14 @@
public static final int ASN_ENUMERATED = 0x0a;
final static class EncodeException extends IOException {
+ private static final long serialVersionUID = -5247359637775781768L;
EncodeException(String msg) {
super(msg);
}
}
final static class DecodeException extends IOException {
+ private static final long serialVersionUID = 8735036969244425583L;
DecodeException(String msg) {
super(msg);
}
--- a/jdk/src/share/classes/com/sun/jndi/ldap/ClientId.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/ClientId.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2005, 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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
package com.sun.jndi.ldap;
+import java.util.Locale;
import java.util.Arrays; // JDK 1.2
import java.io.OutputStream;
import javax.naming.ldap.Control;
@@ -71,10 +72,10 @@
ClientId(int version, String hostname, int port, String protocol,
Control[] bindCtls, OutputStream trace, String socketFactory) {
this.version = version;
- this.hostname = hostname.toLowerCase(); // ignore case
+ this.hostname = hostname.toLowerCase(Locale.ENGLISH); // ignore case
this.port = port;
this.protocol = protocol;
- this.bindCtls = (bindCtls != null ? (Control[]) bindCtls.clone() : null);
+ this.bindCtls = (bindCtls != null ? bindCtls.clone() : null);
this.trace = trace;
//
// Needed for custom socket factory pooling
@@ -83,13 +84,15 @@
if ((socketFactory != null) &&
!socketFactory.equals(LdapCtx.DEFAULT_SSL_FACTORY)) {
try {
- Class socketFactoryClass = Obj.helper.loadClass(socketFactory);
- Class objClass = Class.forName("java.lang.Object");
+ Class<?> socketFactoryClass =
+ Obj.helper.loadClass(socketFactory);
+ Class<?> objClass = Class.forName("java.lang.Object");
this.sockComparator = socketFactoryClass.getMethod(
- "compare", new Class[]{objClass, objClass});
- Method getDefault =
- socketFactoryClass.getMethod("getDefault", new Class[]{});
- this.factory = (SocketFactory) getDefault.invoke(null, new Object[]{});
+ "compare", new Class<?>[]{objClass, objClass});
+ Method getDefault = socketFactoryClass.getMethod(
+ "getDefault", new Class<?>[]{});
+ this.factory =
+ (SocketFactory)getDefault.invoke(null, new Object[]{});
} catch (Exception e) {
// Ignore it here, the same exceptions are/will be handled by
// LdapPoolManager and Connection classes.
--- a/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java Wed Jul 05 17:49:56 2017 +0200
@@ -238,27 +238,22 @@
throws NoSuchMethodException {
try {
- Class inetSocketAddressClass =
+ Class<?> inetSocketAddressClass =
Class.forName("java.net.InetSocketAddress");
- Constructor inetSocketAddressCons =
- inetSocketAddressClass.getConstructor(new Class[]{
+ Constructor<?> inetSocketAddressCons =
+ inetSocketAddressClass.getConstructor(new Class<?>[]{
String.class, int.class});
return inetSocketAddressCons.newInstance(new Object[]{
host, new Integer(port)});
- } catch (ClassNotFoundException e) {
- throw new NoSuchMethodException();
-
- } catch (InstantiationException e) {
+ } catch (ClassNotFoundException |
+ InstantiationException |
+ InvocationTargetException |
+ IllegalAccessException e) {
throw new NoSuchMethodException();
- } catch (InvocationTargetException e) {
- throw new NoSuchMethodException();
-
- } catch (IllegalAccessException e) {
- throw new NoSuchMethodException();
}
}
@@ -280,9 +275,9 @@
// create the factory
- Class socketFactoryClass = Obj.helper.loadClass(socketFactory);
+ Class<?> socketFactoryClass = Obj.helper.loadClass(socketFactory);
Method getDefault =
- socketFactoryClass.getMethod("getDefault", new Class[]{});
+ socketFactoryClass.getMethod("getDefault", new Class<?>[]{});
Object factory = getDefault.invoke(null, new Object[]{});
// create the socket
@@ -293,10 +288,10 @@
try {
createSocket = socketFactoryClass.getMethod("createSocket",
- new Class[]{});
+ new Class<?>[]{});
Method connect = Socket.class.getMethod("connect",
- new Class[]{Class.forName("java.net.SocketAddress"),
+ new Class<?>[]{Class.forName("java.net.SocketAddress"),
int.class});
Object endpoint = createInetSocketAddress(host, port);
@@ -320,7 +315,7 @@
if (socket == null) {
createSocket = socketFactoryClass.getMethod("createSocket",
- new Class[]{String.class, int.class});
+ new Class<?>[]{String.class, int.class});
if (debug) {
System.err.println("Connection: creating socket using " +
@@ -335,15 +330,15 @@
if (connectTimeout > 0) {
try {
- Constructor socketCons =
- Socket.class.getConstructor(new Class[]{});
+ Constructor<Socket> socketCons =
+ Socket.class.getConstructor(new Class<?>[]{});
Method connect = Socket.class.getMethod("connect",
- new Class[]{Class.forName("java.net.SocketAddress"),
+ new Class<?>[]{Class.forName("java.net.SocketAddress"),
int.class});
Object endpoint = createInetSocketAddress(host, port);
- socket = (Socket) socketCons.newInstance(new Object[]{});
+ socket = socketCons.newInstance(new Object[]{});
if (debug) {
System.err.println("Connection: creating socket with " +
--- a/jdk/src/share/classes/com/sun/jndi/ldap/DigestClientId.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/DigestClientId.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2005, 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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -65,7 +65,7 @@
DigestClientId(int version, String hostname, int port,
String protocol, Control[] bindCtls, OutputStream trace,
String socketFactory, String username,
- Object passwd, Hashtable env) {
+ Object passwd, Hashtable<?,?> env) {
super(version, hostname, port, protocol, bindCtls, trace,
socketFactory, username, passwd);
--- a/jdk/src/share/classes/com/sun/jndi/ldap/EventQueue.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/EventQueue.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -25,7 +25,6 @@
package com.sun.jndi.ldap;
-import java.io.*;
import java.util.Vector;
import java.util.EventObject;
@@ -52,9 +51,9 @@
QueueElement next = null;
QueueElement prev = null;
EventObject event = null;
- Vector vector = null;
+ Vector<NamingListener> vector = null;
- QueueElement(EventObject event, Vector vector) {
+ QueueElement(EventObject event, Vector<NamingListener> vector) {
this.event = event;
this.vector = vector;
}
@@ -87,7 +86,7 @@
* are notified.
* @param vector List of NamingListeners that will be notified of event.
*/
- synchronized void enqueue(EventObject event, Vector vector) {
+ synchronized void enqueue(EventObject event, Vector<NamingListener> vector) {
QueueElement newElt = new QueueElement(event, vector);
if (head == null) {
@@ -133,7 +132,7 @@
try {
while ((qe = dequeue()) != null) {
EventObject e = qe.event;
- Vector v = qe.vector;
+ Vector<NamingListener> v = qe.vector;
for (int i = 0; i < v.size(); i++) {
@@ -145,12 +144,11 @@
// only enqueue events with listseners of the correct type.
if (e instanceof NamingEvent) {
- ((NamingEvent)e).dispatch((NamingListener)v.elementAt(i));
+ ((NamingEvent)e).dispatch(v.elementAt(i));
// An exception occurred: if notify all naming listeners
} else if (e instanceof NamingExceptionEvent) {
- ((NamingExceptionEvent)e).dispatch(
- (NamingListener)v.elementAt(i));
+ ((NamingExceptionEvent)e).dispatch(v.elementAt(i));
} else if (e instanceof UnsolicitedNotificationEvent) {
((UnsolicitedNotificationEvent)e).dispatch(
(UnsolicitedNotificationListener)v.elementAt(i));
--- a/jdk/src/share/classes/com/sun/jndi/ldap/EventSupport.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/EventSupport.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -27,11 +27,9 @@
import java.util.Hashtable;
import java.util.Vector;
-import java.util.Enumeration;
import java.util.EventObject;
import javax.naming.*;
-import javax.naming.directory.*;
import javax.naming.event.*;
import javax.naming.directory.SearchControls;
import javax.naming.ldap.UnsolicitedNotificationListener;
@@ -120,12 +118,13 @@
/**
* NamingEventNotifiers; hashed by search arguments;
*/
- private Hashtable notifiers = new Hashtable(11);
+ private Hashtable<NotifierArgs, NamingEventNotifier> notifiers =
+ new Hashtable<>(11);
/**
* List of unsolicited notification listeners.
*/
- private Vector unsolicited = null;
+ private Vector<UnsolicitedNotificationListener> unsolicited = null;
/**
* Constructs EventSupport for ctx.
@@ -155,8 +154,7 @@
l instanceof NamespaceChangeListener) {
NotifierArgs args = new NotifierArgs(nm, scope, l);
- NamingEventNotifier notifier =
- (NamingEventNotifier) notifiers.get(args);
+ NamingEventNotifier notifier = notifiers.get(args);
if (notifier == null) {
notifier = new NamingEventNotifier(this, ctx, args, l);
notifiers.put(args, notifier);
@@ -167,10 +165,10 @@
if (l instanceof UnsolicitedNotificationListener) {
// Add listener to this's list of unsolicited notifiers
if (unsolicited == null) {
- unsolicited = new Vector(3);
+ unsolicited = new Vector<>(3);
}
- unsolicited.addElement(l);
+ unsolicited.addElement((UnsolicitedNotificationListener)l);
}
}
@@ -185,8 +183,7 @@
l instanceof NamespaceChangeListener) {
NotifierArgs args = new NotifierArgs(nm, filter, ctls, l);
- NamingEventNotifier notifier =
- (NamingEventNotifier) notifiers.get(args);
+ NamingEventNotifier notifier = notifiers.get(args);
if (notifier == null) {
notifier = new NamingEventNotifier(this, ctx, args, l);
notifiers.put(args, notifier);
@@ -197,9 +194,9 @@
if (l instanceof UnsolicitedNotificationListener) {
// Add listener to this's list of unsolicited notifiers
if (unsolicited == null) {
- unsolicited = new Vector(3);
+ unsolicited = new Vector<>(3);
}
- unsolicited.addElement(l);
+ unsolicited.addElement((UnsolicitedNotificationListener)l);
}
}
@@ -207,15 +204,11 @@
* Removes <tt>l</tt> from all notifiers in this context.
*/
synchronized void removeNamingListener(NamingListener l) {
- Enumeration allnotifiers = notifiers.elements();
- NamingEventNotifier notifier;
-
if (debug) System.err.println("EventSupport removing listener");
// Go through list of notifiers, remove 'l' from each.
// If 'l' is notifier's only listener, remove notifier too.
- while (allnotifiers.hasMoreElements()) {
- notifier = (NamingEventNotifier)allnotifiers.nextElement();
+ for (NamingEventNotifier notifier : notifiers.values()) {
if (notifier != null) {
if (debug)
System.err.println("EventSupport removing listener from notifier");
@@ -305,8 +298,8 @@
synchronized void cleanup() {
if (debug) System.err.println("EventSupport clean up");
if (notifiers != null) {
- for (Enumeration ns = notifiers.elements(); ns.hasMoreElements(); ) {
- ((NamingEventNotifier) ns.nextElement()).stop();
+ for (NamingEventNotifier notifier : notifiers.values()) {
+ notifier.stop();
}
notifiers = null;
}
@@ -328,7 +321,8 @@
* them to the registered listeners.
* Package private; used by NamingEventNotifier to fire events
*/
- synchronized void queueEvent(EventObject event, Vector vector) {
+ synchronized void queueEvent(EventObject event,
+ Vector<? extends NamingListener> vector) {
if (eventQueue == null)
eventQueue = new EventQueue();
@@ -340,7 +334,9 @@
* of this event will not take effect until after the event is
* delivered.
*/
- Vector v = (Vector)vector.clone();
+ @SuppressWarnings("unchecked") // clone()
+ Vector<NamingListener> v =
+ (Vector<NamingListener>)vector.clone();
eventQueue.enqueue(event, v);
}
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapAttribute.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapAttribute.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -26,8 +26,6 @@
package com.sun.jndi.ldap;
import java.io.IOException;
-import java.io.Serializable;
-import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Vector;
import javax.naming.*;
@@ -50,11 +48,12 @@
// these two are used to reconstruct the baseCtx if this attribute has
// been serialized (
private String baseCtxURL;
- private Hashtable baseCtxEnv;
+ private Hashtable<String, ? super String> baseCtxEnv;
+ @SuppressWarnings("unchecked") // clone()
public Object clone() {
LdapAttribute attr = new LdapAttribute(this.attrID, baseCtx, rdn);
- attr.values = (Vector)values.clone();
+ attr.values = (Vector<Object>)values.clone();
return attr;
}
@@ -112,7 +111,7 @@
private DirContext getBaseCtx() throws NamingException {
if(baseCtx == null) {
if (baseCtxEnv == null) {
- baseCtxEnv = new Hashtable(3);
+ baseCtxEnv = new Hashtable<String, String>(3);
}
baseCtxEnv.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
@@ -144,9 +143,10 @@
* we are serialized. This must be called _before_ the object is
* serialized!!!
*/
+ @SuppressWarnings("unchecked") // clone()
private void setBaseCtxInfo() {
- Hashtable realEnv = null;
- Hashtable secureEnv = null;
+ Hashtable<String, Object> realEnv = null;
+ Hashtable<String, Object> secureEnv = null;
if (baseCtx != null) {
realEnv = ((LdapCtx)baseCtx).envprops;
@@ -156,16 +156,14 @@
if(realEnv != null && realEnv.size() > 0 ) {
// remove any security credentials - otherwise the serialized form
// would store them in the clear
- Enumeration keys = realEnv.keys();
- while(keys.hasMoreElements()) {
- String key = (String)keys.nextElement();
+ for (String key : realEnv.keySet()){
if (key.indexOf("security") != -1 ) {
//if we need to remove props, we must do it to a clone
//of the environment. cloning is expensive, so we only do
//it if we have to.
if(secureEnv == null) {
- secureEnv = (Hashtable)realEnv.clone();
+ secureEnv = (Hashtable<String, Object>)realEnv.clone();
}
secureEnv.remove(key);
}
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapBindingEnumeration.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapBindingEnumeration.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -28,11 +28,13 @@
import java.util.Vector;
import javax.naming.*;
import javax.naming.directory.*;
+import javax.naming.ldap.Control;
import javax.naming.spi.*;
import com.sun.jndi.toolkit.ctx.Continuation;
-final class LdapBindingEnumeration extends LdapNamingEnumeration {
+final class LdapBindingEnumeration
+ extends AbstractLdapNamingEnumeration<Binding> {
LdapBindingEnumeration(LdapCtx homeCtx, LdapResult answer, Name remain,
Continuation cont) throws NamingException
@@ -40,8 +42,9 @@
super(homeCtx, answer, remain, cont);
}
- protected NameClassPair
- createItem(String dn, Attributes attrs, Vector respCtls)
+ @Override
+ protected Binding
+ createItem(String dn, Attributes attrs, Vector<Control> respCtls)
throws NamingException {
Object obj = null;
@@ -85,9 +88,10 @@
return binding;
}
- protected LdapNamingEnumeration
- getReferredResults(LdapReferralContext refCtx) throws NamingException{
+ @Override
+ protected LdapBindingEnumeration getReferredResults(
+ LdapReferralContext refCtx) throws NamingException{
// repeat the original operation at the new context
- return (LdapNamingEnumeration) refCtx.listBindings(listArg);
+ return (LdapBindingEnumeration)refCtx.listBindings(listArg);
}
}
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapClient.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapClient.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,8 +25,8 @@
package com.sun.jndi.ldap;
-import java.net.*;
import java.io.*;
+import java.util.Locale;
import java.util.Vector;
import java.util.Hashtable;
@@ -81,7 +81,8 @@
static final boolean caseIgnore = true;
// Default list of binary attributes
- private static final Hashtable defaultBinaryAttrs = new Hashtable(23,0.75f);
+ private static final Hashtable<String, Boolean> defaultBinaryAttrs =
+ new Hashtable<>(23,0.75f);
static {
defaultBinaryAttrs.put("userpassword", Boolean.TRUE); //2.5.4.35
defaultBinaryAttrs.put("javaserializeddata", Boolean.TRUE);
@@ -146,7 +147,7 @@
synchronized LdapResult
authenticate(boolean initial, String name, Object pw, int version,
- String authMechanism, Control[] ctls, Hashtable env)
+ String authMechanism, Control[] ctls, Hashtable<?,?> env)
throws NamingException {
authenticateCalled = true;
@@ -516,8 +517,8 @@
LdapResult search(String dn, int scope, int deref, int sizeLimit,
int timeLimit, boolean attrsOnly, String attrs[],
String filter, int batchSize, Control[] reqCtls,
- Hashtable binaryAttrs, boolean waitFirstReply,
- int replyQueueCapacity)
+ Hashtable<String, Boolean> binaryAttrs,
+ boolean waitFirstReply, int replyQueueCapacity)
throws IOException, NamingException {
ensureOpen();
@@ -586,7 +587,7 @@
* Retrieve the next batch of entries and/or referrals.
*/
LdapResult getSearchReply(int batchSize, LdapResult res,
- Hashtable binaryAttrs) throws IOException, NamingException {
+ Hashtable<String, Boolean> binaryAttrs) throws IOException, NamingException {
ensureOpen();
@@ -600,7 +601,7 @@
}
private LdapResult getSearchReply(LdapRequest req,
- int batchSize, LdapResult res, Hashtable binaryAttrs)
+ int batchSize, LdapResult res, Hashtable<String, Boolean> binaryAttrs)
throws IOException, NamingException {
if (batchSize == 0)
@@ -610,7 +611,7 @@
res.entries.setSize(0); // clear the (previous) set of entries
} else {
res.entries =
- new Vector(batchSize == Integer.MAX_VALUE ? 32 : batchSize);
+ new Vector<>(batchSize == Integer.MAX_VALUE ? 32 : batchSize);
}
if (res.referrals != null) {
@@ -660,7 +661,7 @@
} else if ((seq == LDAP_REP_SEARCH_REF) && isLdapv3) {
// handle LDAPv3 search reference
- Vector URLs = new Vector(4);
+ Vector<String> URLs = new Vector<>(4);
// %%% Although not strictly correct, some LDAP servers
// encode the SEQUENCE OF tag in the SearchResultRef
@@ -676,7 +677,7 @@
}
if (res.referrals == null) {
- res.referrals = new Vector(4);
+ res.referrals = new Vector<>(4);
}
res.referrals.addElement(URLs);
res.resControls = isLdapv3 ? parseControls(replyBer) : null;
@@ -700,7 +701,8 @@
return res;
}
- private Attribute parseAttribute(BerDecoder ber, Hashtable binaryAttrs)
+ private Attribute parseAttribute(BerDecoder ber,
+ Hashtable<String, Boolean> binaryAttrs)
throws IOException {
int len[] = new int[1];
@@ -737,13 +739,15 @@
if (hasBinaryValues) {
la.add(ber.parseOctetString(ber.peekByte(), len));
} else {
- la.add(ber.parseStringWithTag(Ber.ASN_SIMPLE_STRING, isLdapv3, len));
+ la.add(ber.parseStringWithTag(
+ Ber.ASN_SIMPLE_STRING, isLdapv3, len));
}
return len[0];
}
- private boolean isBinaryValued(String attrid, Hashtable binaryAttrs) {
- String id = attrid.toLowerCase();
+ private boolean isBinaryValued(String attrid,
+ Hashtable<String, Boolean> binaryAttrs) {
+ String id = attrid.toLowerCase(Locale.ENGLISH);
return ((id.indexOf(";binary") != -1) ||
defaultBinaryAttrs.containsKey(id) ||
@@ -751,8 +755,8 @@
}
// package entry point; used by Connection
- static void parseResult(BerDecoder replyBer, LdapResult res, boolean isLdapv3)
- throws IOException {
+ static void parseResult(BerDecoder replyBer, LdapResult res,
+ boolean isLdapv3) throws IOException {
res.status = replyBer.parseEnumeration();
res.matchedDN = replyBer.parseString(isLdapv3);
@@ -763,7 +767,7 @@
(replyBer.bytesLeft() > 0) &&
(replyBer.peekByte() == LDAP_REP_REFERRAL)) {
- Vector URLs = new Vector(4);
+ Vector<String> URLs = new Vector<>(4);
int[] seqlen = new int[1];
replyBer.parseSeq(seqlen);
@@ -775,18 +779,18 @@
}
if (res.referrals == null) {
- res.referrals = new Vector(4);
+ res.referrals = new Vector<>(4);
}
res.referrals.addElement(URLs);
}
}
// package entry point; used by Connection
- static Vector parseControls(BerDecoder replyBer) throws IOException {
+ static Vector<Control> parseControls(BerDecoder replyBer) throws IOException {
// handle LDAPv3 controls (if present)
if ((replyBer.bytesLeft() > 0) && (replyBer.peekByte() == LDAP_CONTROLS)) {
- Vector ctls = new Vector(4);
+ Vector<Control> ctls = new Vector<>(4);
String controlOID;
boolean criticality = false; // default
byte[] controlValue = null; // optional
@@ -957,7 +961,7 @@
ber.beginSeq(Ber.ASN_SEQUENCE | Ber.ASN_CONSTRUCTOR);
ber.encodeString(attr.getID(), isLdapv3);
ber.beginSeq(Ber.ASN_SEQUENCE | Ber.ASN_CONSTRUCTOR | 1);
- NamingEnumeration enum_ = attr.getAll();
+ NamingEnumeration<?> enum_ = attr.getAll();
Object val;
while (enum_.hasMore()) {
val = enum_.next();
@@ -1007,9 +1011,10 @@
ber.beginSeq(LDAP_REQ_ADD);
ber.encodeString(entry.DN, isLdapv3);
ber.beginSeq(Ber.ASN_SEQUENCE | Ber.ASN_CONSTRUCTOR);
- NamingEnumeration enum_ = entry.attributes.getAll();
+ NamingEnumeration<? extends Attribute> enum_ =
+ entry.attributes.getAll();
while (enum_.hasMore()) {
- attr = (Attribute)enum_.next();
+ attr = enum_.next();
// zero values is not permitted
if (hasNoValue(attr)) {
@@ -1474,7 +1479,7 @@
// removeUnsolicited() is invoked to remove an LdapCtx from this client.
//
////////////////////////////////////////////////////////////////////////////
- private Vector unsolicited = new Vector(3);
+ private Vector<LdapCtx> unsolicited = new Vector<>(3);
void addUnsolicited(LdapCtx ctx) {
if (debug > 0) {
System.err.println("LdapClient.addUnsolicited" + ctx);
@@ -1500,70 +1505,70 @@
if (debug > 0) {
System.err.println("LdapClient.processUnsolicited");
}
- synchronized (unsolicited) {
- try {
- // Parse the response
- LdapResult res = new LdapResult();
+ synchronized (unsolicited) {
+ try {
+ // Parse the response
+ LdapResult res = new LdapResult();
- ber.parseSeq(null); // init seq
- ber.parseInt(); // msg id; should be 0; ignored
- if (ber.parseByte() != LDAP_REP_EXTENSION) {
- throw new IOException(
- "Unsolicited Notification must be an Extended Response");
- }
- ber.parseLength();
- parseExtResponse(ber, res);
+ ber.parseSeq(null); // init seq
+ ber.parseInt(); // msg id; should be 0; ignored
+ if (ber.parseByte() != LDAP_REP_EXTENSION) {
+ throw new IOException(
+ "Unsolicited Notification must be an Extended Response");
+ }
+ ber.parseLength();
+ parseExtResponse(ber, res);
- if (DISCONNECT_OID.equals(res.extensionId)) {
- // force closing of connection
- forceClose(pooled);
- }
+ if (DISCONNECT_OID.equals(res.extensionId)) {
+ // force closing of connection
+ forceClose(pooled);
+ }
- if (unsolicited.size() > 0) {
- // Create an UnsolicitedNotification using the parsed data
- // Need a 'ctx' object because we want to use the context's
- // list of provider control factories.
- UnsolicitedNotification notice = new UnsolicitedResponseImpl(
- res.extensionId,
- res.extensionValue,
- res.referrals,
- res.status,
- res.errorMessage,
- res.matchedDN,
- (res.resControls != null) ?
- ((LdapCtx)unsolicited.elementAt(0)).convertControls(res.resControls) :
- null);
+ if (unsolicited.size() > 0) {
+ // Create an UnsolicitedNotification using the parsed data
+ // Need a 'ctx' object because we want to use the context's
+ // list of provider control factories.
+ UnsolicitedNotification notice = new UnsolicitedResponseImpl(
+ res.extensionId,
+ res.extensionValue,
+ res.referrals,
+ res.status,
+ res.errorMessage,
+ res.matchedDN,
+ (res.resControls != null) ?
+ unsolicited.elementAt(0).convertControls(res.resControls) :
+ null);
- // Fire UnsolicitedNotification events to listeners
- notifyUnsolicited(notice);
+ // Fire UnsolicitedNotification events to listeners
+ notifyUnsolicited(notice);
- // If "disconnect" notification,
- // notify unsolicited listeners via NamingException
- if (DISCONNECT_OID.equals(res.extensionId)) {
- notifyUnsolicited(
- new CommunicationException("Connection closed"));
+ // If "disconnect" notification,
+ // notify unsolicited listeners via NamingException
+ if (DISCONNECT_OID.equals(res.extensionId)) {
+ notifyUnsolicited(
+ new CommunicationException("Connection closed"));
+ }
}
- }
- } catch (IOException e) {
- if (unsolicited.size() == 0)
- return; // no one registered; ignore
+ } catch (IOException e) {
+ if (unsolicited.size() == 0)
+ return; // no one registered; ignore
- NamingException ne = new CommunicationException(
- "Problem parsing unsolicited notification");
- ne.setRootCause(e);
+ NamingException ne = new CommunicationException(
+ "Problem parsing unsolicited notification");
+ ne.setRootCause(e);
- notifyUnsolicited(ne);
+ notifyUnsolicited(ne);
- } catch (NamingException e) {
- notifyUnsolicited(e);
+ } catch (NamingException e) {
+ notifyUnsolicited(e);
+ }
}
- }
}
private void notifyUnsolicited(Object e) {
for (int i = 0; i < unsolicited.size(); i++) {
- ((LdapCtx)unsolicited.elementAt(i)).fireUnsolicited(e);
+ unsolicited.elementAt(i).fireUnsolicited(e);
}
if (e instanceof NamingException) {
unsolicited.setSize(0); // no more listeners after exception
@@ -1584,7 +1589,7 @@
static LdapClient getInstance(boolean usePool, String hostname, int port,
String factory, int connectTimeout, int readTimeout, OutputStream trace,
int version, String authMechanism, Control[] ctls, String protocol,
- String user, Object passwd, Hashtable env) throws NamingException {
+ String user, Object passwd, Hashtable<?,?> env) throws NamingException {
if (usePool) {
if (LdapPoolManager.isPoolingAllowed(factory, trace,
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java Wed Jul 05 17:49:56 2017 +0200
@@ -33,6 +33,7 @@
import javax.naming.ldap.LdapName;
import javax.naming.ldap.Rdn;
+import java.util.Locale;
import java.util.Vector;
import java.util.Hashtable;
import java.util.List;
@@ -223,7 +224,7 @@
String hostname = null; // host name of server (no brackets
// for IPv6 literals)
LdapClient clnt = null; // connection handle
- Hashtable envprops = null; // environment properties of context
+ Hashtable<String, java.lang.Object> envprops = null; // environment properties of context
int handleReferrals = DEFAULT_REFERRAL_MODE; // how referral is handled
boolean hasLdapsScheme = false; // true if the context was created
// using an LDAPS URL.
@@ -232,7 +233,7 @@
String currentDN; // DN of this context
Name currentParsedDN; // DN of this context
- Vector respCtls = null; // Response controls read
+ Vector<Control> respCtls = null; // Response controls read
Control[] reqCtls = null; // Controls to be sent with each request
@@ -244,14 +245,14 @@
private boolean netscapeSchemaBug = false; // workaround
private Control[] bindCtls = null; // Controls to be sent with LDAP "bind"
private int referralHopLimit = DEFAULT_REFERRAL_LIMIT; // max referral
- private Hashtable schemaTrees = null; // schema root of this context
+ private Hashtable<String, DirContext> schemaTrees = null; // schema root of this context
private int batchSize = DEFAULT_BATCH_SIZE; // batch size for search results
private boolean deleteRDN = DEFAULT_DELETE_RDN; // delete the old RDN when modifying DN
private boolean typesOnly = DEFAULT_TYPES_ONLY; // return attribute types (no values)
private int derefAliases = DEFAULT_DEREF_ALIASES;// de-reference alias entries during searching
private char addrEncodingSeparator = DEFAULT_REF_SEPARATOR; // encoding RefAddr
- private Hashtable binaryAttrs = null; // attr values returned as byte[]
+ private Hashtable<String, Boolean> binaryAttrs = null; // attr values returned as byte[]
private int connectTimeout = -1; // no timeout value
private int readTimeout = -1; // no timeout value
private boolean waitForReply = true; // wait for search response
@@ -272,13 +273,15 @@
// -------------- Constructors -----------------------------------
- public LdapCtx(String dn, String host, int port_number, Hashtable props,
+ @SuppressWarnings("unchecked")
+ public LdapCtx(String dn, String host, int port_number,
+ Hashtable<?,?> props,
boolean useSsl) throws NamingException {
this.useSsl = this.hasLdapsScheme = useSsl;
if (props != null) {
- envprops = (Hashtable) props.clone();
+ envprops = (Hashtable<String, java.lang.Object>) props.clone();
// SSL env prop overrides the useSsl argument
if ("ssl".equals(envprops.get(Context.SECURITY_PROTOCOL))) {
@@ -310,7 +313,7 @@
this.useDefaultPortNumber = true;
}
- schemaTrees = new Hashtable(11, 0.75f);
+ schemaTrees = new Hashtable<>(11, 0.75f);
initEnv();
try {
connect(false);
@@ -557,9 +560,7 @@
if (answer.resControls != null) {
respCtls = appendVector(respCtls, answer.resControls);
}
- } catch (NamingException ae) {
- addEx = ae;
- } catch (IOException ae) {
+ } catch (NamingException | IOException ae) {
addEx = ae;
}
@@ -918,19 +919,17 @@
}
// Parse string name into list of RDNs
- //List<Rdn> rdnList = (new LdapName(dn)).rdns();
- List rdnList = (new LdapName(dn)).getRdns();
+ List<Rdn> rdnList = (new LdapName(dn)).getRdns();
// Get leaf RDN
- //Rdn rdn = rdnList.get(rdnList.size() - 1);
- Rdn rdn = (Rdn) rdnList.get(rdnList.size() - 1);
+ Rdn rdn = rdnList.get(rdnList.size() - 1);
Attributes nameAttrs = rdn.toAttributes();
// Add attributes of RDN to attrs if not already there
- NamingEnumeration enum_ = nameAttrs.getAll();
+ NamingEnumeration<? extends Attribute> enum_ = nameAttrs.getAll();
Attribute nameAttr;
while (enum_.hasMore()) {
- nameAttr = (Attribute) enum_.next();
+ nameAttr = enum_.next();
// If attrs already has the attribute, don't change or add to it
if (attrs.get(nameAttr.getID()) == null) {
@@ -961,12 +960,12 @@
}
- private static boolean containsIgnoreCase(NamingEnumeration enumStr,
+ private static boolean containsIgnoreCase(NamingEnumeration<String> enumStr,
String str) throws NamingException {
String strEntry;
while (enumStr.hasMore()) {
- strEntry = (String) enumStr.next();
+ strEntry = enumStr.next();
if (strEntry.equalsIgnoreCase(str)) {
return true;
}
@@ -993,7 +992,7 @@
* Append the the second Vector onto the first Vector
* (v2 must be non-null)
*/
- private static Vector appendVector(Vector v1, Vector v2) {
+ private static <T> Vector<T> appendVector(Vector<T> v1, Vector<T> v2) {
if (v1 == null) {
v1 = v2;
} else {
@@ -1038,10 +1037,10 @@
// found it but got no attributes
attrs = new BasicAttributes(LdapClient.caseIgnore);
} else {
- LdapEntry entry = (LdapEntry)answer.entries.elementAt(0);
+ LdapEntry entry = answer.entries.elementAt(0);
attrs = entry.attributes;
- Vector entryCtls = entry.respCtls; // retrieve entry controls
+ Vector<Control> entryCtls = entry.respCtls; // retrieve entry controls
if (entryCtls != null) {
appendVector(respCtls, entryCtls); // concatenate controls
}
@@ -1097,7 +1096,7 @@
}
}
- protected NamingEnumeration c_list(Name name, Continuation cont)
+ protected NamingEnumeration<NameClassPair> c_list(Name name, Continuation cont)
throws NamingException {
SearchControls cons = new SearchControls();
String[] classAttrs = new String[2];
@@ -1170,7 +1169,7 @@
}
}
- protected NamingEnumeration c_listBindings(Name name, Continuation cont)
+ protected NamingEnumeration<Binding> c_listBindings(Name name, Continuation cont)
throws NamingException {
SearchControls cons = new SearchControls();
@@ -1198,7 +1197,7 @@
// process the referrals sequentially
while (true) {
-
+ @SuppressWarnings("unchecked")
LdapReferralContext refCtx =
(LdapReferralContext)e.getReferralContext(envprops, bindCtls);
@@ -1220,16 +1219,14 @@
LdapBindingEnumeration res =
new LdapBindingEnumeration(this, answer, name, cont);
- res.setNamingException(
- (LimitExceededException)cont.fillInException(e));
+ res.setNamingException(cont.fillInException(e));
return res;
} catch (PartialResultException e) {
LdapBindingEnumeration res =
new LdapBindingEnumeration(this, answer, name, cont);
- res.setNamingException(
- (PartialResultException)cont.fillInException(e));
+ res.setNamingException(cont.fillInException(e));
return res;
} catch (NamingException e) {
@@ -1337,9 +1334,9 @@
}
// get attributes from result
- LdapEntry entry = (LdapEntry) answer.entries.elementAt(0);
-
- Vector entryCtls = entry.respCtls; // retrieve entry controls
+ LdapEntry entry = answer.entries.elementAt(0);
+
+ Vector<Control> entryCtls = entry.respCtls; // retrieve entry controls
if (entryCtls != null) {
appendVector(respCtls, entryCtls); // concatenate controls
}
@@ -1398,10 +1395,10 @@
int[] jmods = new int[attrs.size()];
Attribute[] jattrs = new Attribute[attrs.size()];
- NamingEnumeration ae = attrs.getAll();
+ NamingEnumeration<? extends Attribute> ae = attrs.getAll();
for(int i = 0; i < jmods.length && ae.hasMore(); i++) {
jmods[i] = jmod_op;
- jattrs[i] = (Attribute)ae.next();
+ jattrs[i] = ae.next();
}
LdapResult answer = clnt.modify(newDN, jmods, jattrs, reqCtls);
@@ -1565,7 +1562,7 @@
HierMemDirCtx objectClassCtx = new HierMemDirCtx();
DirContext objectClassDef;
String objectClassName;
- for (Enumeration objectClasses = objectClassAttr.getAll();
+ for (Enumeration<?> objectClasses = objectClassAttr.getAll();
objectClasses.hasMoreElements(); ) {
objectClassName = (String)objectClasses.nextElement();
// %%% Should we fail if not found, or just continue?
@@ -1591,7 +1588,7 @@
private DirContext getSchemaTree(Name name) throws NamingException {
String subschemasubentry = getSchemaEntry(name, true);
- DirContext schemaTree = (DirContext)schemaTrees.get(subschemasubentry);
+ DirContext schemaTree = schemaTrees.get(subschemasubentry);
if(schemaTree==null) {
if(debug){System.err.println("LdapCtx: building new schema tree " + this);}
@@ -1621,7 +1618,7 @@
false /*deref link */ );
Name sse = (new CompositeName()).add(subschemasubentry);
- NamingEnumeration results =
+ NamingEnumeration<SearchResult> results =
searchAux(sse, "(objectClass=subschema)", constraints,
false, true, new Continuation());
@@ -1629,7 +1626,7 @@
throw new OperationNotSupportedException(
"Cannot get read subschemasubentry: " + subschemasubentry);
}
- SearchResult result = (SearchResult)results.next();
+ SearchResult result = results.next();
results.close();
Object obj = result.getObject();
@@ -1674,7 +1671,7 @@
false /* returning obj */,
false /* deref link */);
- NamingEnumeration results;
+ NamingEnumeration<SearchResult> results;
try {
results = searchAux(name, "objectclass=*", constraints, relative,
true, new Continuation());
@@ -1695,7 +1692,7 @@
"Requesting schema of nonexistent entry: " + name);
}
- SearchResult result = (SearchResult) results.next();
+ SearchResult result = results.next();
results.close();
Attribute schemaEntryAttr =
@@ -1720,7 +1717,7 @@
// Set attributes to point to this context in case some one
// asked for their schema
void setParents(Attributes attrs, Name name) throws NamingException {
- NamingEnumeration ae = attrs.getAll();
+ NamingEnumeration<? extends Attribute> ae = attrs.getAll();
while(ae.hasMore()) {
((LdapAttribute) ae.next()).setParent(this, name);
}
@@ -1740,14 +1737,14 @@
}
// --------------------- Searches -----------------------------
- protected NamingEnumeration c_search(Name name,
+ protected NamingEnumeration<SearchResult> c_search(Name name,
Attributes matchingAttributes,
Continuation cont)
throws NamingException {
return c_search(name, matchingAttributes, null, cont);
}
- protected NamingEnumeration c_search(Name name,
+ protected NamingEnumeration<SearchResult> c_search(Name name,
Attributes matchingAttributes,
String[] attributesToReturn,
Continuation cont)
@@ -1764,7 +1761,7 @@
return c_search(name, filter, cons, cont);
}
- protected NamingEnumeration c_search(Name name,
+ protected NamingEnumeration<SearchResult> c_search(Name name,
String filter,
SearchControls cons,
Continuation cont)
@@ -1773,7 +1770,7 @@
waitForReply, cont);
}
- protected NamingEnumeration c_search(Name name,
+ protected NamingEnumeration<SearchResult> c_search(Name name,
String filterExpr,
Object[] filterArgs,
SearchControls cons,
@@ -1790,7 +1787,7 @@
}
// Used by NamingNotifier
- NamingEnumeration searchAux(Name name,
+ NamingEnumeration<SearchResult> searchAux(Name name,
String filter,
SearchControls cons,
boolean relative,
@@ -1849,7 +1846,8 @@
processReturnCode(answer, name);
}
return new LdapSearchEnumeration(this, answer,
- fullyQualifiedName(name), args, cont);
+ fullyQualifiedName(name),
+ args, cont);
} catch (LdapReferralException e) {
if (handleReferrals == LdapClient.LDAP_REF_THROW)
@@ -1858,8 +1856,9 @@
// process the referrals sequentially
while (true) {
- LdapReferralContext refCtx =
- (LdapReferralContext)e.getReferralContext(envprops, bindCtls);
+ @SuppressWarnings("unchecked")
+ LdapReferralContext refCtx = (LdapReferralContext)
+ e.getReferralContext(envprops, bindCtls);
// repeat the original operation at the new context
try {
@@ -2143,16 +2142,18 @@
/**
* Override with noncloning version.
*/
- protected Hashtable p_getEnvironment() {
+ protected Hashtable<String, Object> p_getEnvironment() {
return envprops;
}
- public Hashtable getEnvironment() throws NamingException {
+ @SuppressWarnings("unchecked") // clone()
+ public Hashtable<String, Object> getEnvironment() throws NamingException {
return (envprops == null
- ? new Hashtable(5, 0.75f)
- : (Hashtable)envprops.clone());
+ ? new Hashtable<String, Object>(5, 0.75f)
+ : (Hashtable<String, Object>)envprops.clone());
}
+ @SuppressWarnings("unchecked") // clone()
public Object removeFromEnvironment(String propName)
throws NamingException {
@@ -2160,58 +2161,74 @@
if (envprops == null || envprops.get(propName) == null) {
return null;
}
-
- if (propName.equals(REF_SEPARATOR)) {
- addrEncodingSeparator = DEFAULT_REF_SEPARATOR;
- } else if (propName.equals(TYPES_ONLY)) {
- typesOnly = DEFAULT_TYPES_ONLY;
- } else if (propName.equals(DELETE_RDN)) {
- deleteRDN = DEFAULT_DELETE_RDN;
- } else if (propName.equals(DEREF_ALIASES)) {
- derefAliases = DEFAULT_DEREF_ALIASES;
- } else if (propName.equals(Context.BATCHSIZE)) {
- batchSize = DEFAULT_BATCH_SIZE;
- } else if (propName.equals(REFERRAL_LIMIT)) {
- referralHopLimit = DEFAULT_REFERRAL_LIMIT;
- } else if (propName.equals(Context.REFERRAL)) {
- setReferralMode(null, true);
- } else if (propName.equals(BINARY_ATTRIBUTES)) {
- setBinaryAttributes(null);
- } else if (propName.equals(CONNECT_TIMEOUT)) {
- connectTimeout = -1;
- } else if (propName.equals(READ_TIMEOUT)) {
- readTimeout = -1;
- } else if (propName.equals(WAIT_FOR_REPLY)) {
- waitForReply = true;
- } else if (propName.equals(REPLY_QUEUE_SIZE)) {
- replyQueueSize = -1;
-
-// The following properties affect the connection
-
- } else if (propName.equals(Context.SECURITY_PROTOCOL)) {
- closeConnection(SOFT_CLOSE);
- // De-activate SSL and reset the context's url and port number
- if (useSsl && !hasLdapsScheme) {
- useSsl = false;
- url = null;
- if (useDefaultPortNumber) {
- port_number = DEFAULT_PORT;
+ switch (propName) {
+ case REF_SEPARATOR:
+ addrEncodingSeparator = DEFAULT_REF_SEPARATOR;
+ break;
+ case TYPES_ONLY:
+ typesOnly = DEFAULT_TYPES_ONLY;
+ break;
+ case DELETE_RDN:
+ deleteRDN = DEFAULT_DELETE_RDN;
+ break;
+ case DEREF_ALIASES:
+ derefAliases = DEFAULT_DEREF_ALIASES;
+ break;
+ case Context.BATCHSIZE:
+ batchSize = DEFAULT_BATCH_SIZE;
+ break;
+ case REFERRAL_LIMIT:
+ referralHopLimit = DEFAULT_REFERRAL_LIMIT;
+ break;
+ case Context.REFERRAL:
+ setReferralMode(null, true);
+ break;
+ case BINARY_ATTRIBUTES:
+ setBinaryAttributes(null);
+ break;
+ case CONNECT_TIMEOUT:
+ connectTimeout = -1;
+ break;
+ case READ_TIMEOUT:
+ readTimeout = -1;
+ break;
+ case WAIT_FOR_REPLY:
+ waitForReply = true;
+ break;
+ case REPLY_QUEUE_SIZE:
+ replyQueueSize = -1;
+ break;
+
+ // The following properties affect the connection
+
+ case Context.SECURITY_PROTOCOL:
+ closeConnection(SOFT_CLOSE);
+ // De-activate SSL and reset the context's url and port number
+ if (useSsl && !hasLdapsScheme) {
+ useSsl = false;
+ url = null;
+ if (useDefaultPortNumber) {
+ port_number = DEFAULT_PORT;
+ }
}
- }
- } else if (propName.equals(VERSION) ||
- propName.equals(SOCKET_FACTORY)) {
- closeConnection(SOFT_CLOSE);
- } else if(propName.equals(Context.SECURITY_AUTHENTICATION) ||
- propName.equals(Context.SECURITY_PRINCIPAL) ||
- propName.equals(Context.SECURITY_CREDENTIALS)) {
- sharable = false;
+ break;
+ case VERSION:
+ case SOCKET_FACTORY:
+ closeConnection(SOFT_CLOSE);
+ break;
+ case Context.SECURITY_AUTHENTICATION:
+ case Context.SECURITY_PRINCIPAL:
+ case Context.SECURITY_CREDENTIALS:
+ sharable = false;
+ break;
}
// Update environment; reconnection will use new props
- envprops = (Hashtable)envprops.clone();
+ envprops = (Hashtable<String, Object>)envprops.clone();
return envprops.remove(propName);
}
+ @SuppressWarnings("unchecked") // clone()
public Object addToEnvironment(String propName, Object propVal)
throws NamingException {
@@ -2219,57 +2236,72 @@
if (propVal == null) {
return removeFromEnvironment(propName);
}
-
- if (propName.equals(REF_SEPARATOR)) {
- setRefSeparator((String)propVal);
- } else if (propName.equals(TYPES_ONLY)) {
- setTypesOnly((String)propVal);
- } else if (propName.equals(DELETE_RDN)) {
- setDeleteRDN((String)propVal);
- } else if (propName.equals(DEREF_ALIASES)) {
- setDerefAliases((String)propVal);
- } else if (propName.equals(Context.BATCHSIZE)) {
- setBatchSize((String)propVal);
- } else if (propName.equals(REFERRAL_LIMIT)) {
- setReferralLimit((String)propVal);
- } else if (propName.equals(Context.REFERRAL)) {
- setReferralMode((String)propVal, true);
- } else if (propName.equals(BINARY_ATTRIBUTES)) {
- setBinaryAttributes((String)propVal);
- } else if (propName.equals(CONNECT_TIMEOUT)) {
- setConnectTimeout((String)propVal);
- } else if (propName.equals(READ_TIMEOUT)) {
- setReadTimeout((String)propVal);
- } else if (propName.equals(WAIT_FOR_REPLY)) {
- setWaitForReply((String)propVal);
- } else if (propName.equals(REPLY_QUEUE_SIZE)) {
- setReplyQueueSize((String)propVal);
-
-// The following properties affect the connection
-
- } else if (propName.equals(Context.SECURITY_PROTOCOL)) {
- closeConnection(SOFT_CLOSE);
- // Activate SSL and reset the context's url and port number
- if ("ssl".equals(propVal)) {
- useSsl = true;
- url = null;
- if (useDefaultPortNumber) {
- port_number = DEFAULT_SSL_PORT;
+ switch (propName) {
+ case REF_SEPARATOR:
+ setRefSeparator((String)propVal);
+ break;
+ case TYPES_ONLY:
+ setTypesOnly((String)propVal);
+ break;
+ case DELETE_RDN:
+ setDeleteRDN((String)propVal);
+ break;
+ case DEREF_ALIASES:
+ setDerefAliases((String)propVal);
+ break;
+ case Context.BATCHSIZE:
+ setBatchSize((String)propVal);
+ break;
+ case REFERRAL_LIMIT:
+ setReferralLimit((String)propVal);
+ break;
+ case Context.REFERRAL:
+ setReferralMode((String)propVal, true);
+ break;
+ case BINARY_ATTRIBUTES:
+ setBinaryAttributes((String)propVal);
+ break;
+ case CONNECT_TIMEOUT:
+ setConnectTimeout((String)propVal);
+ break;
+ case READ_TIMEOUT:
+ setReadTimeout((String)propVal);
+ break;
+ case WAIT_FOR_REPLY:
+ setWaitForReply((String)propVal);
+ break;
+ case REPLY_QUEUE_SIZE:
+ setReplyQueueSize((String)propVal);
+ break;
+
+ // The following properties affect the connection
+
+ case Context.SECURITY_PROTOCOL:
+ closeConnection(SOFT_CLOSE);
+ // Activate SSL and reset the context's url and port number
+ if ("ssl".equals(propVal)) {
+ useSsl = true;
+ url = null;
+ if (useDefaultPortNumber) {
+ port_number = DEFAULT_SSL_PORT;
+ }
}
- }
- } else if (propName.equals(VERSION) ||
- propName.equals(SOCKET_FACTORY)) {
- closeConnection(SOFT_CLOSE);
- } else if (propName.equals(Context.SECURITY_AUTHENTICATION) ||
- propName.equals(Context.SECURITY_PRINCIPAL) ||
- propName.equals(Context.SECURITY_CREDENTIALS)) {
- sharable = false;
+ break;
+ case VERSION:
+ case SOCKET_FACTORY:
+ closeConnection(SOFT_CLOSE);
+ break;
+ case Context.SECURITY_AUTHENTICATION:
+ case Context.SECURITY_PRINCIPAL:
+ case Context.SECURITY_CREDENTIALS:
+ sharable = false;
+ break;
}
// Update environment; reconnection will use new props
envprops = (envprops == null
- ? new Hashtable(5, 0.75f)
- : (Hashtable)envprops.clone());
+ ? new Hashtable<String, Object>(5, 0.75f)
+ : (Hashtable<String, Object>)envprops.clone());
return envprops.put(propName, propVal);
}
@@ -2380,15 +2412,19 @@
private void setReferralMode(String ref, boolean update) {
// First determine the referral mode
if (ref != null) {
- if (ref.equals("follow")) {
- handleReferrals = LdapClient.LDAP_REF_FOLLOW;
- } else if (ref.equals("throw")) {
- handleReferrals = LdapClient.LDAP_REF_THROW;
- } else if (ref.equals("ignore")) {
- handleReferrals = LdapClient.LDAP_REF_IGNORE;
- } else {
- throw new IllegalArgumentException(
- "Illegal value for " + Context.REFERRAL + " property.");
+ switch (ref) {
+ case "follow":
+ handleReferrals = LdapClient.LDAP_REF_FOLLOW;
+ break;
+ case "throw":
+ handleReferrals = LdapClient.LDAP_REF_THROW;
+ break;
+ case "ignore":
+ handleReferrals = LdapClient.LDAP_REF_IGNORE;
+ break;
+ default:
+ throw new IllegalArgumentException(
+ "Illegal value for " + Context.REFERRAL + " property.");
}
} else {
handleReferrals = DEFAULT_REFERRAL_MODE;
@@ -2411,17 +2447,22 @@
*/
private void setDerefAliases(String deref) {
if (deref != null) {
- if (deref.equals("never")) {
- derefAliases = 0; // never de-reference aliases
- } else if (deref.equals("searching")) {
- derefAliases = 1; // de-reference aliases during searching
- } else if (deref.equals("finding")) {
- derefAliases = 2; // de-reference during name resolution
- } else if (deref.equals("always")) {
- derefAliases = 3; // always de-reference aliases
- } else {
- throw new IllegalArgumentException("Illegal value for " +
- DEREF_ALIASES + " property.");
+ switch (deref) {
+ case "never":
+ derefAliases = 0; // never de-reference aliases
+ break;
+ case "searching":
+ derefAliases = 1; // de-reference aliases during searching
+ break;
+ case "finding":
+ derefAliases = 2; // de-reference during name resolution
+ break;
+ case "always":
+ derefAliases = 3; // always de-reference aliases
+ break;
+ default:
+ throw new IllegalArgumentException("Illegal value for " +
+ DEREF_ALIASES + " property.");
}
} else {
derefAliases = DEFAULT_DEREF_ALIASES;
@@ -2514,8 +2555,10 @@
* <ldapurls> ::= <separator> <ldapurl> | <ldapurls>
* <separator> ::= ASCII linefeed character (0x0a)
* <ldapurl> ::= LDAP URL format (RFC 1959)
+ *
+ * Returns a Vector of single-String Vectors.
*/
- private static Vector extractURLs(String refString) {
+ private static Vector<Vector<String>> extractURLs(String refString) {
int separator = 0;
int urlCount = 0;
@@ -2526,17 +2569,21 @@
urlCount++;
}
- Vector referrals = new Vector(urlCount);
+ Vector<Vector<String>> referrals = new Vector<>(urlCount);
int iURL;
int i = 0;
separator = refString.indexOf('\n');
iURL = separator + 1;
while ((separator = refString.indexOf('\n', iURL)) >= 0) {
- referrals.addElement(refString.substring(iURL, separator));
+ Vector<String> referral = new Vector<>(1);
+ referral.addElement(refString.substring(iURL, separator));
+ referrals.addElement(referral);
iURL = separator + 1;
}
- referrals.addElement(refString.substring(iURL));
+ Vector<String> referral = new Vector<>(1);
+ referral.addElement(refString.substring(iURL));
+ referrals.addElement(referral);
return referrals;
}
@@ -2549,9 +2596,9 @@
if (attrIds == null) {
binaryAttrs = null;
} else {
- binaryAttrs = new Hashtable(11, 0.75f);
+ binaryAttrs = new Hashtable<>(11, 0.75f);
StringTokenizer tokens =
- new StringTokenizer(attrIds.toLowerCase(), " ");
+ new StringTokenizer(attrIds.toLowerCase(Locale.ENGLISH), " ");
while (tokens.hasMoreTokens()) {
binaryAttrs.put(tokens.nextToken(), Boolean.TRUE);
@@ -2601,11 +2648,12 @@
*/
}
+ @SuppressWarnings("unchecked") // clone()
public void reconnect(Control[] connCtls) throws NamingException {
// Update environment
envprops = (envprops == null
- ? new Hashtable(5, 0.75f)
- : (Hashtable)envprops.clone());
+ ? new Hashtable<String, Object>(5, 0.75f)
+ : (Hashtable<String, Object>)envprops.clone());
if (connCtls == null) {
envprops.remove(BIND_CONTROLS);
@@ -2631,7 +2679,7 @@
}
// reset the cache before a new connection is established
- schemaTrees = new Hashtable(11, 0.75f);
+ schemaTrees = new Hashtable<>(11, 0.75f);
connect(startTLS);
} else if (!sharable || startTLS) {
@@ -2644,7 +2692,7 @@
}
}
// reset the cache before a new connection is established
- schemaTrees = new Hashtable(11, 0.75f);
+ schemaTrees = new Hashtable<>(11, 0.75f);
connect(startTLS);
}
@@ -2846,7 +2894,7 @@
}
protected void processReturnCode(LdapResult res, Name resolvedName,
- Object resolvedObj, Name remainName, Hashtable envprops, String fullDN)
+ Object resolvedObj, Name remainName, Hashtable<?,?> envprops, String fullDN)
throws NamingException {
String msg = LdapClient.getErrorMessage(res.status, res.errorMessage);
@@ -2880,7 +2928,7 @@
r = new LdapReferralException(resolvedName, resolvedObj,
remainName, msg, envprops, fullDN, handleReferrals,
reqCtls);
- r.setReferralInfo((Vector)res.referrals.elementAt(i), true);
+ r.setReferralInfo(res.referrals.elementAt(i), true);
if (hopCount > 1) {
r.setHopCount(hopCount);
@@ -2927,7 +2975,7 @@
r = new LdapReferralException(resolvedName, resolvedObj, remainName,
msg, envprops, fullDN, handleReferrals, reqCtls);
// only one set of URLs is present
- r.setReferralInfo((Vector)res.referrals.elementAt(0), false);
+ r.setReferralInfo(res.referrals.elementAt(0), false);
if (hopCount > 1) {
r.setHopCount(hopCount);
@@ -2995,10 +3043,10 @@
* If 1 referral and 0 entries is received then
* assume name resolution has not yet completed.
*/
- if (((res.entries == null) || (res.entries.size() == 0)) &&
+ if (((res.entries == null) || (res.entries.isEmpty())) &&
(res.referrals.size() == 1)) {
- r.setReferralInfo((Vector)res.referrals, false);
+ r.setReferralInfo(res.referrals, false);
// check the hop limit
if (hopCount > referralHopLimit) {
@@ -3284,9 +3332,9 @@
/**
* Narrow controls using own default factory and ControlFactory.
- * @param ctls A non-null Vector
+ * @param ctls A non-null Vector<Control>
*/
- Control[] convertControls(Vector ctls) throws NamingException {
+ Control[] convertControls(Vector<Control> ctls) throws NamingException {
int count = ctls.size();
if (count == 0) {
@@ -3298,12 +3346,12 @@
for (int i = 0; i < count; i++) {
// Try own factory first
controls[i] = myResponseControlFactory.getControlInstance(
- (Control)ctls.elementAt(i));
+ ctls.elementAt(i));
// Try assigned factories if own produced null
if (controls[i] == null) {
controls[i] = ControlFactory.getControlInstance(
- (Control)ctls.elementAt(i), this, envprops);
+ ctls.elementAt(i), this, envprops);
}
}
return controls;
@@ -3448,7 +3496,7 @@
if (nm.size() > 1) {
throw new InvalidNameException(
"Target cannot span multiple namespaces: " + nm);
- } else if (nm.size() == 0) {
+ } else if (nm.isEmpty()) {
return "";
} else {
return nm.get(0);
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtxFactory.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtxFactory.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -28,7 +28,6 @@
import java.util.Hashtable;
import java.util.Vector;
import java.util.Enumeration;
-import java.net.MalformedURLException;
import javax.naming.*;
import javax.naming.directory.*;
@@ -119,9 +118,9 @@
int size = 0; // number of URLs
String[] urls = new String[ref.size()];
- Enumeration addrs = ref.getAll();
+ Enumeration<RefAddr> addrs = ref.getAll();
while (addrs.hasMoreElements()) {
- RefAddr addr = (RefAddr)addrs.nextElement();
+ RefAddr addr = addrs.nextElement();
if ((addr instanceof StringRefAddr) &&
addr.getType().equals(ADDRESS_TYPE)) {
@@ -145,7 +144,7 @@
// ------------ Utilities used by other classes ----------------
- public static DirContext getLdapCtxInstance(Object urlInfo, Hashtable env)
+ public static DirContext getLdapCtxInstance(Object urlInfo, Hashtable<?,?> env)
throws NamingException {
if (urlInfo instanceof String) {
@@ -158,7 +157,7 @@
}
}
- private static DirContext getUsingURL(String url, Hashtable env)
+ private static DirContext getUsingURL(String url, Hashtable<?,?> env)
throws NamingException {
DirContext ctx = null;
LdapURL ldapUrl = new LdapURL(url);
@@ -202,7 +201,7 @@
* If all URLs fail, throw one of the exceptions arbitrarily.
* Not pretty, but potentially more informative than returning null.
*/
- private static DirContext getUsingURLs(String[] urls, Hashtable env)
+ private static DirContext getUsingURLs(String[] urls, Hashtable<?,?> env)
throws NamingException {
NamingException ne = null;
DirContext ctx = null;
@@ -221,8 +220,8 @@
/**
* Used by Obj and obj/RemoteToAttrs too so must be public
*/
- public static Attribute createTypeNameAttr(Class cl) {
- Vector v = new Vector(10);
+ public static Attribute createTypeNameAttr(Class<?> cl) {
+ Vector<String> v = new Vector<>(10);
String[] types = getTypeNames(cl, v);
if (types.length > 0) {
BasicAttribute tAttr =
@@ -235,7 +234,7 @@
return null;
}
- private static String[] getTypeNames(Class currentClass, Vector v) {
+ private static String[] getTypeNames(Class<?> currentClass, Vector<String> v) {
getClassesAux(currentClass, v);
Class[] members = currentClass.getInterfaces();
@@ -244,13 +243,14 @@
}
String[] ret = new String[v.size()];
int i = 0;
- for (java.util.Enumeration e = v.elements(); e.hasMoreElements();) {
- ret[i++] = (String)e.nextElement();
+
+ for (String name : v) {
+ ret[i++] = name;
}
return ret;
}
- private static void getClassesAux(Class currentClass, Vector v) {
+ private static void getClassesAux(Class<?> currentClass, Vector<String> v) {
if (!v.contains(currentClass.getName())) {
v.addElement(currentClass.getName());
}
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapEntry.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapEntry.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -27,7 +27,7 @@
import java.util.Vector;
import javax.naming.directory.Attributes;
-import javax.naming.directory.Attribute;
+import javax.naming.ldap.Control;
/**
* A holder for an LDAP entry read from an LDAP server.
@@ -38,14 +38,14 @@
final class LdapEntry {
String DN;
Attributes attributes;
- Vector respCtls = null;
+ Vector<Control> respCtls = null;
LdapEntry(String DN, Attributes attrs) {
this.DN = DN;
this.attributes = attrs;
}
- LdapEntry(String DN, Attributes attrs, Vector respCtls) {
+ LdapEntry(String DN, Attributes attrs, Vector<Control> respCtls) {
this.DN = DN;
this.attributes = attrs;
this.respCtls = respCtls;
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapName.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapName.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -28,6 +28,7 @@
import java.util.Enumeration;
import java.util.Vector;
+import java.util.Locale;
import javax.naming.*;
import javax.naming.directory.Attributes;
@@ -78,7 +79,7 @@
public final class LdapName implements Name {
private transient String unparsed; // if non-null, the DN in unparsed form
- private transient Vector rdns; // parsed name components
+ private transient Vector<Rdn> rdns; // parsed name components
private transient boolean valuesCaseSensitive = false;
/**
@@ -97,9 +98,10 @@
* Constructs an LDAP name given its parsed components and, optionally
* (if "name" is not null), the unparsed DN.
*/
- private LdapName(String name, Vector rdns) {
+ @SuppressWarnings("unchecked") // clone()
+ private LdapName(String name, Vector<Rdn> rdns) {
unparsed = name;
- this.rdns = (Vector)rdns.clone();
+ this.rdns = (Vector<Rdn>)rdns.clone();
}
/*
@@ -107,9 +109,9 @@
* of "rdns" in the range [beg,end)) and, optionally
* (if "name" is not null), the unparsed DN.
*/
- private LdapName(String name, Vector rdns, int beg, int end) {
+ private LdapName(String name, Vector<Rdn> rdns, int beg, int end) {
unparsed = name;
- this.rdns = new Vector();
+ this.rdns = new Vector<>();
for (int i = beg; i < end; i++) {
this.rdns.addElement(rdns.elementAt(i));
}
@@ -130,7 +132,7 @@
if (i < rdns.size() - 1) {
buf.append(',');
}
- Rdn rdn = (Rdn)rdns.elementAt(i);
+ Rdn rdn = rdns.elementAt(i);
buf.append(rdn);
}
@@ -155,8 +157,8 @@
int minSize = Math.min(rdns.size(), that.rdns.size());
for (int i = 0 ; i < minSize; i++) {
// Compare a single pair of RDNs.
- Rdn rdn1 = (Rdn)rdns.elementAt(i);
- Rdn rdn2 = (Rdn)that.rdns.elementAt(i);
+ Rdn rdn1 = rdns.elementAt(i);
+ Rdn rdn2 = that.rdns.elementAt(i);
int diff = rdn1.compareTo(rdn2);
if (diff != 0) {
@@ -172,7 +174,7 @@
// For each RDN...
for (int i = 0; i < rdns.size(); i++) {
- Rdn rdn = (Rdn)rdns.elementAt(i);
+ Rdn rdn = rdns.elementAt(i);
hash += rdn.hashCode();
}
return hash;
@@ -186,14 +188,14 @@
return rdns.isEmpty();
}
- public Enumeration getAll() {
- final Enumeration enum_ = rdns.elements();
+ public Enumeration<String> getAll() {
+ final Enumeration<Rdn> enum_ = rdns.elements();
- return new Enumeration () {
+ return new Enumeration<String>() {
public boolean hasMoreElements() {
return enum_.hasMoreElements();
}
- public Object nextElement() {
+ public String nextElement() {
return enum_.nextElement().toString();
}
};
@@ -254,7 +256,7 @@
Rdn rdn;
if (n instanceof LdapName) {
LdapName ln = (LdapName)n;
- rdn = (Rdn)ln.rdns.elementAt(i - beg);
+ rdn = ln.rdns.elementAt(i - beg);
} else {
String rdnString = n.get(i - beg);
try {
@@ -286,9 +288,9 @@
rdns.insertElementAt(s.rdns.elementAt(i), pos++);
}
} else {
- Enumeration comps = suffix.getAll();
+ Enumeration<String> comps = suffix.getAll();
while (comps.hasMoreElements()) {
- DnParser p = new DnParser((String)comps.nextElement(),
+ DnParser p = new DnParser(comps.nextElement(),
valuesCaseSensitive);
rdns.insertElementAt(p.getRdn(), pos++);
}
@@ -406,9 +408,9 @@
/*
* Parses the DN, returning a Vector of its RDNs.
*/
- Vector getDn() throws InvalidNameException {
+ Vector<Rdn> getDn() throws InvalidNameException {
cur = 0;
- Vector rdns = new Vector(len / 3 + 10); // leave room for growth
+ Vector<Rdn> rdns = new Vector<>(len / 3 + 10); // leave room for growth
if (len == 0) {
return rdns;
@@ -595,7 +597,7 @@
* A vector of the TypeAndValue elements of this Rdn.
* It is sorted to facilitate set operations.
*/
- private final Vector tvs = new Vector();
+ private final Vector<TypeAndValue> tvs = new Vector<>();
void add(TypeAndValue tv) {
@@ -636,7 +638,7 @@
int minSize = Math.min(tvs.size(), that.tvs.size());
for (int i = 0; i < minSize; i++) {
// Compare a single pair of type/value pairs.
- TypeAndValue tv = (TypeAndValue)tvs.elementAt(i);
+ TypeAndValue tv = tvs.elementAt(i);
int diff = tv.compareTo(that.tvs.elementAt(i));
if (diff != 0) {
return diff;
@@ -662,7 +664,7 @@
Attribute attr;
for (int i = 0; i < tvs.size(); i++) {
- tv = (TypeAndValue) tvs.elementAt(i);
+ tv = tvs.elementAt(i);
if ((attr = attrs.get(tv.getType())) == null) {
attrs.put(tv.getType(), tv.getUnescapedValue());
} else {
@@ -706,7 +708,7 @@
TypeAndValue that = (TypeAndValue)obj;
- int diff = type.toUpperCase().compareTo(that.type.toUpperCase());
+ int diff = type.compareToIgnoreCase(that.type);
if (diff != 0) {
return diff;
}
@@ -729,7 +731,7 @@
public int hashCode() {
// If two objects are equal, their hash codes must match.
- return (type.toUpperCase().hashCode() +
+ return (type.toUpperCase(Locale.ENGLISH).hashCode() +
getValueComparable().hashCode());
}
@@ -763,11 +765,12 @@
// cache result
if (binary) {
- comparable = value.toUpperCase();
+ comparable = value.toUpperCase(Locale.ENGLISH);
} else {
comparable = (String)unescapeValue(value);
if (!valueCaseSensitive) {
- comparable = comparable.toUpperCase(); // ignore case
+ // ignore case
+ comparable = comparable.toUpperCase(Locale.ENGLISH);
}
}
return comparable;
@@ -835,7 +838,7 @@
buf.append(Character.forDigit(0xF & b, 16));
}
- return (new String(buf)).toUpperCase();
+ return (new String(buf)).toUpperCase(Locale.ENGLISH);
}
/*
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapNamingEnumeration.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapNamingEnumeration.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -27,267 +27,25 @@
import javax.naming.*;
import javax.naming.directory.*;
-import javax.naming.spi.*;
import com.sun.jndi.toolkit.ctx.Continuation;
-import java.util.NoSuchElementException;
import java.util.Vector;
-import javax.naming.ldap.LdapName;
-
-/**
- * Basic enumeration for NameClassPair, Binding, and SearchResults.
- */
-
-class LdapNamingEnumeration implements NamingEnumeration, ReferralEnumeration {
- protected Name listArg;
+import javax.naming.ldap.Control;
- private boolean cleaned = false;
- private LdapResult res;
- private LdapClient enumClnt;
- private Continuation cont; // used to fill in exceptions
- private Vector entries = null;
- private int limit = 0;
- private int posn = 0;
- protected LdapCtx homeCtx;
- private LdapReferralException refEx = null;
- private NamingException errEx = null;
+
+final class LdapNamingEnumeration
+ extends AbstractLdapNamingEnumeration<NameClassPair> {
private static final String defaultClassName = DirContext.class.getName();
- /*
- * Record the next set of entries and/or referrals.
- */
LdapNamingEnumeration(LdapCtx homeCtx, LdapResult answer, Name listArg,
- Continuation cont) throws NamingException {
-
- // These checks are to accommodate referrals and limit exceptions
- // which will generate an enumeration and defer the exception
- // to be thrown at the end of the enumeration.
- // All other exceptions are thrown immediately.
- // Exceptions shouldn't be thrown here anyhow because
- // process_return_code() is called before the constructor
- // is called, so these are just safety checks.
-
- if ((answer.status != LdapClient.LDAP_SUCCESS) &&
- (answer.status != LdapClient.LDAP_SIZE_LIMIT_EXCEEDED) &&
- (answer.status != LdapClient.LDAP_TIME_LIMIT_EXCEEDED) &&
- (answer.status != LdapClient.LDAP_ADMIN_LIMIT_EXCEEDED) &&
- (answer.status != LdapClient.LDAP_REFERRAL) &&
- (answer.status != LdapClient.LDAP_PARTIAL_RESULTS)) {
-
- // %%% need to deal with referral
- NamingException e = new NamingException(
- LdapClient.getErrorMessage(
- answer.status, answer.errorMessage));
-
- throw cont.fillInException(e);
- }
-
- // otherwise continue
-
- res = answer;
- entries = answer.entries;
- limit = (entries == null) ? 0 : entries.size(); // handle empty set
- this.listArg = listArg;
- this.cont = cont;
-
- if (answer.refEx != null) {
- refEx = answer.refEx;
- }
-
- // Ensures that context won't get closed from underneath us
- this.homeCtx = homeCtx;
- homeCtx.incEnumCount();
- enumClnt = homeCtx.clnt; // remember
- }
-
- public Object nextElement() {
- try {
- return next();
- } catch (NamingException e) {
- // can't throw exception
- cleanup();
- return null;
- }
- }
-
- public boolean hasMoreElements() {
- try {
- return hasMore();
- } catch (NamingException e) {
- // can't throw exception
- cleanup();
- return false;
- }
- }
-
- /*
- * Retrieve the next set of entries and/or referrals.
- */
- private void getNextBatch() throws NamingException {
-
- res = homeCtx.getSearchReply(enumClnt, res);
- if (res == null) {
- limit = posn = 0;
- return;
- }
-
- entries = res.entries;
- limit = (entries == null) ? 0 : entries.size(); // handle empty set
- posn = 0; // reset
-
- // mimimize the number of calls to processReturnCode()
- // (expensive when batchSize is small and there are many results)
- if ((res.status != LdapClient.LDAP_SUCCESS) ||
- ((res.status == LdapClient.LDAP_SUCCESS) &&
- (res.referrals != null))) {
-
- try {
- // convert referrals into a chain of LdapReferralException
- homeCtx.processReturnCode(res, listArg);
-
- } catch (LimitExceededException e) {
- setNamingException(e);
-
- } catch (PartialResultException e) {
- setNamingException(e);
- }
- }
-
- // merge any newly received referrals with any current referrals
- if (res.refEx != null) {
- if (refEx == null) {
- refEx = res.refEx;
- } else {
- refEx = refEx.appendUnprocessedReferrals(res.refEx);
- }
- res.refEx = null; // reset
- }
-
- if (res.resControls != null) {
- homeCtx.respCtls = res.resControls;
- }
+ Continuation cont) throws NamingException {
+ super(homeCtx, answer, listArg, cont);
}
- private boolean more = true; // assume we have something to start with
- private boolean hasMoreCalled = false;
-
- /*
- * Test if unprocessed entries or referrals exist.
- */
- public boolean hasMore() throws NamingException {
-
- if (hasMoreCalled) {
- return more;
- }
-
- hasMoreCalled = true;
-
- if (!more) {
- return false;
- } else {
- return (more = hasMoreImpl());
- }
- }
-
- /*
- * Retrieve the next entry.
- */
- public Object next() throws NamingException {
-
- if (!hasMoreCalled) {
- hasMore();
- }
- hasMoreCalled = false;
- return nextImpl();
- }
-
- /*
- * Test if unprocessed entries or referrals exist.
- */
- private boolean hasMoreImpl() throws NamingException {
- // when page size is supported, this
- // might generate an exception while attempting
- // to fetch the next batch to determine
- // whether there are any more elements
-
- // test if the current set of entries has been processed
- if (posn == limit) {
- getNextBatch();
- }
-
- // test if any unprocessed entries exist
- if (posn < limit) {
- return true;
- } else {
-
- try {
- // try to process another referral
- return hasMoreReferrals();
-
- } catch (LdapReferralException e) {
- cleanup();
- throw e;
-
- } catch (LimitExceededException e) {
- cleanup();
- throw e;
-
- } catch (PartialResultException e) {
- cleanup();
- throw e;
-
- } catch (NamingException e) {
- cleanup();
- PartialResultException pre = new PartialResultException();
- pre.setRootCause(e);
- throw pre;
- }
- }
- }
-
- /*
- * Retrieve the next entry.
- */
- private Object nextImpl() throws NamingException {
- try {
- return nextAux();
- } catch (NamingException e) {
- cleanup();
- throw cont.fillInException(e);
- }
- }
-
- private Object nextAux() throws NamingException {
- if (posn == limit) {
- getNextBatch(); // updates posn and limit
- }
-
- if (posn >= limit) {
- cleanup();
- throw new NoSuchElementException("invalid enumeration handle");
- }
-
- LdapEntry result = (LdapEntry)entries.elementAt(posn++);
-
- // gets and outputs DN from the entry
- return createItem(result.DN, result.attributes, result.respCtls);
- }
-
- protected String getAtom(String dn) {
- String atom;
- // need to strip off all but lowest component of dn
- // so that is relative to current context (currentDN)
- try {
- Name parsed = new LdapName(dn);
- return parsed.get(parsed.size() - 1);
- } catch (NamingException e) {
- return dn;
- }
- }
-
+ @Override
protected NameClassPair createItem(String dn, Attributes attrs,
- Vector respCtls) throws NamingException {
+ Vector<Control> respCtls) throws NamingException {
Attribute attr;
String className = null;
@@ -313,128 +71,10 @@
return ncp;
}
- /*
- * Append the supplied (chain of) referrals onto the
- * end of the current (chain of) referrals.
- */
- public void appendUnprocessedReferrals(LdapReferralException ex) {
-
- if (refEx != null) {
- refEx = refEx.appendUnprocessedReferrals(ex);
- } else {
- refEx = ex.appendUnprocessedReferrals(refEx);
- }
- }
-
- void setNamingException(NamingException e) {
- errEx = e;
- }
-
- protected LdapNamingEnumeration
- getReferredResults(LdapReferralContext refCtx) throws NamingException {
+ @Override
+ protected LdapNamingEnumeration getReferredResults(
+ LdapReferralContext refCtx) throws NamingException {
// repeat the original operation at the new context
return (LdapNamingEnumeration)refCtx.list(listArg);
}
-
- /*
- * Iterate through the URLs of a referral. If successful then perform
- * a search operation and merge the received results with the current
- * results.
- */
- protected boolean hasMoreReferrals() throws NamingException {
-
- if ((refEx != null) &&
- (refEx.hasMoreReferrals() ||
- refEx.hasMoreReferralExceptions())) {
-
- if (homeCtx.handleReferrals == LdapClient.LDAP_REF_THROW) {
- throw (NamingException)(refEx.fillInStackTrace());
- }
-
- // process the referrals sequentially
- while (true) {
-
- LdapReferralContext refCtx =
- (LdapReferralContext)refEx.getReferralContext(
- homeCtx.envprops, homeCtx.reqCtls);
-
- try {
-
- update(getReferredResults(refCtx));
- break;
-
- } catch (LdapReferralException re) {
-
- // record a previous exception
- if (errEx == null) {
- errEx = re.getNamingException();
- }
- refEx = re;
- continue;
-
- } finally {
- // Make sure we close referral context
- refCtx.close();
- }
- }
- return hasMoreImpl();
-
- } else {
- cleanup();
-
- if (errEx != null) {
- throw errEx;
- }
- return (false);
- }
- }
-
- /*
- * Merge the entries and/or referrals from the supplied enumeration
- * with those of the current enumeration.
- */
- protected void update(LdapNamingEnumeration ne) {
- // Cleanup previous context first
- homeCtx.decEnumCount();
-
- // New enum will have already incremented enum count and recorded clnt
- homeCtx = ne.homeCtx;
- enumClnt = ne.enumClnt;
-
- // Do this to prevent referral enumeration (ne) from decrementing
- // enum count because we'll be doing that here from this
- // enumeration.
- ne.homeCtx = null;
-
- // Record rest of information from new enum
- posn = ne.posn;
- limit = ne.limit;
- res = ne.res;
- entries = ne.entries;
- refEx = ne.refEx;
- listArg = ne.listArg;
- }
-
- protected void finalize() {
- cleanup();
- }
-
- protected void cleanup() {
- if (cleaned) return; // been there; done that
-
- if(enumClnt != null) {
- enumClnt.clearSearchReply(res, homeCtx.reqCtls);
- }
-
- enumClnt = null;
- cleaned = true;
- if (homeCtx != null) {
- homeCtx.decEnumCount();
- homeCtx = null;
- }
- }
-
- public void close() {
- cleanup();
- }
}
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapPoolManager.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapPoolManager.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2005, 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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@
import java.io.PrintStream;
import java.io.OutputStream;
import java.util.Hashtable;
+import java.util.Locale;
import java.util.StringTokenizer;
import javax.naming.ldap.Control;
@@ -133,7 +134,7 @@
String mech;
int p;
for (int i = 0; i < count; i++) {
- mech = parser.nextToken().toLowerCase();
+ mech = parser.nextToken().toLowerCase(Locale.ENGLISH);
if (mech.equals("anonymous")) {
mech = "none";
}
@@ -214,7 +215,7 @@
*
*/
static boolean isPoolingAllowed(String socketFactory, OutputStream trace,
- String authMech, String protocol, Hashtable env)
+ String authMech, String protocol, Hashtable<?,?> env)
throws NamingException {
if (trace != null && !debug
@@ -235,7 +236,7 @@
if ((socketFactory != null) &&
!socketFactory.equals(LdapCtx.DEFAULT_SSL_FACTORY)) {
try {
- Class socketFactoryClass = Obj.helper.loadClass(socketFactory);
+ Class<?> socketFactoryClass = Obj.helper.loadClass(socketFactory);
Class[] interfaces = socketFactoryClass.getInterfaces();
for (int i = 0; i < interfaces.length; i++) {
if (interfaces[i].getCanonicalName().equals(COMPARATOR)) {
@@ -294,7 +295,7 @@
static LdapClient getLdapClient(String host, int port, String socketFactory,
int connTimeout, int readTimeout, OutputStream trace, int version,
String authMech, Control[] ctls, String protocol, String user,
- Object passwd, Hashtable env) throws NamingException {
+ Object passwd, Hashtable<?,?> env) throws NamingException {
// Create base identity for LdapClient
ClientId id = null;
@@ -385,9 +386,9 @@
private static final String getProperty(final String propName,
final String defVal) {
- return (String) AccessController.doPrivileged(
- new PrivilegedAction() {
- public Object run() {
+ return AccessController.doPrivileged(
+ new PrivilegedAction<String>() {
+ public String run() {
try {
return System.getProperty(propName, defVal);
} catch (SecurityException e) {
@@ -399,9 +400,9 @@
private static final int getInteger(final String propName,
final int defVal) {
- Integer val = (Integer) AccessController.doPrivileged(
- new PrivilegedAction() {
- public Object run() {
+ Integer val = AccessController.doPrivileged(
+ new PrivilegedAction<Integer>() {
+ public Integer run() {
try {
return Integer.getInteger(propName, defVal);
} catch (SecurityException e) {
@@ -414,9 +415,9 @@
private static final long getLong(final String propName,
final long defVal) {
- Long val = (Long) AccessController.doPrivileged(
- new PrivilegedAction() {
- public Object run() {
+ Long val = AccessController.doPrivileged(
+ new PrivilegedAction<Long>() {
+ public Long run() {
try {
return Long.getLong(propName, defVal);
} catch (SecurityException e) {
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapReferralContext.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapReferralContext.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -52,7 +52,9 @@
private int hopCount = 1;
private NamingException previousEx = null;
- LdapReferralContext(LdapReferralException ex, Hashtable env,
+ @SuppressWarnings("unchecked") // clone()
+ LdapReferralContext(LdapReferralException ex,
+ Hashtable<?,?> env,
Control[] connCtls,
Control[] reqCtls,
String nextName,
@@ -69,20 +71,21 @@
// Make copies of environment and connect controls for our own use.
if (env != null) {
- env = (Hashtable) env.clone();
+ env = (Hashtable<?,?>) env.clone();
// Remove old connect controls from environment, unless we have new
// ones that will override them anyway.
if (connCtls == null) {
env.remove(LdapCtx.BIND_CONTROLS);
}
} else if (connCtls != null) {
- env = new Hashtable(5);
+ env = new Hashtable<String, Control[]>(5);
}
if (connCtls != null) {
Control[] copiedCtls = new Control[connCtls.length];
System.arraycopy(connCtls, 0, copiedCtls, 0, connCtls.length);
// Add copied controls to environment, replacing any old ones.
- env.put(LdapCtx.BIND_CONTROLS, copiedCtls);
+ ((Hashtable<? super String, ? super Control[]>)env)
+ .put(LdapCtx.BIND_CONTROLS, copiedCtls);
}
while (true) {
@@ -260,24 +263,26 @@
refCtx.rename(overrideName(oldName), toName(refEx.getNewRdn()));
}
- public NamingEnumeration list(String name) throws NamingException {
+ public NamingEnumeration<NameClassPair> list(String name) throws NamingException {
return list(toName(name));
}
- public NamingEnumeration list(Name name) throws NamingException {
+ @SuppressWarnings("unchecked")
+ public NamingEnumeration<NameClassPair> list(Name name) throws NamingException {
if (skipThisReferral) {
throw (NamingException)
((refEx.appendUnprocessedReferrals(null)).fillInStackTrace());
}
try {
- NamingEnumeration ne = null;
+ NamingEnumeration<NameClassPair> ne = null;
if (urlScope != null && urlScope.equals("base")) {
SearchControls cons = new SearchControls();
cons.setReturningObjFlag(true);
cons.setSearchScope(SearchControls.OBJECT_SCOPE);
- ne = refCtx.search(overrideName(name), "(objectclass=*)", cons);
+ ne = (NamingEnumeration)
+ refCtx.search(overrideName(name), "(objectclass=*)", cons);
} else {
ne = refCtx.list(overrideName(name));
@@ -318,25 +323,29 @@
}
}
- public NamingEnumeration listBindings(String name) throws NamingException {
+ public NamingEnumeration<Binding> listBindings(String name) throws
+ NamingException {
return listBindings(toName(name));
}
- public NamingEnumeration listBindings(Name name) throws NamingException {
+ @SuppressWarnings("unchecked")
+ public NamingEnumeration<Binding> listBindings(Name name) throws
+ NamingException {
if (skipThisReferral) {
throw (NamingException)
((refEx.appendUnprocessedReferrals(null)).fillInStackTrace());
}
try {
- NamingEnumeration be = null;
+ NamingEnumeration<Binding> be = null;
if (urlScope != null && urlScope.equals("base")) {
SearchControls cons = new SearchControls();
cons.setReturningObjFlag(true);
cons.setSearchScope(SearchControls.OBJECT_SCOPE);
- be = refCtx.search(overrideName(name), "(objectclass=*)", cons);
+ be = (NamingEnumeration)refCtx.search(overrideName(name),
+ "(objectclass=*)", cons);
} else {
be = refCtx.listBindings(overrideName(name));
@@ -347,7 +356,7 @@
// append (referrals from) the exception that generated this
// context to the new search results, so that referral processing
// can continue
- ((ReferralEnumeration)be).appendUnprocessedReferrals(refEx);
+ ((ReferralEnumeration<Binding>)be).appendUnprocessedReferrals(refEx);
return (be);
@@ -462,7 +471,7 @@
return refCtx.removeFromEnvironment(propName);
}
- public Hashtable getEnvironment() throws NamingException {
+ public Hashtable<?,?> getEnvironment() throws NamingException {
if (skipThisReferral) {
throw (NamingException)
((refEx.appendUnprocessedReferrals(null)).fillInStackTrace());
@@ -602,23 +611,23 @@
return refCtx.getSchemaClassDefinition(overrideName(name));
}
- public NamingEnumeration search(String name,
- Attributes matchingAttributes)
+ public NamingEnumeration<SearchResult> search(String name,
+ Attributes matchingAttributes)
throws NamingException {
return search(toName(name), SearchFilter.format(matchingAttributes),
new SearchControls());
}
- public NamingEnumeration search(Name name,
- Attributes matchingAttributes)
+ public NamingEnumeration<SearchResult> search(Name name,
+ Attributes matchingAttributes)
throws NamingException {
return search(name, SearchFilter.format(matchingAttributes),
new SearchControls());
}
- public NamingEnumeration search(String name,
- Attributes matchingAttributes,
- String[] attributesToReturn)
+ public NamingEnumeration<SearchResult> search(String name,
+ Attributes matchingAttributes,
+ String[] attributesToReturn)
throws NamingException {
SearchControls cons = new SearchControls();
cons.setReturningAttributes(attributesToReturn);
@@ -627,9 +636,9 @@
cons);
}
- public NamingEnumeration search(Name name,
- Attributes matchingAttributes,
- String[] attributesToReturn)
+ public NamingEnumeration<SearchResult> search(Name name,
+ Attributes matchingAttributes,
+ String[] attributesToReturn)
throws NamingException {
SearchControls cons = new SearchControls();
cons.setReturningAttributes(attributesToReturn);
@@ -637,15 +646,15 @@
return search(name, SearchFilter.format(matchingAttributes), cons);
}
- public NamingEnumeration search(String name,
- String filter,
- SearchControls cons)
+ public NamingEnumeration<SearchResult> search(String name,
+ String filter,
+ SearchControls cons)
throws NamingException {
return search(toName(name), filter, cons);
}
- public NamingEnumeration search(Name name,
- String filter,
+ public NamingEnumeration<SearchResult> search(Name name,
+ String filter,
SearchControls cons) throws NamingException {
if (skipThisReferral) {
@@ -654,8 +663,10 @@
}
try {
- NamingEnumeration se = refCtx.search(overrideName(name),
- overrideFilter(filter), overrideAttributesAndScope(cons));
+ NamingEnumeration<SearchResult> se =
+ refCtx.search(overrideName(name),
+ overrideFilter(filter),
+ overrideAttributesAndScope(cons));
refEx.setNameResolved(true);
@@ -694,15 +705,15 @@
}
}
- public NamingEnumeration search(String name,
- String filterExpr,
- Object[] filterArgs,
- SearchControls cons)
+ public NamingEnumeration<SearchResult> search(String name,
+ String filterExpr,
+ Object[] filterArgs,
+ SearchControls cons)
throws NamingException {
return search(toName(name), filterExpr, filterArgs, cons);
}
- public NamingEnumeration search(Name name,
+ public NamingEnumeration<SearchResult> search(Name name,
String filterExpr,
Object[] filterArgs,
SearchControls cons) throws NamingException {
@@ -713,7 +724,7 @@
}
try {
- NamingEnumeration se;
+ NamingEnumeration<SearchResult> se;
if (urlFilter != null) {
se = refCtx.search(overrideName(name), urlFilter,
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapReferralException.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapReferralException.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -26,7 +26,6 @@
package com.sun.jndi.ldap;
import javax.naming.*;
-import javax.naming.spi.*;
import javax.naming.ldap.Control;
import java.util.Hashtable;
@@ -67,15 +66,16 @@
*/
final public class LdapReferralException extends
javax.naming.ldap.LdapReferralException {
+ private static final long serialVersionUID = 627059076356906399L;
// ----------- fields initialized in constructor ---------------
private int handleReferrals;
- private Hashtable envprops;
+ private Hashtable<?,?> envprops;
private String nextName;
private Control[] reqCtls;
// ----------- fields that have defaults -----------------------
- private Vector referrals = null; // alternatives,set by setReferralInfo()
+ private Vector<?> referrals = null; // alternatives,set by setReferralInfo()
private int referralIndex = 0; // index into referrals
private int referralCount = 0; // count of referrals
private boolean foundEntry = false; // will stop when entry is found
@@ -98,7 +98,7 @@
Object resolvedObj,
Name remainingName,
String explanation,
- Hashtable envprops,
+ Hashtable<?,?> envprops,
String nextName,
int handleReferrals,
Control[] reqCtls) {
@@ -210,7 +210,7 @@
/**
* Sets referral information.
*/
- void setReferralInfo(Vector referrals, boolean continuationRef) {
+ void setReferralInfo(Vector<?> referrals, boolean continuationRef) {
// %%% continuationRef is currently ignored
if (debug)
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapResult.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapResult.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -28,6 +28,7 @@
import java.util.Vector;
import javax.naming.directory.Attributes;
import javax.naming.directory.BasicAttributes;
+import javax.naming.ldap.Control;
/**
* %%% public for use by LdapSasl %%%
@@ -37,10 +38,11 @@
public int status; // %%% public for use by LdapSasl
String matchedDN;
String errorMessage;
- Vector referrals = null;
+ // Vector<String | Vector<String>>
+ Vector<Vector<String>> referrals = null;
LdapReferralException refEx = null;
- Vector entries = null;
- Vector resControls = null;
+ Vector<LdapEntry> entries = null;
+ Vector<Control> resControls = null;
public byte[] serverCreds = null; // %%% public for use by LdapSasl
String extensionId = null; // string OID
byte[] extensionValue = null; // BER OCTET STRING
@@ -57,7 +59,7 @@
switch (status) {
case LdapClient.LDAP_COMPARE_TRUE:
status = LdapClient.LDAP_SUCCESS;
- entries = new Vector(1,1);
+ entries = new Vector<>(1,1);
Attributes attrs = new BasicAttributes(LdapClient.caseIgnore);
LdapEntry entry = new LdapEntry( name, attrs );
entries.addElement(entry);
@@ -66,7 +68,7 @@
case LdapClient.LDAP_COMPARE_FALSE:
status = LdapClient.LDAP_SUCCESS;
- entries = new Vector(0);
+ entries = new Vector<>(0);
successful = true;
break;
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapSchemaCtx.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapSchemaCtx.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -61,8 +61,9 @@
private int objectType;
- static DirContext createSchemaTree(Hashtable env, String subschemasubentry,
- LdapCtx schemaEntry, Attributes schemaAttrs, boolean netscapeBug)
+ static DirContext createSchemaTree(Hashtable<String,Object> env,
+ String subschemasubentry, LdapCtx schemaEntry,
+ Attributes schemaAttrs, boolean netscapeBug)
throws NamingException {
try {
LdapSchemaParser parser = new LdapSchemaParser(netscapeBug);
@@ -71,7 +72,7 @@
schemaEntry, parser);
LdapSchemaCtx root = new LdapSchemaCtx(SCHEMA_ROOT, env, allinfo);
- parser.LDAP2JNDISchema(schemaAttrs, root);
+ LdapSchemaParser.LDAP2JNDISchema(schemaAttrs, root);
return root;
} catch (NamingException e) {
schemaEntry.close(); // cleanup
@@ -80,7 +81,8 @@
}
// Called by createNewCtx
- private LdapSchemaCtx(int objectType, Hashtable environment, SchemaInfo info) {
+ private LdapSchemaCtx(int objectType, Hashtable<String,Object> environment,
+ SchemaInfo info) {
super(environment, LdapClient.caseIgnore);
this.objectType = objectType;
@@ -223,9 +225,9 @@
final private static Attributes deepClone(Attributes orig)
throws NamingException {
BasicAttributes copy = new BasicAttributes(true);
- NamingEnumeration attrs = orig.getAll();
+ NamingEnumeration<? extends Attribute> attrs = orig.getAll();
while (attrs.hasMore()) {
- copy.put((Attribute)((Attribute)attrs.next()).clone());
+ copy.put((Attribute)attrs.next().clone());
}
return copy;
}
@@ -409,13 +411,14 @@
}
}
- private LdapCtx reopenEntry(Hashtable env) throws NamingException {
+ private LdapCtx reopenEntry(Hashtable<?,?> env) throws NamingException {
// Use subschemasubentry name as DN
return new LdapCtx(schemaEntryName, host, port,
env, hasLdapsScheme);
}
- synchronized void modifyAttributes(Hashtable env, ModificationItem[] mods)
+ synchronized void modifyAttributes(Hashtable<?,?> env,
+ ModificationItem[] mods)
throws NamingException {
if (schemaEntry == null) {
schemaEntry = reopenEntry(env);
@@ -423,7 +426,7 @@
schemaEntry.modifyAttributes("", mods);
}
- synchronized void modifyAttributes(Hashtable env, int mod,
+ synchronized void modifyAttributes(Hashtable<?,?> env, int mod,
Attributes attrs) throws NamingException {
if (schemaEntry == null) {
schemaEntry = reopenEntry(env);
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapSchemaParser.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapSchemaParser.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -27,7 +27,6 @@
import javax.naming.*;
import javax.naming.directory.*;
-import java.util.Hashtable;
import java.util.Vector;
/**
@@ -141,9 +140,9 @@
LdapSchemaCtx schemaRoot)
throws NamingException {
- NamingEnumeration objDescs;
- Attributes objDef;
- LdapSchemaCtx classDefTree;
+ NamingEnumeration<?> objDescs;
+ Attributes objDef;
+ LdapSchemaCtx classDefTree;
// create the class def subtree
Attributes attrs = new BasicAttributes(LdapClient.caseIgnore);
@@ -173,9 +172,9 @@
LdapSchemaCtx schemaRoot)
throws NamingException {
- NamingEnumeration attrDescs;
- Attributes attrDef;
- LdapSchemaCtx attrDefTree;
+ NamingEnumeration<?> attrDescs;
+ Attributes attrDef;
+ LdapSchemaCtx attrDefTree;
// create the AttributeDef subtree
Attributes attrs = new BasicAttributes(LdapClient.caseIgnore);
@@ -206,9 +205,9 @@
LdapSchemaCtx schemaRoot)
throws NamingException {
- NamingEnumeration syntaxDescs;
- Attributes syntaxDef;
- LdapSchemaCtx syntaxDefTree;
+ NamingEnumeration<?> syntaxDescs;
+ Attributes syntaxDef;
+ LdapSchemaCtx syntaxDefTree;
// create the SyntaxDef subtree
Attributes attrs = new BasicAttributes(LdapClient.caseIgnore);
@@ -239,9 +238,9 @@
LdapSchemaCtx schemaRoot)
throws NamingException {
- NamingEnumeration matchRuleDescs;
- Attributes matchRuleDef;
- LdapSchemaCtx matchRuleDefTree;
+ NamingEnumeration<?> matchRuleDescs;
+ Attributes matchRuleDef;
+ LdapSchemaCtx matchRuleDefTree;
// create the MatchRuleDef subtree
Attributes attrs = new BasicAttributes(LdapClient.caseIgnore);
@@ -519,8 +518,8 @@
final private static String[] readQDescrList(String string, int[] pos)
throws NamingException {
- int begin, end;
- Vector values = new Vector(5);
+ int begin, end;
+ Vector<String> values = new Vector<>(5);
if (debug) {
System.err.println("ReadQDescrList: pos="+pos[0]);
@@ -553,7 +552,7 @@
String[] answer = new String[values.size()];
for (int i = 0; i < answer.length; i++) {
- answer[i] = (String)values.elementAt(i);
+ answer[i] = values.elementAt(i);
}
return answer;
}
@@ -614,7 +613,7 @@
int begin, cur, end;
String oidName = null;
- Vector values = new Vector(5);
+ Vector<String> values = new Vector<>(5);
if (debug) {
System.err.println("ReadOIDList: pos="+pos[0]);
@@ -663,7 +662,7 @@
String[] answer = new String[values.size()];
for (int i = 0; i < answer.length; i++) {
- answer[i] = (String)values.elementAt(i);
+ answer[i] = values.elementAt(i);
}
return answer;
}
@@ -843,10 +842,10 @@
String attrId = null;
// use enumeration because attribute ID is not known
- for (NamingEnumeration ae = attrs.getAll();
+ for (NamingEnumeration<? extends Attribute> ae = attrs.getAll();
ae.hasMoreElements(); ) {
- attr = (Attribute)ae.next();
+ attr = ae.next();
attrId = attr.getID();
// skip those already processed
@@ -973,10 +972,10 @@
String attrId = null;
// use enumeration because attribute ID is not known
- for (NamingEnumeration ae = attrs.getAll();
+ for (NamingEnumeration<? extends Attribute> ae = attrs.getAll();
ae.hasMoreElements(); ) {
- attr = (Attribute)ae.next();
+ attr = ae.next();
attrId = attr.getID();
// skip those already processed
@@ -1040,10 +1039,10 @@
String attrId = null;
// use enumeration because attribute ID is not known
- for (NamingEnumeration ae = attrs.getAll();
+ for (NamingEnumeration<? extends Attribute> ae = attrs.getAll();
ae.hasMoreElements(); ) {
- attr = (Attribute)ae.next();
+ attr = ae.next();
attrId = attr.getID();
// skip those already processed
@@ -1117,10 +1116,10 @@
String attrId = null;
// use enumeration because attribute ID is not known
- for (NamingEnumeration ae = attrs.getAll();
+ for (NamingEnumeration<? extends Attribute> ae = attrs.getAll();
ae.hasMoreElements(); ) {
- attr = (Attribute)ae.next();
+ attr = ae.next();
attrId = attr.getID();
// skip those already processed
@@ -1201,7 +1200,7 @@
qdList.append(WHSP);
qdList.append(OID_LIST_BEGIN);
- NamingEnumeration values = attr.getAll();
+ NamingEnumeration<?> values = attr.getAll();
while(values.hasMore()) {
qdList.append(WHSP);
@@ -1238,7 +1237,7 @@
oidList.append(WHSP);
oidList.append(OID_LIST_BEGIN);
- NamingEnumeration values = oidsAttr.getAll();
+ NamingEnumeration<?> values = oidsAttr.getAll();
oidList.append(WHSP);
oidList.append(values.next());
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapSearchEnumeration.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapSearchEnumeration.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -34,7 +34,8 @@
import com.sun.jndi.toolkit.ctx.Continuation;
-final class LdapSearchEnumeration extends LdapNamingEnumeration {
+final class LdapSearchEnumeration
+ extends AbstractLdapNamingEnumeration<SearchResult> {
private Name startName; // prefix of names of search results
private LdapCtx.SearchArgs searchArgs = null;
@@ -52,9 +53,10 @@
searchArgs = args;
}
- protected NameClassPair
- createItem(String dn, Attributes attrs, Vector respCtls)
- throws NamingException {
+ @Override
+ protected SearchResult createItem(String dn, Attributes attrs,
+ Vector<Control> respCtls)
+ throws NamingException {
Object obj = null;
@@ -174,6 +176,7 @@
return sr;
}
+ @Override
public void appendUnprocessedReferrals(LdapReferralException ex) {
// a referral has been followed so do not create relative names
@@ -181,14 +184,16 @@
super.appendUnprocessedReferrals(ex);
}
- protected LdapNamingEnumeration
- getReferredResults(LdapReferralContext refCtx) throws NamingException {
+ @Override
+ protected LdapSearchEnumeration getReferredResults(
+ LdapReferralContext refCtx) throws NamingException {
// repeat the original operation at the new context
- return (LdapSearchEnumeration)
- refCtx.search(searchArgs.name, searchArgs.filter, searchArgs.cons);
+ return (LdapSearchEnumeration)refCtx.search(
+ searchArgs.name, searchArgs.filter, searchArgs.cons);
}
- protected void update(LdapNamingEnumeration ne) {
+ @Override
+ protected void update(AbstractLdapNamingEnumeration<SearchResult> ne) {
super.update(ne);
// Update search-specific variables
--- a/jdk/src/share/classes/com/sun/jndi/ldap/NamingEventNotifier.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/NamingEventNotifier.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -50,12 +50,12 @@
final class NamingEventNotifier implements Runnable {
private final static boolean debug = false;
- private Vector namingListeners;
+ private Vector<NamingListener> namingListeners;
private Thread worker;
private LdapCtx context;
private EventContext eventSrc;
private EventSupport support;
- private NamingEnumeration results;
+ private NamingEnumeration<SearchResult> results;
// package private; used by EventSupport to remove it
NotifierArgs info;
@@ -83,7 +83,7 @@
context = (LdapCtx)ctx.newInstance(new Control[]{psearch});
eventSrc = ctx;
- namingListeners = new Vector();
+ namingListeners = new Vector<>();
namingListeners.addElement(firstListener);
worker = Obj.helper.createThread(this);
@@ -124,7 +124,8 @@
// Change root of search results so that it will generate
// names relative to the event context instead of that
// named by nm
- ((LdapSearchEnumeration)results).setStartName(context.currentParsedDN);
+ ((LdapSearchEnumeration)(NamingEnumeration)results)
+ .setStartName(context.currentParsedDN);
SearchResult si;
Control[] respctls;
@@ -132,7 +133,7 @@
long changeNum;
while (results.hasMore()) {
- si = (SearchResult)results.next();
+ si = results.next();
respctls = (si instanceof HasControls) ?
((HasControls) si).getControls() : null;
--- a/jdk/src/share/classes/com/sun/jndi/ldap/NotifierArgs.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/NotifierArgs.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -133,7 +133,7 @@
private int controlsCode() {
if (controls == null) return 0;
- int total = (int)controls.getTimeLimit() + (int)controls.getCountLimit() +
+ int total = controls.getTimeLimit() + (int)controls.getCountLimit() +
(controls.getDerefLinkFlag() ? 1 : 0) +
(controls.getReturningObjFlag() ? 1 : 0);
--- a/jdk/src/share/classes/com/sun/jndi/ldap/Obj.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/Obj.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -84,6 +84,7 @@
/**
* @deprecated
*/
+ @Deprecated
private static final int REMOTE_LOC = 7;
// LDAP object classes to support Java objects
@@ -206,13 +207,13 @@
} else {
StringTokenizer parser =
new StringTokenizer((String)codebaseAttr.get());
- Vector vec = new Vector(10);
+ Vector<String> vec = new Vector<>(10);
while (parser.hasMoreTokens()) {
vec.addElement(parser.nextToken());
}
String[] answer = new String[vec.size()];
for (int i = 0; i < answer.length; i++) {
- answer[i] = (String)vec.elementAt(i);
+ answer[i] = vec.elementAt(i);
}
return answer;
}
@@ -410,10 +411,10 @@
* Temporary Vector for decoded RefAddr addresses - used to ensure
* unordered addresses are correctly re-ordered.
*/
- Vector refAddrList = new Vector();
+ Vector<RefAddr> refAddrList = new Vector<>();
refAddrList.setSize(attr.size());
- for (NamingEnumeration vals = attr.getAll(); vals.hasMore(); ) {
+ for (NamingEnumeration<?> vals = attr.getAll(); vals.hasMore(); ) {
val = (String)vals.next();
@@ -488,7 +489,7 @@
// Copy to real reference
for (int i = 0; i < refAddrList.size(); i++) {
- ref.add((RefAddr)refAddrList.elementAt(i));
+ ref.add(refAddrList.elementAt(i));
}
}
@@ -502,9 +503,9 @@
try {
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
- ObjectOutputStream serial = new ObjectOutputStream(bytes);
- serial.writeObject(obj);
- serial.close();
+ try (ObjectOutputStream serial = new ObjectOutputStream(bytes)) {
+ serial.writeObject(obj);
+ }
return (bytes.toByteArray());
@@ -524,18 +525,14 @@
try {
// Create ObjectInputStream for deserialization
ByteArrayInputStream bytes = new ByteArrayInputStream(obj);
- ObjectInputStream deserial = (cl == null ?
- new ObjectInputStream(bytes) :
- new LoaderInputStream(bytes, cl));
-
- try {
+ try (ObjectInputStream deserial = cl == null ?
+ new ObjectInputStream(bytes) :
+ new LoaderInputStream(bytes, cl)) {
return deserial.readObject();
} catch (ClassNotFoundException e) {
NamingException ne = new NamingException();
ne.setRootCause(e);
throw ne;
- } finally {
- deserial.close();
}
} catch (IOException e) {
NamingException ne = new NamingException();
@@ -549,7 +546,7 @@
*/
static Attributes determineBindAttrs(
char separator, Object obj, Attributes attrs, boolean cloned,
- Name name, Context ctx, Hashtable env)
+ Name name, Context ctx, Hashtable<?,?> env)
throws NamingException {
// Call state factories to convert object and attrs
@@ -582,10 +579,10 @@
} else {
// Get existing objectclass attribute
- objectClass = (Attribute)attrs.get("objectClass");
+ objectClass = attrs.get("objectClass");
if (objectClass == null && !attrs.isCaseIgnored()) {
// %%% workaround
- objectClass = (Attribute)attrs.get("objectclass");
+ objectClass = attrs.get("objectclass");
}
// No objectclasses supplied, use "top" to start
@@ -614,8 +611,8 @@
classLoader = cl;
}
- protected Class resolveClass(ObjectStreamClass desc) throws IOException,
- ClassNotFoundException {
+ protected Class<?> resolveClass(ObjectStreamClass desc) throws
+ IOException, ClassNotFoundException {
try {
// %%% Should use Class.forName(desc.getName(), false, classLoader);
// except we can't because that is only available on JDK1.2
@@ -625,15 +622,15 @@
}
}
- protected Class resolveProxyClass(String[] interfaces) throws
+ protected Class<?> resolveProxyClass(String[] interfaces) throws
IOException, ClassNotFoundException {
ClassLoader nonPublicLoader = null;
boolean hasNonPublicInterface = false;
// define proxy in class loader of non-public interface(s), if any
- Class[] classObjs = new Class[interfaces.length];
+ Class<?>[] classObjs = new Class<?>[interfaces.length];
for (int i = 0; i < interfaces.length; i++) {
- Class cl = Class.forName(interfaces[i], false, classLoader);
+ Class<?> cl = Class.forName(interfaces[i], false, classLoader);
if ((cl.getModifiers() & Modifier.PUBLIC) == 0) {
if (hasNonPublicInterface) {
if (nonPublicLoader != cl.getClassLoader()) {
--- a/jdk/src/share/classes/com/sun/jndi/ldap/ReferralEnumeration.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/ReferralEnumeration.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -27,6 +27,6 @@
import javax.naming.NamingEnumeration;
-interface ReferralEnumeration extends NamingEnumeration {
+interface ReferralEnumeration<T> extends NamingEnumeration<T> {
void appendUnprocessedReferrals(LdapReferralException ex);
}
--- a/jdk/src/share/classes/com/sun/jndi/ldap/ServiceLocator.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/ServiceLocator.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2003, 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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,9 +26,7 @@
package com.sun.jndi.ldap;
import java.util.Arrays;
-import java.util.Enumeration;
import java.util.Hashtable;
-import java.util.NoSuchElementException;
import java.util.Random;
import java.util.StringTokenizer;
import java.util.List;
@@ -39,8 +37,6 @@
import javax.naming.ldap.LdapName;
import javax.naming.ldap.Rdn;
-import com.sun.jndi.ldap.LdapURL;
-
/**
* This class discovers the location of LDAP services by querying DNS.
* See http://www.ietf.org/internet-drafts/draft-ietf-ldapext-locate-07.txt
@@ -78,10 +74,10 @@
// process RDNs left-to-right
//List<Rdn> rdnList = ldapName.getRdns();
- List rdnList = ldapName.getRdns();
+ List<Rdn> rdnList = ldapName.getRdns();
for (int i = rdnList.size() - 1; i >= 0; i--) {
//Rdn rdn = rdnList.get(i);
- Rdn rdn = (Rdn) rdnList.get(i);
+ Rdn rdn = rdnList.get(i);
// single-valued RDN with a DC attribute
if ((rdn.size() == 1) &&
@@ -117,7 +113,7 @@
* @return An ordered list of hostports for the LDAP service or null if
* the service has not been located.
*/
- static String[] getLdapService(String domainName, Hashtable environment) {
+ static String[] getLdapService(String domainName, Hashtable<?,?> environment) {
if (domainName == null || domainName.length() == 0) {
return null;
@@ -252,7 +248,7 @@
* See http://www.ietf.org/rfc/rfc2782.txt
*/
-static class SrvRecord implements Comparable {
+static class SrvRecord implements Comparable<SrvRecord> {
int priority;
int weight;
@@ -284,8 +280,7 @@
* Sort records in ascending order of priority value. For records with
* equal priority move those with weight 0 to the top of the list.
*/
- public int compareTo(Object o) {
- SrvRecord that = (SrvRecord) o;
+ public int compareTo(SrvRecord that) {
if (priority > that.priority) {
return 1; // this > that
} else if (priority < that.priority) {
--- a/jdk/src/share/classes/com/sun/jndi/ldap/SimpleClientId.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/SimpleClientId.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2005, 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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -54,9 +54,9 @@
} else if (passwd instanceof String) {
this.passwd = passwd;
} else if (passwd instanceof byte[]) {
- this.passwd = (byte[]) ((byte[])passwd).clone();
+ this.passwd = ((byte[])passwd).clone();
} else if (passwd instanceof char[]) {
- this.passwd = (char[]) ((char[])passwd).clone();
+ this.passwd = ((char[])passwd).clone();
} else {
this.passwd = passwd;
}
--- a/jdk/src/share/classes/com/sun/jndi/ldap/UnsolicitedResponseImpl.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/UnsolicitedResponseImpl.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -41,7 +41,7 @@
private NamingException exception;
private Control[] controls;
- UnsolicitedResponseImpl(String oid, byte[] berVal, Vector ref,
+ UnsolicitedResponseImpl(String oid, byte[] berVal, Vector<Vector<String>> ref,
int status, String msg, String matchedDN, Control[] controls) {
this.oid = oid;
this.extensionValue = berVal;
@@ -50,7 +50,8 @@
int len = ref.size();
referrals = new String[len];
for (int i = 0; i < len; i++) {
- referrals[i] = (String)ref.elementAt(i);
+ // ref is a list of single-String Vectors
+ referrals[i] = ref.elementAt(i).elementAt(0);
}
}
exception = LdapCtx.mapErrorCode(status, msg);
--- a/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -72,7 +72,7 @@
return urlArray;
}
- abstract Class loadClass(String className) throws ClassNotFoundException;
+ abstract Class<?> loadClass(String className) throws ClassNotFoundException;
abstract Thread createThread(Runnable r);
}
--- a/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -66,15 +66,15 @@
}
}
- Class loadClass(String className) throws ClassNotFoundException {
+ Class<?> loadClass(String className) throws ClassNotFoundException {
ClassLoader cl = getContextClassLoader();
return Class.forName(className, true, cl);
}
private ClassLoader getContextClassLoader() {
- return (ClassLoader) AccessController.doPrivileged(
- new PrivilegedAction() {
- public Object run() {
+ return AccessController.doPrivileged(
+ new PrivilegedAction<ClassLoader>() {
+ public ClassLoader run() {
return Thread.currentThread().getContextClassLoader();
}
}
@@ -82,9 +82,9 @@
}
Thread createThread(final Runnable r) {
- return (Thread) AccessController.doPrivileged(
- new PrivilegedAction() {
- public Object run() {
+ return AccessController.doPrivileged(
+ new PrivilegedAction<Thread>() {
+ public Thread run() {
return new Thread(r);
}
}
--- a/jdk/src/share/classes/com/sun/jndi/ldap/ext/StartTlsResponseImpl.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/ext/StartTlsResponseImpl.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -27,16 +27,8 @@
import java.io.InputStream;
import java.io.OutputStream;
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
import java.io.IOException;
-import java.net.Socket;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
import java.security.Principal;
import java.security.cert.X509Certificate;
import java.security.cert.CertificateException;
@@ -45,11 +37,9 @@
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.SSLPeerUnverifiedException;
-import javax.net.ssl.SSLContext;
import javax.net.ssl.HostnameVerifier;
import sun.security.util.HostnameChecker;
-import javax.naming.*;
import javax.naming.ldap.*;
import com.sun.jndi.ldap.Connection;
@@ -415,7 +405,7 @@
// Use ciphersuite to determine whether Kerberos is active.
if (session.getCipherSuite().startsWith("TLS_KRB5")) {
Principal principal = getPeerPrincipal(session);
- if (!checker.match(hostname, principal)) {
+ if (!HostnameChecker.match(hostname, principal)) {
throw new SSLPeerUnverifiedException(
"hostname of the kerberos principal:" + principal +
" does not match the hostname:" + hostname);
--- a/jdk/src/share/classes/com/sun/jndi/ldap/pool/Connections.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/pool/Connections.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * 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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -71,10 +71,10 @@
final private int maxSize;
final private int prefSize;
- final private List conns;
+ final private List<ConnectionDesc> conns;
private boolean closed = false; // Closed for business
- private Reference ref; // maintains reference to id to prevent premature GC
+ private Reference<Object> ref; // maintains reference to id to prevent premature GC
/**
* @param id the identity (connection request) of the connections in the list
@@ -99,11 +99,11 @@
} else {
this.prefSize = prefSize;
}
- conns = new ArrayList(maxSize > 0 ? maxSize : DEFAULT_SIZE);
+ conns = new ArrayList<>(maxSize > 0 ? maxSize : DEFAULT_SIZE);
// Maintain soft ref to id so that this Connections' entry in
// Pool doesn't get GC'ed prematurely
- ref = new SoftReference(id);
+ ref = new SoftReference<>(id);
d("init size=", initSize);
d("max size=", maxSize);
@@ -186,7 +186,7 @@
// exceeds prefSize, then first look for an idle connection
ConnectionDesc entry;
for (int i = 0; i < size; i++) {
- entry = (ConnectionDesc) conns.get(i);
+ entry = conns.get(i);
if ((conn = entry.tryUse()) != null) {
d("get(): use ", conn);
td("Use ", conn);
@@ -239,7 +239,7 @@
td("Release ", conn);
// Get ConnectionDesc from list to get correct state info
- entry = (ConnectionDesc) conns.get(loc);
+ entry = conns.get(loc);
// Return connection to list, ready for reuse
entry.release();
}
@@ -291,10 +291,10 @@
* @return true if no more connections in list
*/
synchronized boolean expire(long threshold) {
- Iterator iter = conns.iterator();
+ Iterator<ConnectionDesc> iter = conns.iterator();
ConnectionDesc entry;
while (iter.hasNext()) {
- entry = (ConnectionDesc) iter.next();
+ entry = iter.next();
if (entry.expire(threshold)) {
d("expire(): removing ", entry);
td("Expired ", entry);
@@ -333,7 +333,7 @@
ConnectionDesc entry;
for (int i = 0; i < len; i++) {
- entry = (ConnectionDesc) conns.get(i);
+ entry = conns.get(i);
use += entry.getUseCount();
switch (entry.getState()) {
case ConnectionDesc.BUSY:
--- a/jdk/src/share/classes/com/sun/jndi/ldap/pool/ConnectionsWeakRef.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/pool/ConnectionsWeakRef.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -55,11 +55,12 @@
* reference to Connections used for closing (which in turn terminates
* the Connection thread) it by monitoring the ReferenceQueue.
*/
-class ConnectionsWeakRef extends WeakReference {
+class ConnectionsWeakRef extends WeakReference<ConnectionsRef> {
private final Connections conns;
- ConnectionsWeakRef (ConnectionsRef connsRef, ReferenceQueue queue) {
+ ConnectionsWeakRef (ConnectionsRef connsRef,
+ ReferenceQueue<? super ConnectionsRef> queue) {
super(connsRef, queue);
this.conns = connsRef.getConnections();
}
--- a/jdk/src/share/classes/com/sun/jndi/ldap/pool/Pool.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/pool/Pool.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2003, 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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,6 @@
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
-import java.util.Set;
import java.util.LinkedList;
import java.io.PrintStream;
@@ -83,17 +82,18 @@
/*
* Used for connections cleanup
*/
- private static final ReferenceQueue queue = new ReferenceQueue();
- private static final Collection weakRefs =
- Collections.synchronizedList(new LinkedList());
+ private static final ReferenceQueue<ConnectionsRef> queue =
+ new ReferenceQueue<>();
+ private static final Collection<Reference<ConnectionsRef>> weakRefs =
+ Collections.synchronizedList(new LinkedList<Reference<ConnectionsRef>>());
final private int maxSize; // max num of identical conn per pool
final private int prefSize; // preferred num of identical conn per pool
final private int initSize; // initial number of identical conn to create
- final private Map map;
+ final private Map<Object, ConnectionsRef> map;
public Pool(int initSize, int prefSize, int maxSize) {
- map = new WeakHashMap();
+ map = new WeakHashMap<>();
this.prefSize = prefSize;
this.maxSize = maxSize;
this.initSize = initSize;
@@ -135,7 +135,8 @@
map.put(id, connsRef);
// Create a weak reference to ConnectionsRef
- Reference weakRef = new ConnectionsWeakRef(connsRef, queue);
+ Reference<ConnectionsRef> weakRef =
+ new ConnectionsWeakRef(connsRef, queue);
// Keep the weak reference through the element of a linked list
weakRefs.add(weakRef);
@@ -148,7 +149,7 @@
}
private Connections getConnections(Object id) {
- ConnectionsRef ref = (ConnectionsRef) map.get(id);
+ ConnectionsRef ref = map.get(id);
return (ref != null) ? ref.getConnections() : null;
}
@@ -163,11 +164,10 @@
*/
public void expire(long threshold) {
synchronized (map) {
- Collection coll = map.values();
- Iterator iter = coll.iterator();
+ Iterator<ConnectionsRef> iter = map.values().iterator();
Connections conns;
while (iter.hasNext()) {
- conns = ((ConnectionsRef) (iter.next())).getConnections();
+ conns = iter.next().getConnections();
if (conns.expire(threshold)) {
d("expire(): removing ", conns);
iter.remove();
@@ -202,7 +202,6 @@
public void showStats(PrintStream out) {
- Map.Entry entry;
Object id;
Connections conns;
@@ -212,13 +211,9 @@
out.println("initial pool size: " + initSize);
out.println("current pool size: " + map.size());
- Set entries = map.entrySet();
- Iterator iter = entries.iterator();
-
- while (iter.hasNext()) {
- entry = (Map.Entry) iter.next();
+ for (Map.Entry<Object, ConnectionsRef> entry : map.entrySet()) {
id = entry.getKey();
- conns = ((ConnectionsRef) entry.getValue()).getConnections();
+ conns = entry.getValue().getConnections();
out.println(" " + id + ":" + conns.getStats());
}
--- a/jdk/src/share/classes/com/sun/jndi/ldap/pool/PoolCleaner.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/pool/PoolCleaner.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * 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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -41,7 +41,7 @@
public PoolCleaner(long period, Pool[] pools) {
super();
this.period = period;
- this.pools = (Pool[]) pools.clone();
+ this.pools = pools.clone();
setDaemon(true);
}
--- a/jdk/src/share/classes/com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -57,7 +57,7 @@
if (cred instanceof String) {
passwd = ((String)cred).toCharArray();
} else if (cred instanceof char[]) {
- passwd = (char[])((char[])cred).clone();
+ passwd = ((char[])cred).clone();
} else if (cred != null) {
// assume UTF-8 encoding
String orig = new String((byte[])cred, "UTF8");
--- a/jdk/src/share/classes/com/sun/jndi/ldap/sasl/LdapSasl.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/sasl/LdapSasl.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -89,9 +89,10 @@
* @param bindCtls The possibly null controls to accompany the bind
* @return LdapResult containing status of the bind
*/
+ @SuppressWarnings("unchecked")
public static LdapResult saslBind(LdapClient clnt, Connection conn,
String server, String dn, Object pw,
- String authMech, Hashtable env, Control[] bindCtls)
+ String authMech, Hashtable<?,?> env, Control[] bindCtls)
throws IOException, NamingException {
SaslClient saslClnt = null;
@@ -112,7 +113,7 @@
try {
// Create SASL client to use using SASL package
saslClnt = Sasl.createSaslClient(
- mechs, authzId, "ldap", server, env, cbh);
+ mechs, authzId, "ldap", server, (Hashtable<String, ?>)env, cbh);
if (saslClnt == null) {
throw new AuthenticationNotSupportedException(authMech);
@@ -185,13 +186,13 @@
*/
private static String[] getSaslMechanismNames(String str) {
StringTokenizer parser = new StringTokenizer(str);
- Vector mechs = new Vector(10);
+ Vector<String> mechs = new Vector<>(10);
while (parser.hasMoreTokens()) {
mechs.addElement(parser.nextToken());
}
String[] mechNames = new String[mechs.size()];
for (int i = 0; i < mechs.size(); i++) {
- mechNames[i] = (String)mechs.elementAt(i);
+ mechNames[i] = mechs.elementAt(i);
}
return mechNames;
}
--- a/jdk/src/share/classes/com/sun/jndi/rmi/registry/RegistryContext.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/rmi/registry/RegistryContext.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -46,7 +46,7 @@
public class RegistryContext implements Context, Referenceable {
- private Hashtable environment;
+ private Hashtable<String, Object> environment;
private Registry registry;
private String host;
private int port;
@@ -67,10 +67,13 @@
* Cloning of "env" is handled by caller; see comments within
* RegistryContextFactory.getObjectInstance(), for example.
*/
- public RegistryContext(String host, int port, Hashtable env)
+ @SuppressWarnings("unchecked")
+ public RegistryContext(String host, int port, Hashtable<?, ?> env)
throws NamingException
{
- environment = ((env == null) ? new Hashtable(5) : env);
+ environment = (env == null)
+ ? new Hashtable<String, Object>(5)
+ : (Hashtable<String, Object>) env;
if (environment.get(SECURITY_MGR) != null) {
installSecurityMgr();
}
@@ -93,8 +96,9 @@
* won't close the other).
*/
// %%% Alternatively, this could be done with a clone() method.
+ @SuppressWarnings("unchecked") // clone()
RegistryContext(RegistryContext ctx) {
- environment = (Hashtable)ctx.environment.clone();
+ environment = (Hashtable<String, Object>)ctx.environment.clone();
registry = ctx.registry;
host = ctx.host;
port = ctx.port;
@@ -195,7 +199,8 @@
rename(new CompositeName(name), new CompositeName(newName));
}
- public NamingEnumeration list(Name name) throws NamingException {
+ public NamingEnumeration<NameClassPair> list(Name name) throws
+ NamingException {
if (!name.isEmpty()) {
throw (new InvalidNameException(
"RegistryContext: can only list \"\""));
@@ -208,11 +213,12 @@
}
}
- public NamingEnumeration list(String name) throws NamingException {
+ public NamingEnumeration<NameClassPair> list(String name) throws
+ NamingException {
return list(new CompositeName(name));
}
- public NamingEnumeration listBindings(Name name)
+ public NamingEnumeration<Binding> listBindings(Name name)
throws NamingException
{
if (!name.isEmpty()) {
@@ -227,7 +233,8 @@
}
}
- public NamingEnumeration listBindings(String name) throws NamingException {
+ public NamingEnumeration<Binding> listBindings(String name) throws
+ NamingException {
return listBindings(new CompositeName(name));
}
@@ -290,8 +297,9 @@
return environment.put(propName, propVal);
}
- public Hashtable getEnvironment() throws NamingException {
- return (Hashtable)environment.clone();
+ @SuppressWarnings("unchecked") // clone()
+ public Hashtable<String, Object> getEnvironment() throws NamingException {
+ return (Hashtable<String, Object>)environment.clone();
}
public void close() {
@@ -483,11 +491,9 @@
/**
- * An enumeration of name / class-name pairs. Since we don't know anything
- * about the classes, each class name is returned as the generic
- * "java.lang.Object".
+ * An enumeration of name / class-name pairs.
*/
-class NameClassPairEnumeration implements NamingEnumeration {
+class NameClassPairEnumeration implements NamingEnumeration<NameClassPair> {
private final String[] names;
private int nextName; // index into "names"
@@ -500,7 +506,7 @@
return (nextName < names.length);
}
- public Object next() throws NamingException {
+ public NameClassPair next() throws NamingException {
if (!hasMore()) {
throw (new java.util.NoSuchElementException());
}
@@ -518,7 +524,7 @@
return hasMore();
}
- public Object nextElement() {
+ public NameClassPair nextElement() {
try {
return next();
} catch (NamingException e) { // should never happen
@@ -541,7 +547,7 @@
* requested. The problem with that approach is that Binding.getObject()
* cannot throw NamingException.
*/
-class BindingEnumeration implements NamingEnumeration {
+class BindingEnumeration implements NamingEnumeration<Binding> {
private RegistryContext ctx;
private final String[] names;
private int nextName; // index into "names"
@@ -564,7 +570,7 @@
return (nextName < names.length);
}
- public Object next() throws NamingException {
+ public Binding next() throws NamingException {
if (!hasMore()) {
throw (new java.util.NoSuchElementException());
}
@@ -584,7 +590,7 @@
return hasMore();
}
- public Object nextElement() {
+ public Binding nextElement() {
try {
return next();
} catch (NamingException e) {
--- a/jdk/src/share/classes/com/sun/jndi/rmi/registry/RegistryContextFactory.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/rmi/registry/RegistryContextFactory.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -95,7 +95,7 @@
return obj;
}
- private static Context URLToContext(String url, Hashtable env)
+ private static Context URLToContext(String url, Hashtable<?,?> env)
throws NamingException
{
rmiURLContextFactory factory = new rmiURLContextFactory();
@@ -108,7 +108,7 @@
}
}
- private static Object URLsToObject(String[] urls, Hashtable env)
+ private static Object URLsToObject(String[] urls, Hashtable<?,?> env)
throws NamingException
{
rmiURLContextFactory factory = new rmiURLContextFactory();
@@ -119,7 +119,7 @@
* Reads environment to find URL of initial context.
* The default URL is "rmi:".
*/
- private static String getInitCtxURL(Hashtable env) {
+ private static String getInitCtxURL(Hashtable<?,?> env) {
final String defaultURL = "rmi:";
@@ -152,9 +152,9 @@
int size = 0; // number of URLs
String[] urls = new String[ref.size()];
- Enumeration addrs = ref.getAll();
+ Enumeration<RefAddr> addrs = ref.getAll();
while (addrs.hasMoreElements()) {
- RefAddr addr = (RefAddr)addrs.nextElement();
+ RefAddr addr = addrs.nextElement();
if ((addr instanceof StringRefAddr) &&
addr.getType().equals(ADDRESS_TYPE)) {
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/corba/CorbaUtils.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/corba/CorbaUtils.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -158,7 +158,7 @@
* Use all String properties from env for initializing ORB
* @return A non-null ORB.
*/
- public static ORB getOrb(String server, int port, Hashtable env) {
+ public static ORB getOrb(String server, int port, Hashtable<?,?> env) {
// See if we can get info from environment
Properties orbProp;
@@ -169,7 +169,7 @@
orbProp = (Properties) env.clone();
} else {
// Get all String properties
- Enumeration envProp;
+ Enumeration<?> envProp;
orbProp = new Properties();
for (envProp = env.keys(); envProp.hasMoreElements();) {
String key = (String)envProp.nextElement();
@@ -239,7 +239,7 @@
// Fields used for reflection of RMI-IIOP
private static Method toStubMethod = null;
private static Method connectMethod = null;
- private static Class corbaStubClass = null;
+ private static Class<?> corbaStubClass = null;
/**
* Initializes reflection method handles for RMI-IIOP.
* @exception ClassNotFoundException javax.rmi.CORBA.* not available
@@ -252,19 +252,19 @@
try {
connectMethod = corbaStubClass.getMethod("connect",
- new Class[] {org.omg.CORBA.ORB.class});
+ new Class<?>[] {org.omg.CORBA.ORB.class});
} catch (NoSuchMethodException e) {
throw new IllegalStateException(
"No method definition for javax.rmi.CORBA.Stub.connect(org.omg.CORBA.ORB)");
}
- // Get javax.rmi.PortableRemoteObject method
- Class proClass = Class.forName("javax.rmi.PortableRemoteObject");
+ // Get javax.rmi.PortableRemoteObject class
+ Class<?> proClass = Class.forName("javax.rmi.PortableRemoteObject");
- // Get javax.rmi.PortableRemoteObject(java.rmi.Remote) method
+ // Get javax.rmi.PortableRemoteObject.toStub(java.rmi.Remote) method
try {
toStubMethod = proClass.getMethod("toStub",
- new Class[] {java.rmi.Remote.class});
+ new Class<?>[] {java.rmi.Remote.class});
} catch (NoSuchMethodException e) {
throw new IllegalStateException(
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/AtomicContext.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/AtomicContext.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -26,7 +26,6 @@
package com.sun.jndi.toolkit.ctx;
import javax.naming.*;
-import javax.naming.spi.ResolveResult;
/**
* Clients: deal only with names for its own naming service
@@ -58,9 +57,9 @@
protected abstract Object a_lookupLink(String name, Continuation cont)
throws NamingException;
- protected abstract NamingEnumeration a_list(
+ protected abstract NamingEnumeration<NameClassPair> a_list(
Continuation cont) throws NamingException;
- protected abstract NamingEnumeration a_listBindings(
+ protected abstract NamingEnumeration<Binding> a_listBindings(
Continuation cont) throws NamingException;
protected abstract void a_bind(String name, Object obj, Continuation cont)
throws NamingException;
@@ -193,12 +192,12 @@
return null;
}
- protected NamingEnumeration a_list_nns(Continuation cont)
+ protected NamingEnumeration<NameClassPair> a_list_nns(Continuation cont)
throws NamingException {
a_processJunction_nns(cont);
return null;
}
- protected NamingEnumeration a_listBindings_nns(Continuation cont)
+ protected NamingEnumeration<Binding> a_listBindings_nns(Continuation cont)
throws NamingException {
a_processJunction_nns(cont);
return null;
@@ -273,7 +272,7 @@
return null;
}
- protected NamingEnumeration c_list(Name name,
+ protected NamingEnumeration<NameClassPair> c_list(Name name,
Continuation cont) throws NamingException {
if (resolve_to_context(name, cont)) {
return a_list(cont);
@@ -281,7 +280,7 @@
return null;
}
- protected NamingEnumeration c_listBindings(Name name,
+ protected NamingEnumeration<Binding> c_listBindings(Name name,
Continuation cont) throws NamingException {
if (resolve_to_context(name, cont)) {
return a_listBindings(cont);
@@ -392,7 +391,7 @@
}
}
- protected NamingEnumeration c_list_nns(Name name,
+ protected NamingEnumeration<NameClassPair> c_list_nns(Name name,
Continuation cont) throws NamingException {
if (_contextType == _ATOMIC) {
resolve_to_nns_and_continue(name, cont);
@@ -403,14 +402,14 @@
}
}
- protected NamingEnumeration c_listBindings_nns(Name name,
+ protected NamingEnumeration<Binding> c_listBindings_nns(Name name,
Continuation cont) throws NamingException {
if (_contextType == _ATOMIC) {
resolve_to_nns_and_continue(name, cont);
return null;
} else {
// use ComponentContext
- return super.c_list_nns(name, cont);
+ return super.c_listBindings_nns(name, cont);
}
}
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/AtomicDirContext.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/AtomicDirContext.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -27,7 +27,6 @@
import javax.naming.*;
import javax.naming.directory.*;
-import javax.naming.spi.ResolveResult;
/**
* Direct subclasses of AtomicDirContext must provide implementations for
@@ -79,20 +78,25 @@
Continuation cont)
throws NamingException;
- protected abstract NamingEnumeration a_search(Attributes matchingAttributes,
+ protected abstract NamingEnumeration<SearchResult> a_search(
+ Attributes matchingAttributes,
String[] attributesToReturn,
Continuation cont)
throws NamingException;
- protected abstract NamingEnumeration a_search(String name,
+ protected abstract NamingEnumeration<SearchResult> a_search(
+ String name,
String filterExpr,
Object[] filterArgs,
- SearchControls cons, Continuation cont)
+ SearchControls cons,
+ Continuation cont)
throws NamingException;
- protected abstract NamingEnumeration a_search(String name,
+ protected abstract NamingEnumeration<SearchResult> a_search(
+ String name,
String filter,
- SearchControls cons, Continuation cont)
+ SearchControls cons,
+ Continuation cont)
throws NamingException;
protected abstract DirContext a_getSchema(Continuation cont)
@@ -163,7 +167,8 @@
return null;
}
- protected NamingEnumeration a_search_nns(Attributes matchingAttributes,
+ protected NamingEnumeration<SearchResult> a_search_nns(
+ Attributes matchingAttributes,
String[] attributesToReturn,
Continuation cont)
throws NamingException {
@@ -171,20 +176,20 @@
return null;
}
- protected NamingEnumeration a_search_nns(String name,
- String filterExpr,
- Object[] filterArgs,
- SearchControls cons,
- Continuation cont)
+ protected NamingEnumeration<SearchResult> a_search_nns(String name,
+ String filterExpr,
+ Object[] filterArgs,
+ SearchControls cons,
+ Continuation cont)
throws NamingException {
a_processJunction_nns(name, cont);
return null;
}
- protected NamingEnumeration a_search_nns(String name,
- String filter,
- SearchControls cons,
- Continuation cont)
+ protected NamingEnumeration<SearchResult> a_search_nns(String name,
+ String filter,
+ SearchControls cons,
+ Continuation cont)
throws NamingException {
a_processJunction_nns(name, cont);
return null;
@@ -250,7 +255,7 @@
return null;
}
- protected NamingEnumeration c_search(Name name,
+ protected NamingEnumeration<SearchResult> c_search(Name name,
Attributes matchingAttributes,
String[] attributesToReturn,
Continuation cont)
@@ -260,19 +265,21 @@
return null;
}
- protected NamingEnumeration c_search(Name name,
- String filter,
- SearchControls cons, Continuation cont)
+ protected NamingEnumeration<SearchResult> c_search(Name name,
+ String filter,
+ SearchControls cons,
+ Continuation cont)
throws NamingException {
if (resolve_to_penultimate_context(name, cont))
return a_search(name.toString(), filter, cons, cont);
return null;
}
- protected NamingEnumeration c_search(Name name,
- String filterExpr,
- Object[] filterArgs,
- SearchControls cons, Continuation cont)
+ protected NamingEnumeration<SearchResult> c_search(Name name,
+ String filterExpr,
+ Object[] filterArgs,
+ SearchControls cons,
+ Continuation cont)
throws NamingException {
if (resolve_to_penultimate_context(name, cont))
return a_search(name.toString(), filterExpr, filterArgs, cons, cont);
@@ -340,7 +347,8 @@
return null;
}
- protected NamingEnumeration c_search_nns(Name name,
+ protected NamingEnumeration<SearchResult> c_search_nns(
+ Name name,
Attributes matchingAttributes,
String[] attributesToReturn,
Continuation cont)
@@ -349,20 +357,21 @@
return null;
}
- protected NamingEnumeration c_search_nns(Name name,
- String filter,
- SearchControls cons, Continuation cont)
+ protected NamingEnumeration<SearchResult> c_search_nns(Name name,
+ String filter,
+ SearchControls cons,
+ Continuation cont)
throws NamingException {
if (resolve_to_penultimate_context_nns(name, cont))
return a_search_nns(name.toString(), filter, cons, cont);
return null;
}
- protected NamingEnumeration c_search_nns(Name name,
- String filterExpr,
- Object[] filterArgs,
- SearchControls cons,
- Continuation cont)
+ protected NamingEnumeration<SearchResult> c_search_nns(Name name,
+ String filterExpr,
+ Object[] filterArgs,
+ SearchControls cons,
+ Continuation cont)
throws NamingException {
if (resolve_to_penultimate_context_nns(name, cont))
return a_search_nns(name.toString(), filterExpr, filterArgs,
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/ComponentContext.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/ComponentContext.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -25,8 +25,6 @@
package com.sun.jndi.toolkit.ctx;
-import java.util.Hashtable;
-
import javax.naming.*;
import javax.naming.spi.ResolveResult;
@@ -57,9 +55,9 @@
protected abstract Object c_lookupLink(Name name, Continuation cont)
throws NamingException;
- protected abstract NamingEnumeration c_list(Name name,
+ protected abstract NamingEnumeration<NameClassPair> c_list(Name name,
Continuation cont) throws NamingException;
- protected abstract NamingEnumeration c_listBindings(Name name,
+ protected abstract NamingEnumeration<Binding> c_listBindings(Name name,
Continuation cont) throws NamingException;
protected abstract void c_bind(Name name, Object obj, Continuation cont)
throws NamingException;
@@ -237,13 +235,13 @@
return null;
}
- protected NamingEnumeration c_list_nns(Name name,
+ protected NamingEnumeration<NameClassPair> c_list_nns(Name name,
Continuation cont) throws NamingException {
c_processJunction_nns(name, cont);
return null;
}
- protected NamingEnumeration c_listBindings_nns(Name name,
+ protected NamingEnumeration<Binding> c_listBindings_nns(Name name,
Continuation cont) throws NamingException {
c_processJunction_nns(name, cont);
return null;
@@ -495,7 +493,7 @@
/* implementation for Resolver method */
protected ResolveResult p_resolveToClass(Name name,
- Class contextType,
+ Class<?> contextType,
Continuation cont)
throws NamingException {
@@ -556,9 +554,9 @@
return ret;
}
- protected NamingEnumeration p_list(Name name, Continuation cont)
+ protected NamingEnumeration<NameClassPair> p_list(Name name, Continuation cont)
throws NamingException {
- NamingEnumeration ret = null;
+ NamingEnumeration<NameClassPair> ret = null;
HeadTail res = p_resolveIntermediate(name, cont);
switch (res.getStatus()) {
case TERMINAL_NNS_COMPONENT:
@@ -581,9 +579,9 @@
return ret;
}
- protected NamingEnumeration p_listBindings(Name name, Continuation cont) throws
+ protected NamingEnumeration<Binding> p_listBindings(Name name, Continuation cont) throws
NamingException {
- NamingEnumeration ret = null;
+ NamingEnumeration<Binding> ret = null;
HeadTail res = p_resolveIntermediate(name, cont);
switch (res.getStatus()) {
case TERMINAL_NNS_COMPONENT:
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/ComponentDirContext.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/ComponentDirContext.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -28,8 +28,6 @@
import javax.naming.*;
import javax.naming.directory.*;
-import javax.naming.spi.ResolveResult;
-
/* Direct subclasses of ComponentDirContext must provide implementations for
* the abstract c_ DirContext methods, and override the c_ Context methods
* (which are no longer abstract because they have been overriden by
@@ -81,23 +79,26 @@
Continuation cont)
throws NamingException;
- protected abstract NamingEnumeration c_search(Name name,
- Attributes matchingAttributes,
- String[] attributesToReturn,
- Continuation cont)
+ protected abstract NamingEnumeration<SearchResult> c_search(
+ Name name,
+ Attributes matchingAttributes,
+ String[] attributesToReturn,
+ Continuation cont)
throws NamingException;
- protected abstract NamingEnumeration c_search(Name name,
- String filter,
- SearchControls cons,
- Continuation cont)
+ protected abstract NamingEnumeration<SearchResult> c_search(
+ Name name,
+ String filter,
+ SearchControls cons,
+ Continuation cont)
throws NamingException;
- protected abstract NamingEnumeration c_search(Name name,
- String filterExpr,
- Object[] filterArgs,
- SearchControls cons,
- Continuation cont)
+ protected abstract NamingEnumeration<SearchResult> c_search(
+ Name name,
+ String filterExpr,
+ Object[] filterArgs,
+ SearchControls cons,
+ Continuation cont)
throws NamingException;
protected abstract DirContext c_getSchema(Name name, Continuation cont)
@@ -172,29 +173,32 @@
return null;
}
- protected NamingEnumeration c_search_nns(Name name,
- Attributes matchingAttributes,
- String[] attributesToReturn,
- Continuation cont)
+ protected NamingEnumeration<SearchResult> c_search_nns(
+ Name name,
+ Attributes matchingAttributes,
+ String[] attributesToReturn,
+ Continuation cont)
throws NamingException {
c_processJunction_nns(name, cont);
return null;
}
- protected NamingEnumeration c_search_nns(Name name,
- String filter,
- SearchControls cons,
- Continuation cont)
+ protected NamingEnumeration<SearchResult> c_search_nns(
+ Name name,
+ String filter,
+ SearchControls cons,
+ Continuation cont)
throws NamingException {
c_processJunction_nns(name, cont);
return null;
}
- protected NamingEnumeration c_search_nns(Name name,
- String filterExpr,
- Object[] filterArgs,
- SearchControls cons,
- Continuation cont)
+ protected NamingEnumeration<SearchResult> c_search_nns(
+ Name name,
+ String filterExpr,
+ Object[] filterArgs,
+ SearchControls cons,
+ Continuation cont)
throws NamingException {
c_processJunction_nns(name, cont);
return null;
@@ -345,13 +349,14 @@
return answer;
}
- protected NamingEnumeration p_search(Name name,
- Attributes matchingAttributes,
- String[] attributesToReturn,
- Continuation cont)
+ protected NamingEnumeration<SearchResult> p_search(
+ Name name,
+ Attributes matchingAttributes,
+ String[] attributesToReturn,
+ Continuation cont)
throws NamingException {
HeadTail res = p_resolveIntermediate(name, cont);
- NamingEnumeration answer = null;
+ NamingEnumeration<SearchResult> answer = null;
switch (res.getStatus()) {
case TERMINAL_NNS_COMPONENT:
answer = c_search_nns(res.getHead(), matchingAttributes,
@@ -371,12 +376,13 @@
return answer;
}
- protected NamingEnumeration p_search(Name name,
- String filter,
- SearchControls cons, Continuation cont)
+ protected NamingEnumeration<SearchResult> p_search(Name name,
+ String filter,
+ SearchControls cons,
+ Continuation cont)
throws NamingException {
HeadTail res = p_resolveIntermediate(name, cont);
- NamingEnumeration answer = null;
+ NamingEnumeration<SearchResult> answer = null;
switch (res.getStatus()) {
case TERMINAL_NNS_COMPONENT:
answer = c_search_nns(res.getHead(), filter, cons, cont);
@@ -394,14 +400,14 @@
return answer;
}
- protected NamingEnumeration p_search(Name name,
- String filterExpr,
- Object[] filterArgs,
- SearchControls cons,
- Continuation cont)
+ protected NamingEnumeration<SearchResult> p_search(Name name,
+ String filterExpr,
+ Object[] filterArgs,
+ SearchControls cons,
+ Continuation cont)
throws NamingException {
HeadTail res = p_resolveIntermediate(name, cont);
- NamingEnumeration answer = null;
+ NamingEnumeration<SearchResult> answer = null;
switch (res.getStatus()) {
case TERMINAL_NNS_COMPONENT:
answer = c_search_nns(res.getHead(),
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/Continuation.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/Continuation.java Wed Jul 05 17:49:56 2017 +0200
@@ -57,7 +57,7 @@
* The environment used by the caller. Initialized by constructor and
* used when filling out a CannotProceedException.
*/
- protected Hashtable environment = null;
+ protected Hashtable<?,?> environment = null;
/**
* Indicates whether the Continuation instance indicates that the operation
@@ -94,7 +94,7 @@
* @param environment The environment used by the caller. It is used
* when setting the "environment" of a CannotProceedException.
*/
- public Continuation(Name top, Hashtable environment) {
+ public Continuation(Name top, Hashtable<?,?> environment) {
super();
starter = top;
this.environment = environment;
@@ -154,8 +154,8 @@
if ((e instanceof CannotProceedException)) {
CannotProceedException cpe = (CannotProceedException)e;
- Hashtable env = (environment == null ?
- new Hashtable(11) : (Hashtable)environment.clone());
+ Hashtable<?,?> env = (environment == null ?
+ new Hashtable<>(11) : (Hashtable<?,?>)environment.clone());
cpe.setEnvironment(env);
cpe.setAltNameCtx(resolvedContext);
cpe.setAltName(relativeResolvedName);
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/PartialCompositeContext.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/PartialCompositeContext.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -77,16 +77,16 @@
/* Equivalent to method in Resolver interface */
protected abstract ResolveResult p_resolveToClass(Name name,
- Class contextType, Continuation cont) throws NamingException;
+ Class<?> contextType, Continuation cont) throws NamingException;
/* Equivalent to methods in Context interface */
protected abstract Object p_lookup(Name name, Continuation cont)
throws NamingException;
protected abstract Object p_lookupLink(Name name, Continuation cont)
throws NamingException;
- protected abstract NamingEnumeration p_list(Name name,
+ protected abstract NamingEnumeration<NameClassPair> p_list(Name name,
Continuation cont) throws NamingException;
- protected abstract NamingEnumeration p_listBindings(Name name,
+ protected abstract NamingEnumeration<Binding> p_listBindings(Name name,
Continuation cont) throws NamingException;
protected abstract void p_bind(Name name, Object obj, Continuation cont)
throws NamingException;
@@ -115,7 +115,7 @@
* The toolkit knows to clone when necessary.
* @return The possibly null environment of the context.
*/
- protected Hashtable p_getEnvironment() throws NamingException {
+ protected Hashtable<?,?> p_getEnvironment() throws NamingException {
return getEnvironment();
}
@@ -137,7 +137,7 @@
throws NamingException
{
PartialCompositeContext ctx = this;
- Hashtable env = p_getEnvironment();
+ Hashtable<?,?> env = p_getEnvironment();
Continuation cont = new Continuation(name, env);
ResolveResult answer;
Name nm = name;
@@ -168,7 +168,7 @@
public Object lookup(Name name) throws NamingException {
PartialCompositeContext ctx = this;
- Hashtable env = p_getEnvironment();
+ Hashtable<?,?> env = p_getEnvironment();
Continuation cont = new Continuation(name, env);
Object answer;
Name nm = name;
@@ -194,7 +194,7 @@
public void bind(Name name, Object newObj) throws NamingException {
PartialCompositeContext ctx = this;
Name nm = name;
- Hashtable env = p_getEnvironment();
+ Hashtable<?,?> env = p_getEnvironment();
Continuation cont = new Continuation(name, env);
try {
@@ -216,7 +216,7 @@
public void rebind(Name name, Object newObj) throws NamingException {
PartialCompositeContext ctx = this;
Name nm = name;
- Hashtable env = p_getEnvironment();
+ Hashtable<?,?> env = p_getEnvironment();
Continuation cont = new Continuation(name, env);
try {
@@ -238,7 +238,7 @@
public void unbind(Name name) throws NamingException {
PartialCompositeContext ctx = this;
Name nm = name;
- Hashtable env = p_getEnvironment();
+ Hashtable<?,?> env = p_getEnvironment();
Continuation cont = new Continuation(name, env);
try {
@@ -262,7 +262,7 @@
{
PartialCompositeContext ctx = this;
Name nm = oldName;
- Hashtable env = p_getEnvironment();
+ Hashtable<?,?> env = p_getEnvironment();
Continuation cont = new Continuation(oldName, env);
try {
@@ -293,8 +293,8 @@
{
PartialCompositeContext ctx = this;
Name nm = name;
- NamingEnumeration answer;
- Hashtable env = p_getEnvironment();
+ NamingEnumeration<NameClassPair> answer;
+ Hashtable<?,?> env = p_getEnvironment();
Continuation cont = new Continuation(name, env);
try {
@@ -322,8 +322,8 @@
{
PartialCompositeContext ctx = this;
Name nm = name;
- NamingEnumeration answer;
- Hashtable env = p_getEnvironment();
+ NamingEnumeration<Binding> answer;
+ Hashtable<?,?> env = p_getEnvironment();
Continuation cont = new Continuation(name, env);
try {
@@ -347,7 +347,7 @@
public void destroySubcontext(Name name) throws NamingException {
PartialCompositeContext ctx = this;
Name nm = name;
- Hashtable env = p_getEnvironment();
+ Hashtable<?,?> env = p_getEnvironment();
Continuation cont = new Continuation(name, env);
try {
@@ -371,7 +371,7 @@
PartialCompositeContext ctx = this;
Name nm = name;
Context answer;
- Hashtable env = p_getEnvironment();
+ Hashtable<?,?> env = p_getEnvironment();
Continuation cont = new Continuation(name, env);
try {
@@ -394,7 +394,7 @@
public Object lookupLink(Name name) throws NamingException {
PartialCompositeContext ctx = this;
- Hashtable env = p_getEnvironment();
+ Hashtable<?,?> env = p_getEnvironment();
Continuation cont = new Continuation(name, env);
Object answer;
Name nm = name;
@@ -421,7 +421,7 @@
PartialCompositeContext ctx = this;
Name nm = name;
NameParser answer;
- Hashtable env = p_getEnvironment();
+ Hashtable<?,?> env = p_getEnvironment();
Continuation cont = new Continuation(name, env);
try {
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/PartialCompositeDirContext.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/PartialCompositeDirContext.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -29,7 +29,6 @@
import javax.naming.*;
import javax.naming.directory.*;
-import javax.naming.spi.NamingManager;
import javax.naming.spi.DirectoryManager;
/*
@@ -83,23 +82,26 @@
Continuation cont)
throws NamingException;
- protected abstract NamingEnumeration p_search(Name name,
- Attributes matchingAttributes,
- String[] attributesToReturn,
- Continuation cont)
+ protected abstract NamingEnumeration<SearchResult> p_search(
+ Name name,
+ Attributes matchingAttributes,
+ String[] attributesToReturn,
+ Continuation cont)
throws NamingException;
- protected abstract NamingEnumeration p_search(Name name,
- String filter,
- SearchControls cons,
- Continuation cont)
+ protected abstract NamingEnumeration<SearchResult> p_search(
+ Name name,
+ String filter,
+ SearchControls cons,
+ Continuation cont)
throws NamingException;
- protected abstract NamingEnumeration p_search(Name name,
- String filterExpr,
- Object[] filterArgs,
- SearchControls cons,
- Continuation cont)
+ protected abstract NamingEnumeration<SearchResult> p_search(
+ Name name,
+ String filterExpr,
+ Object[] filterArgs,
+ SearchControls cons,
+ Continuation cont)
throws NamingException;
protected abstract DirContext p_getSchema(Name name, Continuation cont)
@@ -130,7 +132,7 @@
public Attributes getAttributes(Name name, String[] attrIds)
throws NamingException {
PartialCompositeDirContext ctx = this;
- Hashtable env = p_getEnvironment();
+ Hashtable<?,?> env = p_getEnvironment();
Continuation cont = new Continuation(name, env);
Attributes answer;
Name nm = name;
@@ -157,7 +159,7 @@
public void modifyAttributes(Name name, int mod_op, Attributes attrs)
throws NamingException {
PartialCompositeDirContext ctx = this;
- Hashtable env = p_getEnvironment();
+ Hashtable<?,?> env = p_getEnvironment();
Continuation cont = new Continuation(name, env);
Name nm = name;
@@ -182,7 +184,7 @@
public void modifyAttributes(Name name, ModificationItem[] mods)
throws NamingException {
PartialCompositeDirContext ctx = this;
- Hashtable env = p_getEnvironment();
+ Hashtable<?,?> env = p_getEnvironment();
Continuation cont = new Continuation(name, env);
Name nm = name;
@@ -207,7 +209,7 @@
public void bind(Name name, Object obj, Attributes attrs)
throws NamingException {
PartialCompositeDirContext ctx = this;
- Hashtable env = p_getEnvironment();
+ Hashtable<?,?> env = p_getEnvironment();
Continuation cont = new Continuation(name, env);
Name nm = name;
@@ -232,7 +234,7 @@
public void rebind(Name name, Object obj, Attributes attrs)
throws NamingException {
PartialCompositeDirContext ctx = this;
- Hashtable env = p_getEnvironment();
+ Hashtable<?,?> env = p_getEnvironment();
Continuation cont = new Continuation(name, env);
Name nm = name;
@@ -257,7 +259,7 @@
public DirContext createSubcontext(Name name, Attributes attrs)
throws NamingException {
PartialCompositeDirContext ctx = this;
- Hashtable env = p_getEnvironment();
+ Hashtable<?,?> env = p_getEnvironment();
Continuation cont = new Continuation(name, env);
DirContext answer;
Name nm = name;
@@ -308,9 +310,9 @@
{
PartialCompositeDirContext ctx = this;
- Hashtable env = p_getEnvironment();
+ Hashtable<?,?> env = p_getEnvironment();
Continuation cont = new Continuation(name, env);
- NamingEnumeration answer;
+ NamingEnumeration<SearchResult> answer;
Name nm = name;
try {
@@ -347,9 +349,9 @@
{
PartialCompositeDirContext ctx = this;
- Hashtable env = p_getEnvironment();
+ Hashtable<?,?> env = p_getEnvironment();
Continuation cont = new Continuation(name, env);
- NamingEnumeration answer;
+ NamingEnumeration<SearchResult> answer;
Name nm = name;
try {
@@ -385,9 +387,9 @@
{
PartialCompositeDirContext ctx = this;
- Hashtable env = p_getEnvironment();
+ Hashtable<?,?> env = p_getEnvironment();
Continuation cont = new Continuation(name, env);
- NamingEnumeration answer;
+ NamingEnumeration<SearchResult> answer;
Name nm = name;
try {
@@ -411,7 +413,7 @@
public DirContext getSchema(Name name) throws NamingException {
PartialCompositeDirContext ctx = this;
- Hashtable env = p_getEnvironment();
+ Hashtable<?,?> env = p_getEnvironment();
Continuation cont = new Continuation(name, env);
DirContext answer;
Name nm = name;
@@ -438,7 +440,7 @@
public DirContext getSchemaClassDefinition(Name name)
throws NamingException {
PartialCompositeDirContext ctx = this;
- Hashtable env = p_getEnvironment();
+ Hashtable<?,?> env = p_getEnvironment();
Continuation cont = new Continuation(name, env);
DirContext answer;
Name nm = name;
@@ -509,14 +511,14 @@
throw cont.fillInException(e);
}
- protected NamingEnumeration a_list(
+ protected NamingEnumeration<NameClassPair> a_list(
Continuation cont) throws NamingException {
OperationNotSupportedException e = new
OperationNotSupportedException();
throw cont.fillInException(e);
}
- protected NamingEnumeration a_listBindings(
+ protected NamingEnumeration<Binding> a_listBindings(
Continuation cont) throws NamingException {
OperationNotSupportedException e = new
OperationNotSupportedException();
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/ContainmentFilter.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/ContainmentFilter.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -56,19 +56,19 @@
if (subset == null)
return true; // an empty set is always a subset
- NamingEnumeration m = subset.getAll();
+ NamingEnumeration<? extends Attribute> m = subset.getAll();
while (m.hasMore()) {
if (superset == null) {
return false; // contains nothing
}
- Attribute target = (Attribute) m.next();
+ Attribute target = m.next();
Attribute fromSuper = superset.get(target.getID());
if (fromSuper == null) {
return false;
} else {
// check whether attribute values match
if (target.size() > 0) {
- NamingEnumeration vals = target.getAll();
+ NamingEnumeration<?> vals = target.getAll();
while (vals.hasMore()) {
if (!fromSuper.contains(vals.next())) {
return false;
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -33,10 +33,10 @@
*
* @author Jon Ruiz
*/
-public class ContextEnumerator implements NamingEnumeration {
+public class ContextEnumerator implements NamingEnumeration<Binding> {
private static boolean debug = false;
- private NamingEnumeration children = null;
+ private NamingEnumeration<Binding> children = null;
private Binding currentChild = null;
private boolean currentReturned = false;
private Context root;
@@ -77,7 +77,7 @@
}
// Subclass should override if it wants to avoid calling obj factory
- protected NamingEnumeration getImmediateChildren(Context ctx)
+ protected NamingEnumeration<Binding> getImmediateChildren(Context ctx)
throws NamingException {
return ctx.listBindings("");
}
@@ -101,7 +101,7 @@
}
}
- public Object nextElement() {
+ public Binding nextElement() {
try {
return next();
} catch (NamingException e) {
@@ -109,7 +109,7 @@
}
}
- public Object next() throws NamingException {
+ public Binding next() throws NamingException {
if (!rootProcessed) {
rootProcessed = true;
return new Binding("", root.getClass().getName(),
@@ -132,7 +132,7 @@
}
private Binding getNextChild() throws NamingException {
- Binding oldBinding = ((Binding)children.next());
+ Binding oldBinding = children.next();
Binding newBinding = null;
// if the name is relative, we need to add it to the name of this
@@ -192,7 +192,7 @@
if(debug) {System.out.println("getNextDescedant: expanded case");}
// if the current child is expanded, use it's enumerator
- return (Binding)currentChildEnum.next();
+ return currentChildEnum.next();
} else {
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/DirSearch.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/DirSearch.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -34,7 +34,7 @@
* @author Jon Ruiz
*/
public class DirSearch {
- public static NamingEnumeration search(DirContext ctx,
+ public static NamingEnumeration<SearchResult> search(DirContext ctx,
Attributes matchingAttributes,
String[] attributesToReturn) throws NamingException {
SearchControls cons = new SearchControls(
@@ -48,7 +48,7 @@
cons);
}
- public static NamingEnumeration search(DirContext ctx,
+ public static NamingEnumeration<SearchResult> search(DirContext ctx,
String filter, SearchControls cons) throws NamingException {
if (cons == null)
@@ -60,7 +60,7 @@
cons);
}
- public static NamingEnumeration search(DirContext ctx,
+ public static NamingEnumeration<SearchResult> search(DirContext ctx,
String filterExpr, Object[] filterArgs, SearchControls cons)
throws NamingException {
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/HierMemDirCtx.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/HierMemDirCtx.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -42,8 +42,8 @@
static private final boolean debug = false;
private static final NameParser defaultParser = new HierarchicalNameParser();
- protected Hashtable myEnv;
- protected Hashtable bindings;
+ protected Hashtable<String, Object> myEnv;
+ protected Hashtable<Name, Object> bindings;
protected Attributes attrs;
protected boolean ignoreCase = false;
protected NamingException readOnlyEx = null;
@@ -70,12 +70,12 @@
this(null, ignoreCase, false);
}
- public HierMemDirCtx(Hashtable environment, boolean ignoreCase) {
+ public HierMemDirCtx(Hashtable<String, Object> environment, boolean ignoreCase) {
this(environment, ignoreCase, false);
}
- protected HierMemDirCtx(Hashtable environment, boolean ignoreCase,
- boolean useFac) {
+ protected HierMemDirCtx(Hashtable<String, Object> environment,
+ boolean ignoreCase, boolean useFac) {
myEnv = environment;
this.ignoreCase = ignoreCase;
init();
@@ -84,7 +84,7 @@
private void init() {
attrs = new BasicAttributes(ignoreCase);
- bindings = new Hashtable(11, 0.75f);
+ bindings = new Hashtable<>(11, 0.75f);
}
public Object lookup(String name) throws NamingException {
@@ -326,30 +326,30 @@
bindings.put(newname, oldBinding);
}
- public NamingEnumeration list(String name) throws NamingException {
+ public NamingEnumeration<NameClassPair> list(String name) throws NamingException {
return list(myParser.parse(name));
}
- public NamingEnumeration list(Name name) throws NamingException {
+ public NamingEnumeration<NameClassPair> list(Name name) throws NamingException {
HierMemDirCtx ctx = (HierMemDirCtx) doLookup(name, false);
return ctx.doList();
}
- protected NamingEnumeration doList () throws NamingException {
+ protected NamingEnumeration<NameClassPair> doList () throws NamingException {
return new FlatNames(bindings.keys());
}
- public NamingEnumeration listBindings(String name) throws NamingException {
+ public NamingEnumeration<Binding> listBindings(String name) throws NamingException {
return listBindings(myParser.parse(name));
}
- public NamingEnumeration listBindings(Name name) throws NamingException {
+ public NamingEnumeration<Binding> listBindings(Name name) throws NamingException {
HierMemDirCtx ctx = (HierMemDirCtx)doLookup(name, false);
return ctx.doListBindings(alwaysUseFactory);
}
- protected NamingEnumeration doListBindings(boolean useFactory)
+ protected NamingEnumeration<Binding> doListBindings(boolean useFactory)
throws NamingException {
return new FlatBindings(bindings, myEnv, useFactory);
}
@@ -447,28 +447,32 @@
return result;
}
+ @SuppressWarnings("unchecked") // clone()
public Object addToEnvironment(String propName, Object propVal)
throws NamingException {
- myEnv = (myEnv == null) ?
- new Hashtable(11, 0.75f) : (Hashtable)myEnv.clone();
+ myEnv = (myEnv == null)
+ ? new Hashtable<String, Object>(11, 0.75f)
+ : (Hashtable<String, Object>)myEnv.clone();
return myEnv.put(propName, propVal);
}
+ @SuppressWarnings("unchecked") // clone()
public Object removeFromEnvironment(String propName)
throws NamingException {
if (myEnv == null)
return null;
- myEnv = (Hashtable)myEnv.clone();
+ myEnv = (Hashtable<String, Object>)myEnv.clone();
return myEnv.remove(propName);
}
- public Hashtable getEnvironment() throws NamingException {
+ @SuppressWarnings("unchecked") // clone()
+ public Hashtable<String, Object> getEnvironment() throws NamingException {
if (myEnv == null) {
- return new Hashtable(5, 0.75f);
+ return new Hashtable<>(5, 0.75f);
} else {
- return (Hashtable)myEnv.clone();
+ return (Hashtable<String, Object>)myEnv.clone();
}
}
@@ -529,10 +533,10 @@
}
// turn it into a modification Enumeration and pass it on
- NamingEnumeration attrEnum = attrs.getAll();
+ NamingEnumeration<? extends Attribute> attrEnum = attrs.getAll();
ModificationItem[] mods = new ModificationItem[attrs.size()];
for (int i = 0; i < mods.length && attrEnum.hasMoreElements(); i++) {
- mods[i] = new ModificationItem(mod_op, (Attribute)attrEnum.next());
+ mods[i] = new ModificationItem(mod_op, attrEnum.next());
}
modifyAttributes(name, mods);
@@ -564,7 +568,7 @@
ModificationItem mod;
Attribute existingAttr, modAttr;
- NamingEnumeration modVals;
+ NamingEnumeration<?> modVals;
for (int i = 0; i < mods.length; i++) {
mod = mods[i];
@@ -619,29 +623,29 @@
return orig;
}
- public NamingEnumeration search(String name,
- Attributes matchingAttributes)
+ public NamingEnumeration<SearchResult> search(String name,
+ Attributes matchingAttributes)
throws NamingException {
return search(name, matchingAttributes, null);
}
- public NamingEnumeration search(Name name,
- Attributes matchingAttributes)
+ public NamingEnumeration<SearchResult> search(Name name,
+ Attributes matchingAttributes)
throws NamingException {
return search(name, matchingAttributes, null);
}
- public NamingEnumeration search(String name,
- Attributes matchingAttributes,
- String[] attributesToReturn)
+ public NamingEnumeration<SearchResult> search(String name,
+ Attributes matchingAttributes,
+ String[] attributesToReturn)
throws NamingException {
return search(myParser.parse(name), matchingAttributes,
attributesToReturn);
}
- public NamingEnumeration search(Name name,
- Attributes matchingAttributes,
- String[] attributesToReturn)
+ public NamingEnumeration<SearchResult> search(Name name,
+ Attributes matchingAttributes,
+ String[] attributesToReturn)
throws NamingException {
HierMemDirCtx target = (HierMemDirCtx) doLookup(name, false);
@@ -656,9 +660,9 @@
false); // alwaysUseFactory ignored because objReturnFlag == false
}
- public NamingEnumeration search(Name name,
- String filter,
- SearchControls cons)
+ public NamingEnumeration<SearchResult> search(Name name,
+ String filter,
+ SearchControls cons)
throws NamingException {
DirContext target = (DirContext) doLookup(name, false);
@@ -671,27 +675,27 @@
cons, this, myEnv, alwaysUseFactory);
}
- public NamingEnumeration search(Name name,
- String filterExpr,
- Object[] filterArgs,
- SearchControls cons)
+ public NamingEnumeration<SearchResult> search(Name name,
+ String filterExpr,
+ Object[] filterArgs,
+ SearchControls cons)
throws NamingException {
String strfilter = SearchFilter.format(filterExpr, filterArgs);
return search(name, strfilter, cons);
}
- public NamingEnumeration search(String name,
- String filter,
- SearchControls cons)
+ public NamingEnumeration<SearchResult> search(String name,
+ String filter,
+ SearchControls cons)
throws NamingException {
return search(myParser.parse(name), filter, cons);
}
- public NamingEnumeration search(String name,
- String filterExpr,
- Object[] filterArgs,
- SearchControls cons)
+ public NamingEnumeration<SearchResult> search(String name,
+ String filterExpr,
+ Object[] filterArgs,
+ SearchControls cons)
throws NamingException {
return search(myParser.parse(name), filterExpr, filterArgs, cons);
}
@@ -761,15 +765,17 @@
myParser = parser;
}
- // Class for enumerating name/class pairs
- private class FlatNames implements NamingEnumeration {
- Enumeration names;
+ /*
+ * Common base class for FlatNames and FlatBindings.
+ */
+ private abstract class BaseFlatNames<T> implements NamingEnumeration<T> {
+ Enumeration<Name> names;
- FlatNames (Enumeration names) {
+ BaseFlatNames (Enumeration<Name> names) {
this.names = names;
}
- public boolean hasMoreElements() {
+ public final boolean hasMoreElements() {
try {
return hasMore();
} catch (NamingException e) {
@@ -777,11 +783,11 @@
}
}
- public boolean hasMore() throws NamingException {
+ public final boolean hasMore() throws NamingException {
return names.hasMoreElements();
}
- public Object nextElement() {
+ public final T nextElement() {
try {
return next();
} catch (NamingException e) {
@@ -789,32 +795,45 @@
}
}
- public Object next() throws NamingException {
- Name name = (Name)names.nextElement();
- String className = bindings.get(name).getClass().getName();
- return new NameClassPair(name.toString(), className);
- }
+ public abstract T next() throws NamingException;
- public void close() {
+ public final void close() {
names = null;
}
}
- // Class for enumerating bindings
- private final class FlatBindings extends FlatNames {
- private Hashtable bds;
- private Hashtable env;
+ // Class for enumerating name/class pairs
+ private final class FlatNames extends BaseFlatNames<NameClassPair> {
+ FlatNames (Enumeration<Name> names) {
+ super(names);
+ }
+
+ @Override
+ public NameClassPair next() throws NamingException {
+ Name name = names.nextElement();
+ String className = bindings.get(name).getClass().getName();
+ return new NameClassPair(name.toString(), className);
+ }
+ }
+
+ // Class for enumerating bindings
+ private final class FlatBindings extends BaseFlatNames<Binding> {
+ private Hashtable<Name, Object> bds;
+ private Hashtable<String, Object> env;
private boolean useFactory;
- FlatBindings(Hashtable bindings, Hashtable env, boolean useFactory) {
+ FlatBindings(Hashtable<Name, Object> bindings,
+ Hashtable<String, Object> env,
+ boolean useFactory) {
super(bindings.keys());
this.env = env;
this.bds = bindings;
this.useFactory = useFactory;
}
- public Object next() throws NamingException {
- Name name = (Name)names.nextElement();
+ @Override
+ public Binding next() throws NamingException {
+ Name name = names.nextElement();
HierMemDirCtx obj = (HierMemDirCtx)bds.get(name);
@@ -849,7 +868,7 @@
super(context, scope, contextName, returnSelf);
}
- protected NamingEnumeration getImmediateChildren(Context ctx)
+ protected NamingEnumeration<Binding> getImmediateChildren(Context ctx)
throws NamingException {
return ((HierMemDirCtx)ctx).doListBindings(false);
}
@@ -872,14 +891,14 @@
// Creates an empty name
HierarchicalName() {
- super(new Enumeration() {
- public boolean hasMoreElements() {return false;}
- public Object nextElement() {throw new NoSuchElementException();}
- },
- HierarchicalNameParser.mySyntax);
+ super(new Enumeration<String>() {
+ public boolean hasMoreElements() {return false;}
+ public String nextElement() {throw new NoSuchElementException();}
+ },
+ HierarchicalNameParser.mySyntax);
}
- HierarchicalName(Enumeration comps, Properties syntax) {
+ HierarchicalName(Enumeration<String> comps, Properties syntax) {
super(comps, syntax);
}
@@ -891,7 +910,7 @@
public int hashCode() {
if (hashValue == -1) {
- String name = toString().toUpperCase();
+ String name = toString().toUpperCase(Locale.ENGLISH);
int len = name.length();
int off = 0;
char val[] = new char[len];
@@ -907,12 +926,12 @@
}
public Name getPrefix(int posn) {
- Enumeration comps = super.getPrefix(posn).getAll();
+ Enumeration<String> comps = super.getPrefix(posn).getAll();
return (new HierarchicalName(comps, mySyntax));
}
public Name getSuffix(int posn) {
- Enumeration comps = super.getSuffix(posn).getAll();
+ Enumeration<String> comps = super.getSuffix(posn).getAll();
return (new HierarchicalName(comps, mySyntax));
}
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/LazySearchEnumerationImpl.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/LazySearchEnumerationImpl.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -47,16 +47,17 @@
import java.util.NoSuchElementException;
import java.util.Hashtable;
-final public class LazySearchEnumerationImpl implements NamingEnumeration {
- private NamingEnumeration candidates;
+final public class LazySearchEnumerationImpl
+ implements NamingEnumeration<SearchResult> {
+ private NamingEnumeration<Binding> candidates;
private SearchResult nextMatch = null;
private SearchControls cons;
private AttrFilter filter;
private Context context;
- private Hashtable env;
+ private Hashtable<String, Object> env;
private boolean useFactory = true;
- public LazySearchEnumerationImpl(NamingEnumeration candidates,
+ public LazySearchEnumerationImpl(NamingEnumeration<Binding> candidates,
AttrFilter filter, SearchControls cons) throws NamingException {
this.candidates = candidates;
this.filter = filter;
@@ -68,9 +69,10 @@
}
}
- public LazySearchEnumerationImpl(NamingEnumeration candidates,
+ public LazySearchEnumerationImpl(NamingEnumeration<Binding> candidates,
AttrFilter filter, SearchControls cons,
- Context ctx, Hashtable env, boolean useFactory) throws NamingException {
+ Context ctx, Hashtable<String, Object> env, boolean useFactory)
+ throws NamingException {
this.candidates = candidates;
this.filter = filter;
@@ -86,9 +88,9 @@
}
- public LazySearchEnumerationImpl(NamingEnumeration candidates,
+ public LazySearchEnumerationImpl(NamingEnumeration<Binding> candidates,
AttrFilter filter, SearchControls cons,
- Context ctx, Hashtable env) throws NamingException {
+ Context ctx, Hashtable<String, Object> env) throws NamingException {
this(candidates, filter, cons, ctx, env, true);
}
@@ -105,7 +107,7 @@
}
}
- public Object nextElement() {
+ public SearchResult nextElement() {
try {
return findNextMatch(true);
} catch (NamingException e) {
@@ -113,7 +115,7 @@
}
}
- public Object next() throws NamingException {
+ public SearchResult next() throws NamingException {
// find and remove from list
return (findNextMatch(true));
}
@@ -138,7 +140,7 @@
Object obj;
Attributes targetAttrs;
while (candidates.hasMore()) {
- next = (Binding)candidates.next();
+ next = candidates.next();
obj = next.getObject();
if (obj instanceof DirContext) {
targetAttrs = ((DirContext)(obj)).getAttributes("");
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/SearchFilter.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/SearchFilter.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -29,6 +29,7 @@
import java.util.Enumeration;
import java.util.StringTokenizer;
import java.util.Vector;
+import java.util.Locale;
/**
* A class for parsing LDAP search filters (defined in RFC 1960, 2254)
@@ -203,11 +204,11 @@
* A class for dealing with compound filters ("and" & "or" filters).
*/
final class CompoundFilter implements StringFilter {
- private Vector subFilters;
+ private Vector<StringFilter> subFilters;
private boolean polarity;
CompoundFilter(boolean polarity) {
- subFilters = new Vector();
+ subFilters = new Vector<>();
this.polarity = polarity;
}
@@ -223,7 +224,7 @@
public boolean check(Attributes targetAttrs) throws NamingException {
for(int i = 0; i<subFilters.size(); i++) {
- StringFilter filter = (StringFilter)subFilters.elementAt(i);
+ StringFilter filter = subFilters.elementAt(i);
if(filter.check(targetAttrs) != this.polarity) {
return !polarity;
}
@@ -330,7 +331,7 @@
}
public boolean check(Attributes targetAttrs) {
- Enumeration candidates;
+ Enumeration<?> candidates;
try {
Attribute attr = targetAttrs.get(attrID);
@@ -395,19 +396,21 @@
// do we need to begin with the first token?
if(proto.charAt(0) != WILDCARD_TOKEN &&
- !value.toString().toLowerCase().startsWith(
- subStrs.nextToken().toLowerCase())) {
- if(debug) {System.out.println("faild initial test");}
+ !value.toString().toLowerCase(Locale.ENGLISH).startsWith(
+ subStrs.nextToken().toLowerCase(Locale.ENGLISH))) {
+ if(debug) {
+ System.out.println("faild initial test");
+ }
return false;
}
-
while(subStrs.hasMoreTokens()) {
String currentStr = subStrs.nextToken();
if (debug) {System.out.println("looking for \"" +
currentStr +"\"");}
- currentPos = value.toLowerCase().indexOf(
- currentStr.toLowerCase(), currentPos);
+ currentPos = value.toLowerCase(Locale.ENGLISH).indexOf(
+ currentStr.toLowerCase(Locale.ENGLISH), currentPos);
+
if(currentPos == -1) {
return false;
}
@@ -441,15 +444,15 @@
String answer;
answer = "(& ";
Attribute attr;
- for (NamingEnumeration e = attrs.getAll(); e.hasMore(); ) {
- attr = (Attribute)e.next();
+ for (NamingEnumeration<? extends Attribute> e = attrs.getAll();
+ e.hasMore(); ) {
+ attr = e.next();
if (attr.size() == 0 || (attr.size() == 1 && attr.get() == null)) {
// only checking presence of attribute
answer += "(" + attr.getID() + "=" + "*)";
} else {
- for (NamingEnumeration ve = attr.getAll();
- ve.hasMore();
- ) {
+ for (NamingEnumeration<?> ve = attr.getAll();
+ ve.hasMore(); ) {
String val = getEncodedStringRep(ve.next());
if (val != null) {
answer += "(" + attr.getID() + "=" + val + ")";
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/url/GenericURLContext.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/url/GenericURLContext.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -48,11 +48,12 @@
* @author Rosanna Lee
*/
abstract public class GenericURLContext implements Context {
- protected Hashtable myEnv = null;
+ protected Hashtable<String, Object> myEnv = null;
- public GenericURLContext(Hashtable env) {
+ @SuppressWarnings("unchecked") // Expect Hashtable<String, Object>
+ public GenericURLContext(Hashtable<?,?> env) {
// context that is not tied to any specific URL
- myEnv = env; // copied on write
+ myEnv = (Hashtable<String, Object>)env; // copied on write
}
public void close() throws NamingException {
@@ -75,7 +76,7 @@
* must be in sync wrt how URLs are parsed and returned.
*/
abstract protected ResolveResult getRootURLContext(String url,
- Hashtable env) throws NamingException;
+ Hashtable<?,?> env) throws NamingException;
/**
* Returns the suffix of the url. The result should be identical to
@@ -487,27 +488,31 @@
return result;
}
+ @SuppressWarnings("unchecked") // clone()
public Object removeFromEnvironment(String propName)
throws NamingException {
if (myEnv == null) {
return null;
}
- myEnv = (Hashtable)myEnv.clone();
+ myEnv = (Hashtable<String, Object>)myEnv.clone();
return myEnv.remove(propName);
}
+ @SuppressWarnings("unchecked") // clone()
public Object addToEnvironment(String propName, Object propVal)
throws NamingException {
- myEnv = (myEnv == null) ?
- new Hashtable(11, 0.75f) : (Hashtable)myEnv.clone();
+ myEnv = (myEnv == null)
+ ? new Hashtable<String, Object>(11, 0.75f)
+ : (Hashtable<String, Object>)myEnv.clone();
return myEnv.put(propName, propVal);
}
- public Hashtable getEnvironment() throws NamingException {
+ @SuppressWarnings("unchecked") // clone()
+ public Hashtable<String, Object> getEnvironment() throws NamingException {
if (myEnv == null) {
- return new Hashtable(5, 0.75f);
+ return new Hashtable<>(5, 0.75f);
} else {
- return (Hashtable)myEnv.clone();
+ return (Hashtable<String, Object>)myEnv.clone();
}
}
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/url/GenericURLDirContext.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/url/GenericURLDirContext.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -50,7 +50,7 @@
abstract public class GenericURLDirContext extends GenericURLContext
implements DirContext {
- protected GenericURLDirContext(Hashtable env) {
+ protected GenericURLDirContext(Hashtable<?,?> env) {
super(env);
}
--- a/jdk/src/share/classes/com/sun/jndi/url/dns/dnsURLContext.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/url/dns/dnsURLContext.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -45,7 +45,7 @@
public class dnsURLContext extends GenericURLDirContext {
- public dnsURLContext(Hashtable env) {
+ public dnsURLContext(Hashtable<?,?> env) {
super(env);
}
@@ -54,7 +54,7 @@
* to the named DNS server, and returns the domain name as the
* remaining name.
*/
- protected ResolveResult getRootURLContext(String url, Hashtable env)
+ protected ResolveResult getRootURLContext(String url, Hashtable<?,?> env)
throws NamingException {
DnsUrl dnsUrl;
--- a/jdk/src/share/classes/com/sun/jndi/url/dns/dnsURLContextFactory.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/url/dns/dnsURLContextFactory.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -62,7 +62,7 @@
}
}
- private static Object getUsingURL(String url, Hashtable env)
+ private static Object getUsingURL(String url, Hashtable<?,?> env)
throws NamingException {
dnsURLContext urlCtx = new dnsURLContext(env);
@@ -78,7 +78,7 @@
* If all URLs fail, throw one of the exceptions arbitrarily.
* Not pretty, but potentially more informative than returning null.
*/
- private static Object getUsingURLs(String[] urls, Hashtable env)
+ private static Object getUsingURLs(String[] urls, Hashtable<?,?> env)
throws NamingException {
if (urls.length == 0) {
--- a/jdk/src/share/classes/com/sun/jndi/url/iiop/iiopURLContext.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/url/iiop/iiopURLContext.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -42,7 +42,7 @@
public class iiopURLContext
extends com.sun.jndi.toolkit.url.GenericURLContext {
- iiopURLContext(Hashtable env) {
+ iiopURLContext(Hashtable<?,?> env) {
super(env);
}
@@ -56,7 +56,7 @@
* context on for the ORB at 'localhost' on port 900,
* and returns as the remaining name "rest/of/name".
*/
- protected ResolveResult getRootURLContext(String name, Hashtable env)
+ protected ResolveResult getRootURLContext(String name, Hashtable<?,?> env)
throws NamingException {
return iiopURLContextFactory.getUsingURLIgnoreRest(name, env);
}
--- a/jdk/src/share/classes/com/sun/jndi/url/iiop/iiopURLContextFactory.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/url/iiop/iiopURLContextFactory.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -68,12 +68,12 @@
* context on for the ORB at 'localhost' on port 900,
* and returns as the remaining name "rest/of/name".
*/
- static ResolveResult getUsingURLIgnoreRest(String url, Hashtable env)
+ static ResolveResult getUsingURLIgnoreRest(String url, Hashtable<?,?> env)
throws NamingException {
return CNCtx.createUsingURL(url, env);
}
- private static Object getUsingURL(String url, Hashtable env)
+ private static Object getUsingURL(String url, Hashtable<?,?> env)
throws NamingException {
ResolveResult res = getUsingURLIgnoreRest(url, env);
@@ -85,7 +85,7 @@
}
}
- private static Object getUsingURLs(String[] urls, Hashtable env) {
+ private static Object getUsingURLs(String[] urls, Hashtable<?,?> env) {
for (int i = 0; i < urls.length; i++) {
String url = urls[i];
try {
--- a/jdk/src/share/classes/com/sun/jndi/url/ldap/ldapURLContext.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/url/ldap/ldapURLContext.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -42,7 +42,7 @@
final public class ldapURLContext
extends com.sun.jndi.toolkit.url.GenericURLDirContext {
- ldapURLContext(Hashtable env) {
+ ldapURLContext(Hashtable<?,?> env) {
super(env);
}
@@ -56,7 +56,7 @@
* context on the server 'localhost' on port 389,
* and returns as the remaining name "o=widget, c=us".
*/
- protected ResolveResult getRootURLContext(String name, Hashtable env)
+ protected ResolveResult getRootURLContext(String name, Hashtable<?,?> env)
throws NamingException {
return ldapURLContextFactory.getUsingURLIgnoreRootDN(name, env);
}
@@ -171,7 +171,8 @@
}
}
- public NamingEnumeration list(String name) throws NamingException {
+ public NamingEnumeration<NameClassPair> list(String name)
+ throws NamingException {
if (LdapURL.hasQueryComponents(name)) {
throw new InvalidNameException(name);
} else {
@@ -179,7 +180,8 @@
}
}
- public NamingEnumeration list(Name name) throws NamingException {
+ public NamingEnumeration<NameClassPair> list(Name name)
+ throws NamingException {
if (LdapURL.hasQueryComponents(name.get(0))) {
throw new InvalidNameException(name.toString());
} else {
@@ -187,7 +189,8 @@
}
}
- public NamingEnumeration listBindings(String name) throws NamingException {
+ public NamingEnumeration<Binding> listBindings(String name)
+ throws NamingException {
if (LdapURL.hasQueryComponents(name)) {
throw new InvalidNameException(name);
} else {
@@ -195,7 +198,8 @@
}
}
- public NamingEnumeration listBindings(Name name) throws NamingException {
+ public NamingEnumeration<Binding> listBindings(Name name)
+ throws NamingException {
if (LdapURL.hasQueryComponents(name.get(0))) {
throw new InvalidNameException(name.toString());
} else {
@@ -447,7 +451,7 @@
}
// divert the search operation when the LDAP URL has query components
- public NamingEnumeration search(String name,
+ public NamingEnumeration<SearchResult> search(String name,
Attributes matchingAttributes)
throws NamingException {
@@ -459,7 +463,7 @@
}
// divert the search operation when name has a single component
- public NamingEnumeration search(Name name,
+ public NamingEnumeration<SearchResult> search(Name name,
Attributes matchingAttributes)
throws NamingException {
if (name.size() == 1) {
@@ -472,7 +476,7 @@
}
// divert the search operation when the LDAP URL has query components
- public NamingEnumeration search(String name,
+ public NamingEnumeration<SearchResult> search(String name,
Attributes matchingAttributes,
String[] attributesToReturn)
throws NamingException {
@@ -485,7 +489,7 @@
}
// divert the search operation when name has a single component
- public NamingEnumeration search(Name name,
+ public NamingEnumeration<SearchResult> search(Name name,
Attributes matchingAttributes,
String[] attributesToReturn)
throws NamingException {
@@ -500,7 +504,7 @@
}
// divert the search operation when the LDAP URL has query components
- public NamingEnumeration search(String name,
+ public NamingEnumeration<SearchResult> search(String name,
String filter,
SearchControls cons)
throws NamingException {
@@ -513,7 +517,7 @@
}
// divert the search operation when name has a single component
- public NamingEnumeration search(Name name,
+ public NamingEnumeration<SearchResult> search(Name name,
String filter,
SearchControls cons)
throws NamingException {
@@ -528,7 +532,7 @@
}
// divert the search operation when the LDAP URL has query components
- public NamingEnumeration search(String name,
+ public NamingEnumeration<SearchResult> search(String name,
String filterExpr,
Object[] filterArgs,
SearchControls cons)
@@ -542,7 +546,7 @@
}
// divert the search operation when name has a single component
- public NamingEnumeration search(Name name,
+ public NamingEnumeration<SearchResult> search(Name name,
String filterExpr,
Object[] filterArgs,
SearchControls cons)
@@ -559,7 +563,7 @@
// Search using the LDAP URL in name.
// LDAP URL query components override the search argments.
- private NamingEnumeration searchUsingURL(String name)
+ private NamingEnumeration<SearchResult> searchUsingURL(String name)
throws NamingException {
LdapURL url = new LdapURL(name);
--- a/jdk/src/share/classes/com/sun/jndi/url/ldap/ldapURLContextFactory.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/url/ldap/ldapURLContextFactory.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -53,7 +53,7 @@
}
}
- static ResolveResult getUsingURLIgnoreRootDN(String url, Hashtable env)
+ static ResolveResult getUsingURLIgnoreRootDN(String url, Hashtable<?,?> env)
throws NamingException {
LdapURL ldapUrl = new LdapURL(url);
DirContext ctx = new LdapCtx("", ldapUrl.getHost(), ldapUrl.getPort(),
--- a/jdk/src/share/classes/com/sun/jndi/url/rmi/rmiURLContext.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/url/rmi/rmiURLContext.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -26,7 +26,6 @@
package com.sun.jndi.url.rmi;
import java.util.Hashtable;
-import java.rmi.registry.LocateRegistry;
import javax.naming.*;
import javax.naming.spi.ResolveResult;
@@ -48,7 +47,7 @@
*/
public class rmiURLContext extends GenericURLContext {
- public rmiURLContext(Hashtable env) {
+ public rmiURLContext(Hashtable<?,?> env) {
super(env);
}
@@ -57,7 +56,7 @@
* RMI registry, and returns the atomic object name as the
* remaining name.
*/
- protected ResolveResult getRootURLContext(String url, Hashtable env)
+ protected ResolveResult getRootURLContext(String url, Hashtable<?,?> env)
throws NamingException
{
if (!url.startsWith("rmi:")) {
--- a/jdk/src/share/classes/com/sun/jndi/url/rmi/rmiURLContextFactory.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/url/rmi/rmiURLContextFactory.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -63,7 +63,7 @@
}
}
- private static Object getUsingURL(String url, Hashtable env)
+ private static Object getUsingURL(String url, Hashtable<?,?> env)
throws NamingException
{
rmiURLContext urlCtx = new rmiURLContext(env);
@@ -79,7 +79,7 @@
* If all URLs fail, throw one of the exceptions arbitrarily.
* Not pretty, but potentially more informative than returning null.
*/
- private static Object getUsingURLs(String[] urls, Hashtable env)
+ private static Object getUsingURLs(String[] urls, Hashtable<?,?> env)
throws NamingException
{
if (urls.length == 0) {
--- a/jdk/src/share/classes/com/sun/naming/internal/FactoryEnumeration.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/naming/internal/FactoryEnumeration.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -37,7 +37,8 @@
// no need to implement Enumeration since this is only for internal use
public final class FactoryEnumeration {
- private List factories;
+ // List<NamedWeakReference<Class | Object>>
+ private List<NamedWeakReference<Object>> factories;
private int posn = 0;
private ClassLoader loader;
@@ -59,7 +60,8 @@
* @param factories A non-null list
* @param loader The class loader of the list's contents
*/
- FactoryEnumeration(List factories, ClassLoader loader) {
+ FactoryEnumeration(List<NamedWeakReference<Object>> factories,
+ ClassLoader loader) {
this.factories = factories;
this.loader = loader;
}
@@ -67,7 +69,7 @@
public Object next() throws NamingException {
synchronized (factories) {
- NamedWeakReference ref = (NamedWeakReference) factories.get(posn++);
+ NamedWeakReference<Object> ref = factories.get(posn++);
Object answer = ref.get();
if ((answer != null) && !(answer instanceof Class)) {
return answer;
@@ -81,7 +83,7 @@
}
// Instantiate Class to get factory
answer = ((Class) answer).newInstance();
- ref = new NamedWeakReference(answer, className);
+ ref = new NamedWeakReference<>(answer, className);
factories.set(posn-1, ref); // replace Class object or null
return answer;
} catch (ClassNotFoundException e) {
--- a/jdk/src/share/classes/com/sun/naming/internal/NamedWeakReference.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/naming/internal/NamedWeakReference.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -33,11 +33,11 @@
*/
-class NamedWeakReference extends java.lang.ref.WeakReference {
+class NamedWeakReference<T> extends java.lang.ref.WeakReference<T> {
private final String name;
- NamedWeakReference(Object referent, String name) {
+ NamedWeakReference(T referent, String name) {
super(referent);
this.name = name;
}
--- a/jdk/src/share/classes/com/sun/naming/internal/ResourceManager.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/naming/internal/ResourceManager.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -27,11 +27,9 @@
import java.io.InputStream;
import java.io.IOException;
-import java.net.URL;
import java.lang.ref.WeakReference;
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
-import java.util.Enumeration;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Map;
@@ -89,7 +87,9 @@
* One from application resource files is keyed on the thread's
* context class loader.
*/
- private static final WeakHashMap propertiesCache = new WeakHashMap(11);
+ // WeakHashMap<Class | ClassLoader, Hashtable>
+ private static final WeakHashMap<Object, Hashtable<? super String, Object>>
+ propertiesCache = new WeakHashMap<>(11);
/*
* A cache of factory objects (ObjectFactory, StateFactory, ControlFactory).
@@ -99,7 +99,9 @@
* weakly referenced so as not to prevent GC of the class loader.
* Used in getFactories().
*/
- private static final WeakHashMap factoryCache = new WeakHashMap(11);
+ private static final
+ WeakHashMap<ClassLoader, Map<String, List<NamedWeakReference<Object>>>>
+ factoryCache = new WeakHashMap<>(11);
/*
* A cache of URL factory objects (ObjectFactory).
@@ -110,8 +112,11 @@
* NO_FACTORY if a previous search revealed no factory. Used in
* getFactory().
*/
- private static final WeakHashMap urlFactoryCache = new WeakHashMap(11);
- private static final WeakReference NO_FACTORY = new WeakReference(null);
+ private static final
+ WeakHashMap<ClassLoader, Map<String, WeakReference<Object>>>
+ urlFactoryCache = new WeakHashMap<>(11);
+ private static final WeakReference<Object> NO_FACTORY =
+ new WeakReference<>(null);
/**
* A class to allow JNDI properties be specified as applet parameters
@@ -152,10 +157,9 @@
throw new ClassCastException(applet.getClass().getName());
try {
return getMethod.invoke(applet, name);
- } catch (InvocationTargetException e) {
+ } catch (InvocationTargetException |
+ IllegalAccessException e) {
throw new AssertionError(e);
- } catch (IllegalAccessException iae) {
- throw new AssertionError(iae);
}
}
}
@@ -183,12 +187,14 @@
* @throws NamingException if an error occurs while reading a
* resource file
*/
- public static Hashtable getInitialEnvironment(Hashtable env)
+ @SuppressWarnings("unchecked")
+ public static Hashtable<?, ?> getInitialEnvironment(
+ Hashtable<?, ?> env)
throws NamingException
{
String[] props = VersionHelper.PROPS; // system/applet properties
if (env == null) {
- env = new Hashtable(11);
+ env = new Hashtable<>(11);
}
Object applet = env.get(Context.APPLET);
@@ -213,14 +219,14 @@
: helper.getJndiProperty(i);
}
if (val != null) {
- env.put(props[i], val);
+ ((Hashtable<String, Object>)env).put(props[i], val);
}
}
}
// Merge the above with the values read from all application
// resource files. Colon-separated lists are concatenated.
- mergeTables(env, getApplicationResources());
+ mergeTables((Hashtable<Object, Object>)env, getApplicationResources());
return env;
}
@@ -244,7 +250,7 @@
* @throws NamingException if an error occurs while reading the provider
* resource file.
*/
- public static String getProperty(String propName, Hashtable env,
+ public static String getProperty(String propName, Hashtable<?,?> env,
Context ctx, boolean concat)
throws NamingException {
@@ -305,8 +311,8 @@
* @see javax.naming.spi.DirectoryManager#getStateToBind
* @see javax.naming.ldap.ControlFactory#getControlInstance
*/
- public static FactoryEnumeration getFactories(String propName, Hashtable env,
- Context ctx) throws NamingException {
+ public static FactoryEnumeration getFactories(String propName,
+ Hashtable<?,?> env, Context ctx) throws NamingException {
String facProp = getProperty(propName, env, ctx, true);
if (facProp == null)
@@ -315,17 +321,18 @@
// Cache is based on context class loader and property val
ClassLoader loader = helper.getContextClassLoader();
- Map perLoaderCache = null;
+ Map<String, List<NamedWeakReference<Object>>> perLoaderCache = null;
synchronized (factoryCache) {
- perLoaderCache = (Map) factoryCache.get(loader);
+ perLoaderCache = factoryCache.get(loader);
if (perLoaderCache == null) {
- perLoaderCache = new HashMap(11);
+ perLoaderCache = new HashMap<>(11);
factoryCache.put(loader, perLoaderCache);
}
}
synchronized (perLoaderCache) {
- List factories = (List) perLoaderCache.get(facProp);
+ List<NamedWeakReference<Object>> factories =
+ perLoaderCache.get(facProp);
if (factories != null) {
// Cached list
return factories.size() == 0 ? null
@@ -334,13 +341,13 @@
// Populate list with classes named in facProp; skipping
// those that we cannot load
StringTokenizer parser = new StringTokenizer(facProp, ":");
- factories = new ArrayList(5);
+ factories = new ArrayList<>(5);
while (parser.hasMoreTokens()) {
try {
// System.out.println("loading");
String className = parser.nextToken();
- Class c = helper.loadClass(className, loader);
- factories.add(new NamedWeakReference(c, className));
+ Class<?> c = helper.loadClass(className, loader);
+ factories.add(new NamedWeakReference<Object>(c, className));
} catch (Exception e) {
// ignore ClassNotFoundException, IllegalArgumentException
}
@@ -388,8 +395,9 @@
* @see javax.naming.spi.NamingManager#getURLContext
* @see javax.naming.spi.NamingManager#getURLObject
*/
- public static Object getFactory(String propName, Hashtable env, Context ctx,
- String classSuffix, String defaultPkgPrefix) throws NamingException {
+ public static Object getFactory(String propName, Hashtable<?,?> env,
+ Context ctx, String classSuffix, String defaultPkgPrefix)
+ throws NamingException {
// Merge property with provider property and supplied default
String facProp = getProperty(propName, env, ctx, true);
@@ -403,11 +411,11 @@
ClassLoader loader = helper.getContextClassLoader();
String key = classSuffix + " " + facProp;
- Map perLoaderCache = null;
+ Map<String, WeakReference<Object>> perLoaderCache = null;
synchronized (urlFactoryCache) {
- perLoaderCache = (Map) urlFactoryCache.get(loader);
+ perLoaderCache = urlFactoryCache.get(loader);
if (perLoaderCache == null) {
- perLoaderCache = new HashMap(11);
+ perLoaderCache = new HashMap<>(11);
urlFactoryCache.put(loader, perLoaderCache);
}
}
@@ -415,7 +423,7 @@
synchronized (perLoaderCache) {
Object factory = null;
- WeakReference factoryRef = (WeakReference) perLoaderCache.get(key);
+ WeakReference<Object> factoryRef = perLoaderCache.get(key);
if (factoryRef == NO_FACTORY) {
return null;
} else if (factoryRef != null) {
@@ -451,7 +459,7 @@
// Cache it.
perLoaderCache.put(key, (factory != null)
- ? new WeakReference(factory)
+ ? new WeakReference<>(factory)
: NO_FACTORY);
return factory;
}
@@ -468,16 +476,18 @@
*
* @throws NamingException if an error occurs while reading the file.
*/
- private static Hashtable getProviderResource(Object obj)
+ private static Hashtable<? super String, Object>
+ getProviderResource(Object obj)
throws NamingException
{
if (obj == null) {
- return (new Hashtable(1));
+ return (new Hashtable<>(1));
}
synchronized (propertiesCache) {
- Class c = obj.getClass();
+ Class<?> c = obj.getClass();
- Hashtable props = (Hashtable)propertiesCache.get(c);
+ Hashtable<? super String, Object> props =
+ propertiesCache.get(c);
if (props != null) {
return props;
}
@@ -518,22 +528,23 @@
* @throws NamingException if an error occurs while reading a resource
* file.
*/
- private static Hashtable getApplicationResources() throws NamingException {
+ private static Hashtable<? super String, Object> getApplicationResources()
+ throws NamingException {
ClassLoader cl = helper.getContextClassLoader();
synchronized (propertiesCache) {
- Hashtable result = (Hashtable)propertiesCache.get(cl);
+ Hashtable<? super String, Object> result = propertiesCache.get(cl);
if (result != null) {
return result;
}
try {
- NamingEnumeration resources =
+ NamingEnumeration<InputStream> resources =
helper.getResources(cl, APP_RESOURCE_FILE_NAME);
while (resources.hasMore()) {
Properties props = new Properties();
- props.load((InputStream)resources.next());
+ props.load(resources.next());
if (result == null) {
result = props;
@@ -563,7 +574,7 @@
throw ne;
}
if (result == null) {
- result = new Hashtable(11);
+ result = new Hashtable<>(11);
}
propertiesCache.put(cl, result);
return result;
@@ -577,11 +588,10 @@
* standard JNDI properties that specify colon-separated lists,
* the values are concatenated and stored in props1.
*/
- private static void mergeTables(Hashtable props1, Hashtable props2) {
- Enumeration keys = props2.keys();
-
- while (keys.hasMoreElements()) {
- String prop = (String)keys.nextElement();
+ private static void mergeTables(Hashtable<? super String, Object> props1,
+ Hashtable<? super String, Object> props2) {
+ for (Object key : props2.keySet()) {
+ String prop = (String)key;
Object val1 = props1.get(prop);
if (val1 == null) {
props1.put(prop, props2.get(prop));
--- a/jdk/src/share/classes/com/sun/naming/internal/VersionHelper.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/naming/internal/VersionHelper.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -29,7 +29,6 @@
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
-import java.util.Enumeration;
import java.util.StringTokenizer;
import java.util.Vector;
@@ -78,13 +77,13 @@
return helper;
}
- public abstract Class loadClass(String className)
+ public abstract Class<?> loadClass(String className)
throws ClassNotFoundException;
- abstract Class loadClass(String className, ClassLoader cl)
+ abstract Class<?> loadClass(String className, ClassLoader cl)
throws ClassNotFoundException;
- public abstract Class loadClass(String className, String codebase)
+ public abstract Class<?> loadClass(String className, String codebase)
throws ClassNotFoundException, MalformedURLException;
/*
@@ -106,7 +105,7 @@
* Returns the resource of a given name associated with a particular
* class (never null), or null if none can be found.
*/
- abstract InputStream getResourceAsStream(Class c, String name);
+ abstract InputStream getResourceAsStream(Class<?> c, String name);
/*
* Returns an input stream for a file in <java.home>/lib,
@@ -122,7 +121,8 @@
* loader. Null represents the bootstrap class loader in some
* Java implementations.
*/
- abstract NamingEnumeration getResources(ClassLoader cl, String name)
+ abstract NamingEnumeration<InputStream> getResources(
+ ClassLoader cl, String name)
throws IOException;
/*
@@ -137,13 +137,13 @@
throws MalformedURLException {
// Parse codebase into separate URLs
StringTokenizer parser = new StringTokenizer(codebase);
- Vector vec = new Vector(10);
+ Vector<String> vec = new Vector<>(10);
while (parser.hasMoreTokens()) {
vec.addElement(parser.nextToken());
}
String[] url = new String[vec.size()];
for (int i = 0; i < url.length; i++) {
- url[i] = (String)vec.elementAt(i);
+ url[i] = vec.elementAt(i);
}
URL[] urlArray = new URL[url.length];
--- a/jdk/src/share/classes/com/sun/naming/internal/VersionHelper12.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/naming/internal/VersionHelper12.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -35,7 +35,6 @@
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.util.Enumeration;
-import java.util.Hashtable;
import java.util.NoSuchElementException;
import java.util.Properties;
@@ -58,7 +57,7 @@
VersionHelper12() {} // Disallow external from creating one of these.
- public Class loadClass(String className) throws ClassNotFoundException {
+ public Class<?> loadClass(String className) throws ClassNotFoundException {
ClassLoader cl = getContextClassLoader();
return Class.forName(className, true, cl);
}
@@ -66,7 +65,7 @@
/**
* Package private.
*/
- Class loadClass(String className, ClassLoader cl)
+ Class<?> loadClass(String className, ClassLoader cl)
throws ClassNotFoundException {
return Class.forName(className, true, cl);
}
@@ -75,7 +74,7 @@
* @param className A non-null fully qualified class name.
* @param codebase A non-null, space-separated list of URL strings.
*/
- public Class loadClass(String className, String codebase)
+ public Class<?> loadClass(String className, String codebase)
throws ClassNotFoundException, MalformedURLException {
ClassLoader cl;
@@ -86,9 +85,9 @@
}
String getJndiProperty(final int i) {
- return (String) AccessController.doPrivileged(
- new PrivilegedAction() {
- public Object run() {
+ return AccessController.doPrivileged(
+ new PrivilegedAction<String>() {
+ public String run() {
try {
return System.getProperty(PROPS[i]);
} catch (SecurityException e) {
@@ -103,9 +102,9 @@
if (getSystemPropsFailed) {
return null; // after one failure, don't bother trying again
}
- Properties sysProps = (Properties) AccessController.doPrivileged(
- new PrivilegedAction() {
- public Object run() {
+ Properties sysProps = AccessController.doPrivileged(
+ new PrivilegedAction<Properties>() {
+ public Properties run() {
try {
return System.getProperties();
} catch (SecurityException e) {
@@ -125,10 +124,10 @@
return jProps;
}
- InputStream getResourceAsStream(final Class c, final String name) {
- return (InputStream) AccessController.doPrivileged(
- new PrivilegedAction() {
- public Object run() {
+ InputStream getResourceAsStream(final Class<?> c, final String name) {
+ return AccessController.doPrivileged(
+ new PrivilegedAction<InputStream>() {
+ public InputStream run() {
return c.getResourceAsStream(name);
}
}
@@ -136,9 +135,9 @@
}
InputStream getJavaHomeLibStream(final String filename) {
- return (InputStream) AccessController.doPrivileged(
- new PrivilegedAction() {
- public Object run() {
+ return AccessController.doPrivileged(
+ new PrivilegedAction<InputStream>() {
+ public InputStream run() {
try {
String javahome = System.getProperty("java.home");
if (javahome == null) {
@@ -155,14 +154,13 @@
);
}
- NamingEnumeration getResources(final ClassLoader cl, final String name)
- throws IOException
- {
- Enumeration urls;
+ NamingEnumeration<InputStream> getResources(final ClassLoader cl,
+ final String name) throws IOException {
+ Enumeration<URL> urls;
try {
- urls = (Enumeration) AccessController.doPrivileged(
- new PrivilegedExceptionAction() {
- public Object run() throws IOException {
+ urls = AccessController.doPrivileged(
+ new PrivilegedExceptionAction<Enumeration<URL>>() {
+ public Enumeration<URL> run() throws IOException {
return (cl == null)
? ClassLoader.getSystemResources(name)
: cl.getResources(name);
@@ -176,9 +174,9 @@
}
ClassLoader getContextClassLoader() {
- return (ClassLoader) AccessController.doPrivileged(
- new PrivilegedAction() {
- public Object run() {
+ return AccessController.doPrivileged(
+ new PrivilegedAction<ClassLoader>() {
+ public ClassLoader run() {
return Thread.currentThread().getContextClassLoader();
}
}
@@ -193,13 +191,13 @@
* This is used to enumerate the resources under a foreign codebase.
* This class is not MT-safe.
*/
- class InputStreamEnumeration implements NamingEnumeration {
+ class InputStreamEnumeration implements NamingEnumeration<InputStream> {
- private final Enumeration urls;
+ private final Enumeration<URL> urls;
- private Object nextElement = null;
+ private InputStream nextElement = null;
- InputStreamEnumeration(Enumeration urls) {
+ InputStreamEnumeration(Enumeration<URL> urls) {
this.urls = urls;
}
@@ -207,13 +205,13 @@
* Returns the next InputStream, or null if there are no more.
* An InputStream that cannot be opened is skipped.
*/
- private Object getNextElement() {
+ private InputStream getNextElement() {
return AccessController.doPrivileged(
- new PrivilegedAction() {
- public Object run() {
+ new PrivilegedAction<InputStream>() {
+ public InputStream run() {
while (urls.hasMoreElements()) {
try {
- return ((URL)urls.nextElement()).openStream();
+ return urls.nextElement().openStream();
} catch (IOException e) {
// skip this URL
}
@@ -236,9 +234,9 @@
return hasMore();
}
- public Object next() {
+ public InputStream next() {
if (hasMore()) {
- Object res = nextElement;
+ InputStream res = nextElement;
nextElement = null;
return res;
} else {
@@ -246,7 +244,7 @@
}
}
- public Object nextElement() {
+ public InputStream nextElement() {
return next();
}
--- a/jdk/src/share/classes/com/sun/security/auth/PolicyFile.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/security/auth/PolicyFile.java Wed Jul 05 17:49:56 2017 +0200
@@ -26,13 +26,10 @@
package com.sun.security.auth;
import java.io.*;
-import java.lang.RuntimePermission;
import java.lang.reflect.*;
-import java.net.MalformedURLException;
import java.net.URL;
import java.util.*;
-import java.security.AccessController;
import java.security.CodeSource;
import java.security.KeyStore;
import java.security.KeyStoreException;
@@ -260,7 +257,7 @@
private static final String AUTH_POLICY_URL = "auth.policy.url.";
private Vector<PolicyEntry> policyEntries;
- private Hashtable aliasMapping;
+ private Hashtable<Object, Object> aliasMapping;
private boolean initialized = false;
@@ -293,7 +290,7 @@
return;
policyEntries = new Vector<PolicyEntry>();
- aliasMapping = new Hashtable(11);
+ aliasMapping = new Hashtable<Object, Object>(11);
initPolicyFile();
initialized = true;
@@ -403,7 +400,7 @@
}
try {
extra_policy = PropertyExpander.expand(extra_policy);
- URL policyURL;;
+ URL policyURL;
File policyFile = new File(extra_policy);
if (policyFile.exists()) {
policyURL =
@@ -702,8 +699,8 @@
InvocationTargetException
{
//XXX we might want to keep a hash of created factories...
- Class pc = Class.forName(type);
- Constructor c = pc.getConstructor(PARAMS);
+ Class<?> pc = Class.forName(type);
+ Constructor<?> c = pc.getConstructor(PARAMS);
return (Permission) c.newInstance(new Object[] { name, actions });
}
@@ -1088,16 +1085,20 @@
// because the earlier CodeSource.implies succeeded
SubjectCodeSource scs = (SubjectCodeSource)accCs;
- Set<Principal> principalSet = null;
+ Set<? extends Principal> principalSet = null;
try {
- Class pClass = Class.forName(principal.principalClass, false,
- ClassLoader.getSystemClassLoader());
+ // principal.principalClass should extend Principal
+ // If it doesn't, we should stop here with a ClassCastException.
+ @SuppressWarnings("unchecked")
+ Class<? extends Principal> pClass = (Class<? extends Principal>)
+ Class.forName(principal.principalClass, false,
+ ClassLoader.getSystemClassLoader());
principalSet = scs.getSubject().getPrincipals(pClass);
} catch (Exception e) {
if (debug != null) {
debug.println("problem finding Principal Class " +
- "when expanding SELF permission: " +
- e.toString());
+ "when expanding SELF permission: " +
+ e.toString());
}
}
@@ -1107,11 +1108,9 @@
}
String[][] info = new String[principalSet.size()][2];
- java.util.Iterator<Principal> pIterator = principalSet.iterator();
int i = 0;
- while (pIterator.hasNext()) {
- Principal p = pIterator.next();
+ for (Principal p : principalSet) {
info[i][0] = p.getClass().getName();
info[i][1] = p.getName();
i++;
--- a/jdk/src/share/classes/com/sun/security/auth/SubjectCodeSource.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/security/auth/SubjectCodeSource.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -205,10 +205,9 @@
// handle PrincipalComparators
- Class principalComparator = Class.forName(pppe.principalClass,
- true,
- sysClassLoader);
- Constructor c = principalComparator.getConstructor(PARAMS);
+ Class<?> principalComparator = Class.forName(
+ pppe.principalClass, true, sysClassLoader);
+ Constructor<?> c = principalComparator.getConstructor(PARAMS);
PrincipalComparator pc =
(PrincipalComparator)c.newInstance
(new Object[] { pppe.principalName });
--- a/jdk/src/share/classes/com/sun/security/auth/module/JndiLoginModule.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/security/auth/module/JndiLoginModule.java Wed Jul 05 17:49:56 2017 +0200
@@ -32,16 +32,13 @@
import javax.naming.*;
import javax.naming.directory.*;
-import java.io.IOException;
import java.util.Map;
import java.util.LinkedList;
-import java.util.ResourceBundle;
import com.sun.security.auth.UnixPrincipal;
import com.sun.security.auth.UnixNumericUserPrincipal;
import com.sun.security.auth.UnixNumericGroupPrincipal;
-import sun.security.util.AuthResources;
/**
* <p> The module prompts for a username and password
@@ -189,7 +186,7 @@
// initial state
private Subject subject;
private CallbackHandler callbackHandler;
- private Map sharedState;
+ private Map<String, Object> sharedState;
private Map<String, ?> options;
private static final String CRYPT = "{crypt}";
@@ -217,13 +214,18 @@
* <code>Configuration</code> for this particular
* <code>LoginModule</code>.
*/
+ // Unchecked warning from (Map<String, Object>)sharedState is safe
+ // since javax.security.auth.login.LoginContext passes a raw HashMap.
+ // Unchecked warnings from options.get(String) are safe since we are
+ // passing known keys.
+ @SuppressWarnings("unchecked")
public void initialize(Subject subject, CallbackHandler callbackHandler,
Map<String,?> sharedState,
Map<String,?> options) {
this.subject = subject;
this.callbackHandler = callbackHandler;
- this.sharedState = sharedState;
+ this.sharedState = (Map<String, Object>)sharedState;
this.options = options;
// initialize any configured options
--- a/jdk/src/share/classes/com/sun/security/auth/module/KeyStoreLoginModule.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/security/auth/module/KeyStoreLoginModule.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,11 +25,9 @@
package com.sun.security.auth.module;
-import javax.security.auth.x500.X500Principal;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
-import java.io.PushbackInputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.security.AuthProvider;
@@ -39,7 +37,6 @@
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
-import java.security.Principal;
import java.security.PrivateKey;
import java.security.Provider;
import java.security.UnrecoverableKeyException;
@@ -49,13 +46,10 @@
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Map;
-import java.util.ResourceBundle;
import javax.security.auth.Destroyable;
import javax.security.auth.DestroyFailedException;
import javax.security.auth.Subject;
import javax.security.auth.x500.*;
-import javax.security.auth.Subject;
-import javax.security.auth.x500.*;
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.ConfirmationCallback;
@@ -67,7 +61,6 @@
import javax.security.auth.login.LoginException;
import javax.security.auth.spi.LoginModule;
-import sun.security.util.AuthResources;
import sun.security.util.Password;
/**
@@ -159,7 +152,7 @@
private Subject subject;
private CallbackHandler callbackHandler;
- private Map sharedState;
+ private Map<String, Object> sharedState;
private Map<String, ?> options;
private char[] keyStorePassword;
@@ -202,7 +195,9 @@
* <code>Configuration</code> for this particular
* <code>LoginModule</code>.
*/
-
+ // Unchecked warning from (Map<String, Object>)sharedState is safe
+ // since javax.security.auth.login.LoginContext passes a raw HashMap.
+ @SuppressWarnings("unchecked")
public void initialize(Subject subject,
CallbackHandler callbackHandler,
Map<String,?> sharedState,
@@ -210,7 +205,7 @@
{
this.subject = subject;
this.callbackHandler = callbackHandler;
- this.sharedState = sharedState;
+ this.sharedState = (Map<String, Object>)sharedState;
this.options = options;
processOptions();
@@ -337,6 +332,7 @@
}
/** Get the alias and passwords to use for looking up in the KeyStore. */
+ @SuppressWarnings("fallthrough")
private void getAliasAndPasswords(int env) throws LoginException {
if (callbackHandler == null) {
--- a/jdk/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java Wed Jul 05 17:49:56 2017 +0200
@@ -367,7 +367,7 @@
// initial state
private Subject subject;
private CallbackHandler callbackHandler;
- private Map sharedState;
+ private Map<String, Object> sharedState;
private Map<String, ?> options;
// configurable option
@@ -432,7 +432,11 @@
* <code>Configuration</code> for this particular
* <code>LoginModule</code>.
*/
-
+ // Unchecked warning from (Map<String, Object>)sharedState is safe
+ // since javax.security.auth.login.LoginContext passes a raw HashMap.
+ // Unchecked warnings from options.get(String) are safe since we are
+ // passing known keys.
+ @SuppressWarnings("unchecked")
public void initialize(Subject subject,
CallbackHandler callbackHandler,
Map<String, ?> sharedState,
@@ -440,7 +444,7 @@
this.subject = subject;
this.callbackHandler = callbackHandler;
- this.sharedState = sharedState;
+ this.sharedState = (Map<String, Object>)sharedState;
this.options = options;
// initialize any configured options
--- a/jdk/src/share/classes/com/sun/security/auth/module/LdapLoginModule.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/security/auth/module/LdapLoginModule.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -25,14 +25,12 @@
package com.sun.security.auth.module;
-import java.io.IOException;
import java.security.AccessController;
import java.net.SocketPermission;
import java.security.Principal;
import java.security.PrivilegedAction;
import java.util.Arrays;
import java.util.Hashtable;
-import java.util.Iterator;
import java.util.Map;
import java.util.ResourceBundle;
import java.util.regex.Matcher;
@@ -50,7 +48,6 @@
import com.sun.security.auth.LdapPrincipal;
import com.sun.security.auth.UserPrincipal;
-import sun.security.util.AuthResources;
/**
* This {@link LoginModule} performs LDAP-based authentication.
@@ -366,12 +363,12 @@
// Initial state
private Subject subject;
private CallbackHandler callbackHandler;
- private Map sharedState;
+ private Map<String, Object> sharedState;
private Map<String, ?> options;
private LdapContext ctx;
private Matcher identityMatcher = null;
private Matcher filterMatcher = null;
- private Hashtable ldapEnvironment;
+ private Hashtable<String, Object> ldapEnvironment;
private SearchControls constraints = null;
/**
@@ -385,15 +382,18 @@
* <code>Configuration</code> for this particular
* <code>LoginModule</code>.
*/
+ // Unchecked warning from (Map<String, Object>)sharedState is safe
+ // since javax.security.auth.login.LoginContext passes a raw HashMap.
+ @SuppressWarnings("unchecked")
public void initialize(Subject subject, CallbackHandler callbackHandler,
Map<String, ?> sharedState, Map<String, ?> options) {
this.subject = subject;
this.callbackHandler = callbackHandler;
- this.sharedState = sharedState;
+ this.sharedState = (Map<String, Object>)sharedState;
this.options = options;
- ldapEnvironment = new Hashtable(9);
+ ldapEnvironment = new Hashtable<String, Object>(9);
ldapEnvironment.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
--- a/jdk/src/share/classes/com/sun/security/jgss/InquireSecContextPermission.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/security/jgss/InquireSecContextPermission.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -36,6 +36,7 @@
* <p>The target name is the {@link InquireType} allowed.
*/
public final class InquireSecContextPermission extends BasicPermission {
+ private static final long serialVersionUID = -7131173349668647297L;
/**
* Constructs a new {@code InquireSecContextPermission} object with
--- a/jdk/src/share/classes/com/sun/security/ntlm/Client.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/security/ntlm/Client.java Wed Jul 05 17:49:56 2017 +0200
@@ -69,14 +69,16 @@
* This method does not make any modification to this parameter, it neither
* needs to access the content of this parameter after this method call,
* so you are free to modify or nullify this parameter after this call.
- * @throws NullPointerException if {@code username} or {@code password} is null.
- * @throws NTLMException if {@code version} is illegal
+ * @throws NTLMException if {@code username} or {@code password} is null,
+ * or {@code version} is illegal.
+ *
*/
public Client(String version, String hostname, String username,
String domain, char[] password) throws NTLMException {
super(version);
if ((username == null || password == null)) {
- throw new NullPointerException("username/password cannot be null");
+ throw new NTLMException(NTLMException.PROTOCOL,
+ "username/password cannot be null");
}
this.hostname = hostname;
this.username = username;
@@ -117,13 +119,13 @@
* @param nonce random 8-byte array to be used in message generation,
* must not be null except for original NTLM v1
* @return the message generated
- * @throws NullPointerException if {@code type2} or {@code nonce} is null
- * for NTLM v1.
- * @throws NTLMException if the incoming message is invalid
+ * @throws NTLMException if the incoming message is invalid, or
+ * {@code nonce} is null for NTLM v1.
*/
public byte[] type3(byte[] type2, byte[] nonce) throws NTLMException {
if (type2 == null || (v != Version.NTLM && nonce == null)) {
- throw new NullPointerException("type2 and nonce cannot be null");
+ throw new NTLMException(NTLMException.PROTOCOL,
+ "type2 and nonce cannot be null");
}
debug("NTLM Client: Type 2 received\n");
debug(type2);
--- a/jdk/src/share/classes/com/sun/security/ntlm/NTLM.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/security/ntlm/NTLM.java Wed Jul 05 17:49:56 2017 +0200
@@ -33,6 +33,7 @@
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;
import java.util.Arrays;
+import java.util.Locale;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
@@ -410,7 +411,8 @@
static byte[] getP1(char[] password) {
try {
- return new String(password).toUpperCase().getBytes("ISO8859_1");
+ return new String(password).toUpperCase(
+ Locale.ENGLISH).getBytes("ISO8859_1");
} catch (UnsupportedEncodingException ex) {
return null;
}
--- a/jdk/src/share/classes/com/sun/security/ntlm/NTLMException.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/security/ntlm/NTLMException.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -31,6 +31,7 @@
* An NTLM-related Exception
*/
public final class NTLMException extends GeneralSecurityException {
+ private static final long serialVersionUID = -3298539507906689430L;
/**
* If the incoming packet is invalid.
@@ -64,6 +65,11 @@
*/
public final static int BAD_VERSION = 5;
+ /**
+ * Protocol errors.
+ */
+ public final static int PROTOCOL = 6;
+
private int errorCode;
/**
--- a/jdk/src/share/classes/com/sun/security/ntlm/Server.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/security/ntlm/Server.java Wed Jul 05 17:49:56 2017 +0200
@@ -62,12 +62,13 @@
* is selected, authentication succeeds if one of LM (or LMv2) or
* NTLM (or NTLMv2) is verified.
* @param domain the domain, must not be null
- * @throws NullPointerException if {@code domain} is null.
+ * @throws NTLMException if {@code domain} is null.
*/
public Server(String version, String domain) throws NTLMException {
super(version);
if (domain == null) {
- throw new NullPointerException("domain cannot be null");
+ throw new NTLMException(NTLMException.PROTOCOL,
+ "domain cannot be null");
}
this.allVersion = (version == null);
this.domain = domain;
@@ -80,12 +81,13 @@
* @param nonce the random 8-byte array to be used in message generation,
* must not be null
* @return the message generated
- * @throws NullPointerException if type1 or nonce is null
- * @throws NTLMException if the incoming message is invalid
+ * @throws NTLMException if the incoming message is invalid, or
+ * {@code nonce} is null.
*/
- public byte[] type2(byte[] type1, byte[] nonce) {
+ public byte[] type2(byte[] type1, byte[] nonce) throws NTLMException {
if (nonce == null) {
- throw new NullPointerException("nonce cannot be null");
+ throw new NTLMException(NTLMException.PROTOCOL,
+ "nonce cannot be null");
}
debug("NTLM Server: Type 1 received\n");
if (type1 != null) debug(type1);
@@ -105,13 +107,14 @@
* @param type3 the incoming Type3 message from client, must not be null
* @param nonce the same nonce provided in {@link #type2}, must not be null
* @return username and hostname of the client in a byte array
- * @throws NullPointerException if {@code type3} or {@code nonce} is null
- * @throws NTLMException if the incoming message is invalid
+ * @throws NTLMException if the incoming message is invalid, or
+ * {@code nonce} is null.
*/
public String[] verify(byte[] type3, byte[] nonce)
throws NTLMException {
if (type3 == null || nonce == null) {
- throw new NullPointerException("type1 or nonce cannot be null");
+ throw new NTLMException(NTLMException.PROTOCOL,
+ "type1 or nonce cannot be null");
}
debug("NTLM Server: Type 3 received\n");
if (type3 != null) debug(type3);
--- a/jdk/src/share/classes/com/sun/security/sasl/CramMD5Server.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/security/sasl/CramMD5Server.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -33,7 +33,6 @@
import java.io.UnsupportedEncodingException;
import java.security.NoSuchAlgorithmException;
-import java.util.logging.Logger;
import java.util.logging.Level;
/**
@@ -68,7 +67,7 @@
* @param pw A non-null String or byte[]
* containing the password. If it is an array, it is first cloned.
*/
- CramMD5Server(String protocol, String serverFqdn, Map props,
+ CramMD5Server(String protocol, String serverFqdn, Map<String, ?> props,
CallbackHandler cbh) throws SaslException {
if (serverFqdn == null) {
throw new SaslException(
--- a/jdk/src/share/classes/com/sun/security/sasl/digest/DigestMD5Base.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/security/sasl/digest/DigestMD5Base.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -28,21 +28,15 @@
import java.util.Map;
import java.util.Arrays;
import java.util.List;
-import java.util.Set;
-import java.util.logging.Logger;
import java.util.logging.Level;
import java.math.BigInteger;
import java.util.Random;
-import java.security.Provider;
-import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.UnsupportedEncodingException;
import java.io.IOException;
import java.security.MessageDigest;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
import java.security.NoSuchAlgorithmException;
import java.security.InvalidKeyException;
import java.security.spec.KeySpec;
@@ -53,7 +47,6 @@
import javax.crypto.SecretKey;
import javax.crypto.Mac;
import javax.crypto.SecretKeyFactory;
-import javax.crypto.BadPaddingException;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.spec.IvParameterSpec;
@@ -175,8 +168,9 @@
*
* @throws SaslException If invalid value found in props.
*/
- protected DigestMD5Base(Map props, String className, int firstStep,
- String digestUri, CallbackHandler cbh) throws SaslException {
+ protected DigestMD5Base(Map<String, ?> props, String className,
+ int firstStep, String digestUri, CallbackHandler cbh)
+ throws SaslException {
super(props, className); // sets QOP, STENGTH and BUFFER_SIZE
step = firstStep;
@@ -791,7 +785,7 @@
}
} else if (realmChoices != null && i == realmIndex) {
// > 1 realm specified
- if (realmChoices.size() == 0) {
+ if (realmChoices.isEmpty()) {
realmChoices.add(valueTable[i]); // add existing one
}
realmChoices.add(value); // add new one
@@ -1585,47 +1579,45 @@
KeySpec spec = null;
SecretKeyFactory desFactory =
SecretKeyFactory.getInstance(desStrength);
-
- if (desStrength.equals("des")) {
- spec = new DESKeySpec(subkey1, 0);
- if (logger.isLoggable(Level.FINEST)) {
- traceOutput(DP_CLASS_NAME, "makeDesKeys",
- "DIGEST42:DES key input: ", input);
- traceOutput(DP_CLASS_NAME, "makeDesKeys",
- "DIGEST43:DES key parity-adjusted: ", subkey1);
- traceOutput(DP_CLASS_NAME, "makeDesKeys",
- "DIGEST44:DES key material: ", ((DESKeySpec)spec).getKey());
- logger.log(Level.FINEST, "DIGEST45: is parity-adjusted? {0}",
- Boolean.valueOf(DESKeySpec.isParityAdjusted(subkey1, 0)));
- }
-
- } else if (desStrength.equals("desede")) {
-
- // Generate second subkey using second 7 bytes
- byte[] subkey2 = addDesParity(input, 7, 7);
-
- // Construct 24-byte encryption-decryption-encryption sequence
- byte[] ede = new byte[subkey1.length*2+subkey2.length];
- System.arraycopy(subkey1, 0, ede, 0, subkey1.length);
- System.arraycopy(subkey2, 0, ede, subkey1.length, subkey2.length);
- System.arraycopy(subkey1, 0, ede, subkey1.length+subkey2.length,
- subkey1.length);
-
- spec = new DESedeKeySpec(ede, 0);
- if (logger.isLoggable(Level.FINEST)) {
- traceOutput(DP_CLASS_NAME, "makeDesKeys",
- "DIGEST46:3DES key input: ", input);
- traceOutput(DP_CLASS_NAME, "makeDesKeys",
- "DIGEST47:3DES key ede: ", ede);
- traceOutput(DP_CLASS_NAME, "makeDesKeys",
- "DIGEST48:3DES key material: ",
- ((DESedeKeySpec)spec).getKey());
- logger.log(Level.FINEST, "DIGEST49: is parity-adjusted? ",
- Boolean.valueOf(DESedeKeySpec.isParityAdjusted(ede, 0)));
- }
- } else {
- throw new IllegalArgumentException("Invalid DES strength:" +
- desStrength);
+ switch (desStrength) {
+ case "des":
+ spec = new DESKeySpec(subkey1, 0);
+ if (logger.isLoggable(Level.FINEST)) {
+ traceOutput(DP_CLASS_NAME, "makeDesKeys",
+ "DIGEST42:DES key input: ", input);
+ traceOutput(DP_CLASS_NAME, "makeDesKeys",
+ "DIGEST43:DES key parity-adjusted: ", subkey1);
+ traceOutput(DP_CLASS_NAME, "makeDesKeys",
+ "DIGEST44:DES key material: ", ((DESKeySpec)spec).getKey());
+ logger.log(Level.FINEST, "DIGEST45: is parity-adjusted? {0}",
+ Boolean.valueOf(DESKeySpec.isParityAdjusted(subkey1, 0)));
+ }
+ break;
+ case "desede":
+ // Generate second subkey using second 7 bytes
+ byte[] subkey2 = addDesParity(input, 7, 7);
+ // Construct 24-byte encryption-decryption-encryption sequence
+ byte[] ede = new byte[subkey1.length*2+subkey2.length];
+ System.arraycopy(subkey1, 0, ede, 0, subkey1.length);
+ System.arraycopy(subkey2, 0, ede, subkey1.length, subkey2.length);
+ System.arraycopy(subkey1, 0, ede, subkey1.length+subkey2.length,
+ subkey1.length);
+ spec = new DESedeKeySpec(ede, 0);
+ if (logger.isLoggable(Level.FINEST)) {
+ traceOutput(DP_CLASS_NAME, "makeDesKeys",
+ "DIGEST46:3DES key input: ", input);
+ traceOutput(DP_CLASS_NAME, "makeDesKeys",
+ "DIGEST47:3DES key ede: ", ede);
+ traceOutput(DP_CLASS_NAME, "makeDesKeys",
+ "DIGEST48:3DES key material: ",
+ ((DESedeKeySpec)spec).getKey());
+ logger.log(Level.FINEST, "DIGEST49: is parity-adjusted? ",
+ Boolean.valueOf(DESedeKeySpec.isParityAdjusted(ede, 0)));
+ }
+ break;
+ default:
+ throw new IllegalArgumentException("Invalid DES strength:" +
+ desStrength);
}
return desFactory.generateSecret(spec);
}
--- a/jdk/src/share/classes/com/sun/security/sasl/digest/DigestMD5Client.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/security/sasl/digest/DigestMD5Client.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -25,21 +25,16 @@
package com.sun.security.sasl.digest;
-import java.security.AccessController;
-import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.io.ByteArrayOutputStream;
-import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.StringTokenizer;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import java.util.Arrays;
-import java.util.logging.Logger;
import java.util.logging.Level;
import javax.security.sasl.*;
@@ -153,7 +148,7 @@
* @throws SaslException if no authentication ID or password is supplied
*/
DigestMD5Client(String authzid, String protocol, String serverName,
- Map props, CallbackHandler cbh) throws SaslException {
+ Map<String, ?> props, CallbackHandler cbh) throws SaslException {
super(props, MY_CLASS_NAME, 2, protocol + "/" + serverName, cbh);
--- a/jdk/src/share/classes/com/sun/security/sasl/digest/DigestMD5Server.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/security/sasl/digest/DigestMD5Server.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -25,23 +25,16 @@
package com.sun.security.sasl.digest;
-import java.security.AccessController;
-import java.security.Provider;
-import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.io.ByteArrayOutputStream;
-import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
-import java.util.Random;
import java.util.StringTokenizer;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import java.util.Arrays;
-import java.util.logging.Logger;
import java.util.logging.Level;
import javax.security.sasl.*;
@@ -147,7 +140,7 @@
private byte[] myCiphers;
private List<String> serverRealms;
- DigestMD5Server(String protocol, String serverName, Map props,
+ DigestMD5Server(String protocol, String serverName, Map<String, ?> props,
CallbackHandler cbh) throws SaslException {
super(props, MY_CLASS_NAME, 1, protocol + "/" + serverName, cbh);
@@ -179,7 +172,7 @@
encoding = (useUTF8 ? "UTF8" : "8859_1");
// By default, use server name as realm
- if (serverRealms.size() == 0) {
+ if (serverRealms.isEmpty()) {
serverRealms.add(serverName);
}
}
@@ -468,19 +461,23 @@
// Check that QOP is one sent by server
byte cQop;
- if (negotiatedQop.equals("auth")) {
- cQop = NO_PROTECTION;
- } else if (negotiatedQop.equals("auth-int")) {
- cQop = INTEGRITY_ONLY_PROTECTION;
- integrity = true;
- rawSendSize = sendMaxBufSize - 16;
- } else if (negotiatedQop.equals("auth-conf")) {
- cQop = PRIVACY_PROTECTION;
- integrity = privacy = true;
- rawSendSize = sendMaxBufSize - 26;
- } else {
- throw new SaslException("DIGEST-MD5: digest response format " +
- "violation. Invalid QOP: " + negotiatedQop);
+ switch (negotiatedQop) {
+ case "auth":
+ cQop = NO_PROTECTION;
+ break;
+ case "auth-int":
+ cQop = INTEGRITY_ONLY_PROTECTION;
+ integrity = true;
+ rawSendSize = sendMaxBufSize - 16;
+ break;
+ case "auth-conf":
+ cQop = PRIVACY_PROTECTION;
+ integrity = privacy = true;
+ rawSendSize = sendMaxBufSize - 26;
+ break;
+ default:
+ throw new SaslException("DIGEST-MD5: digest response format " +
+ "violation. Invalid QOP: " + negotiatedQop);
}
if ((cQop&allQop) == 0) {
throw new SaslException("DIGEST-MD5: server does not support " +
--- a/jdk/src/share/classes/com/sun/security/sasl/gsskerb/GssKrb5Base.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/security/sasl/gsskerb/GssKrb5Base.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -26,9 +26,7 @@
package com.sun.security.sasl.gsskerb;
-import java.io.IOException;
import java.util.Map;
-import java.util.logging.Logger;
import java.util.logging.Level;
import javax.security.sasl.*;
import com.sun.security.sasl.util.AbstractSaslImpl;
@@ -50,7 +48,8 @@
protected MessageProp msgProp; // QOP and privacy for unwrap
protected static final int JGSS_QOP = 0; // unrelated to SASL QOP mask
- protected GssKrb5Base(Map props, String className) throws SaslException {
+ protected GssKrb5Base(Map<String, ?> props, String className)
+ throws SaslException {
super(props, className);
}
--- a/jdk/src/share/classes/com/sun/security/sasl/gsskerb/GssKrb5Client.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/security/sasl/gsskerb/GssKrb5Client.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -27,7 +27,6 @@
import java.io.IOException;
import java.util.Map;
-import java.util.logging.Logger;
import java.util.logging.Level;
import javax.security.sasl.*;
@@ -93,7 +92,7 @@
* with the server.
*/
GssKrb5Client(String authzID, String protocol, String serverName,
- Map props, CallbackHandler cbh) throws SaslException {
+ Map<String, ?> props, CallbackHandler cbh) throws SaslException {
super(props, MY_CLASS_NAME);
--- a/jdk/src/share/classes/com/sun/security/sasl/gsskerb/GssKrb5Server.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/security/sasl/gsskerb/GssKrb5Server.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -28,7 +28,6 @@
import javax.security.sasl.*;
import java.io.*;
import java.util.Map;
-import java.util.logging.Logger;
import java.util.logging.Level;
// JAAS
@@ -77,7 +76,7 @@
* with the client.
*/
GssKrb5Server(String protocol, String serverName,
- Map props, CallbackHandler cbh) throws SaslException {
+ Map<String, ?> props, CallbackHandler cbh) throws SaslException {
super(props, MY_CLASS_NAME);
--- a/jdk/src/share/classes/com/sun/security/sasl/ntlm/FactoryImpl.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/security/sasl/ntlm/FactoryImpl.java Wed Jul 05 17:49:56 2017 +0200
@@ -70,6 +70,12 @@
if (mechs[i].equals("NTLM") &&
PolicyUtils.checkPolicy(mechPolicies[0], props)) {
+ if (cbh == null) {
+ throw new SaslException(
+ "Callback handler with support for " +
+ "RealmCallback, NameCallback, and PasswordCallback " +
+ "required");
+ }
return new NTLMClient(mechs[i], authorizationId,
protocol, serverName, props, cbh);
}
@@ -98,9 +104,9 @@
}
if (cbh == null) {
throw new SaslException(
- "Callback handler with support for AuthorizeCallback, "+
- "RealmCallback, NameCallback, and PasswordCallback " +
- "required");
+ "Callback handler with support for " +
+ "RealmCallback, NameCallback, and PasswordCallback " +
+ "required");
}
return new NTLMServer(mech, protocol, serverName, props, cbh);
}
--- a/jdk/src/share/classes/com/sun/security/sasl/ntlm/NTLMClient.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/security/sasl/ntlm/NTLMClient.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -107,11 +107,11 @@
* @param protocol non-null for Sasl, useless for NTLM
* @param serverName non-null for Sasl, but can be null for NTLM
* @param props can be null
- * @param cbh can be null for Sasl, but will throw NPE for NTLM
+ * @param cbh can be null for Sasl, already null-checked in factory
* @throws SaslException
*/
NTLMClient(String mech, String authzid, String protocol, String serverName,
- Map props, CallbackHandler cbh) throws SaslException {
+ Map<String, ?> props, CallbackHandler cbh) throws SaslException {
this.mech = mech;
String version = null;
@@ -166,7 +166,7 @@
pcb.getPassword());
} catch (NTLMException ne) {
throw new SaslException(
- "NTLM: Invalid version string: " + version, ne);
+ "NTLM: client creation failure", ne);
}
}
@@ -183,23 +183,27 @@
@Override
public byte[] unwrap(byte[] incoming, int offset, int len)
throws SaslException {
- throw new UnsupportedOperationException("Not supported.");
+ throw new IllegalStateException("Not supported.");
}
@Override
public byte[] wrap(byte[] outgoing, int offset, int len)
throws SaslException {
- throw new UnsupportedOperationException("Not supported.");
+ throw new IllegalStateException("Not supported.");
}
@Override
public Object getNegotiatedProperty(String propName) {
- if (propName.equals(Sasl.QOP)) {
- return "auth";
- } else if (propName.equals(NTLM_DOMAIN)) {
- return client.getDomain();
- } else {
- return null;
+ if (!isComplete()) {
+ throw new IllegalStateException("authentication not complete");
+ }
+ switch (propName) {
+ case Sasl.QOP:
+ return "auth";
+ case NTLM_DOMAIN:
+ return client.getDomain();
+ default:
+ return null;
}
}
--- a/jdk/src/share/classes/com/sun/security/sasl/ntlm/NTLMServer.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/security/sasl/ntlm/NTLMServer.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -106,11 +106,12 @@
* @param serverName not null for Sasl, can be null in NTLM. If non-null,
* might be used as domain if not provided in props
* @param props can be null
- * @param cbh can be null for Sasl, but will throw NPE in auth for NTLM
+ * @param cbh can be null for Sasl, already null-checked in factory
* @throws SaslException
*/
NTLMServer(String mech, String protocol, String serverName,
- Map props, final CallbackHandler cbh) throws SaslException {
+ Map<String, ?> props, final CallbackHandler cbh)
+ throws SaslException {
this.mech = mech;
String version = null;
@@ -131,7 +132,7 @@
domain = serverName;
}
if (domain == null) {
- throw new NullPointerException("Domain must be provided as"
+ throw new SaslException("Domain must be provided as"
+ " the serverName argument or in props");
}
@@ -158,7 +159,7 @@
};
} catch (NTLMException ne) {
throw new SaslException(
- "NTLM: Invalid version string: " + version, ne);
+ "NTLM: server creation failure", ne);
}
nonce = new byte[8];
}
@@ -181,8 +182,8 @@
hostname = out[1];
return null;
}
- } catch (GeneralSecurityException ex) {
- throw new SaslException("", ex);
+ } catch (NTLMException ex) {
+ throw new SaslException("NTLM: generate response failure", ex);
}
}
@@ -193,29 +194,36 @@
@Override
public String getAuthorizationID() {
+ if (!isComplete()) {
+ throw new IllegalStateException("authentication not complete");
+ }
return authzId;
}
@Override
public byte[] unwrap(byte[] incoming, int offset, int len)
throws SaslException {
- throw new UnsupportedOperationException("Not supported yet.");
+ throw new IllegalStateException("Not supported yet.");
}
@Override
public byte[] wrap(byte[] outgoing, int offset, int len)
throws SaslException {
- throw new UnsupportedOperationException("Not supported yet.");
+ throw new IllegalStateException("Not supported yet.");
}
@Override
public Object getNegotiatedProperty(String propName) {
- if (propName.equals(Sasl.QOP)) {
- return "auth";
- } else if (propName.equals(NTLM_HOSTNAME)) {
- return hostname;
- } else {
- return null;
+ if (!isComplete()) {
+ throw new IllegalStateException("authentication not complete");
+ }
+ switch (propName) {
+ case Sasl.QOP:
+ return "auth";
+ case NTLM_HOSTNAME:
+ return hostname;
+ default:
+ return null;
}
}
--- a/jdk/src/share/classes/com/sun/security/sasl/util/AbstractSaslImpl.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/security/sasl/util/AbstractSaslImpl.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -29,8 +29,6 @@
import java.io.*;
import java.util.Map;
import java.util.StringTokenizer;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
import java.util.logging.Logger;
import java.util.logging.Level;
@@ -63,7 +61,8 @@
protected String myClassName;
- protected AbstractSaslImpl(Map props, String className) throws SaslException {
+ protected AbstractSaslImpl(Map<String, ?> props, String className)
+ throws SaslException {
myClassName = className;
// Parse properties to set desired context options
@@ -156,23 +155,23 @@
if (!completed) {
throw new IllegalStateException("SASL authentication not completed");
}
-
- if (propName.equals(Sasl.QOP)) {
- if (privacy) {
- return "auth-conf";
- } else if (integrity) {
- return "auth-int";
- } else {
- return "auth";
- }
- } else if (propName.equals(Sasl.MAX_BUFFER)) {
- return Integer.toString(recvMaxBufSize);
- } else if (propName.equals(Sasl.RAW_SEND_SIZE)) {
- return Integer.toString(rawSendSize);
- } else if (propName.equals(MAX_SEND_BUF)) {
- return Integer.toString(sendMaxBufSize);
- } else {
- return null;
+ switch (propName) {
+ case Sasl.QOP:
+ if (privacy) {
+ return "auth-conf";
+ } else if (integrity) {
+ return "auth-int";
+ } else {
+ return "auth";
+ }
+ case Sasl.MAX_BUFFER:
+ return Integer.toString(recvMaxBufSize);
+ case Sasl.RAW_SEND_SIZE:
+ return Integer.toString(rawSendSize);
+ case MAX_SEND_BUF:
+ return Integer.toString(sendMaxBufSize);
+ default:
+ return null;
}
}
--- a/jdk/src/share/classes/com/sun/security/sasl/util/PolicyUtils.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/security/sasl/util/PolicyUtils.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -53,7 +53,7 @@
* @param props The security policy properties to check
* @return true if passes; false if fails
*/
- public static boolean checkPolicy(int flags, Map props) {
+ public static boolean checkPolicy(int flags, Map<String, ?> props) {
if (props == null) {
return true;
}
@@ -93,7 +93,7 @@
*
*/
public static String[] filterMechs(String[] mechs, int[] policies,
- Map props) {
+ Map<String, ?> props) {
if (props == null) {
return mechs.clone();
}
--- a/jdk/src/share/classes/com/sun/servicetag/SunConnection.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/servicetag/SunConnection.java Wed Jul 05 17:49:56 2017 +0200
@@ -101,10 +101,7 @@
return new URL(registerURL);
} catch (MalformedURLException ex) {
// should never reach here
- InternalError x =
- new InternalError(ex.getMessage());
- x.initCause(ex);
- throw x;
+ throw new InternalError(ex.getMessage(), ex);
}
}
@@ -171,9 +168,7 @@
try {
BrowserSupport.browse(url.toURI());
} catch (URISyntaxException ex) {
- InternalError x = new InternalError("Error in registering: " + ex.getMessage());
- x.initCause(ex);
- throw x;
+ throw new InternalError("Error in registering: " + ex.getMessage(), ex);
} catch (IllegalArgumentException ex) {
if (Util.isVerbose()) {
ex.printStackTrace();
@@ -232,9 +227,7 @@
return (returnCode == HttpURLConnection.HTTP_OK);
} catch (MalformedURLException me) {
// should never reach here
- InternalError x = new InternalError("Error in registering: " + me.getMessage());
- x.initCause(me);
- throw x;
+ throw new InternalError("Error in registering: " + me.getMessage(), me);
} catch (Exception ioe) {
// SocketTimeoutException, IOException or UnknownHostException
if (Util.isVerbose()) {
@@ -262,10 +255,9 @@
BrowserSupport.browse(registerPage.toURI());
} catch (FileNotFoundException ex) {
// should never reach here
- InternalError x =
- new InternalError("Error in launching " + registerPage + ": " + ex.getMessage());
- x.initCause(ex);
- throw x;
+ throw new InternalError(
+ "Error in launching " + registerPage + ": " + ex.getMessage()
+ , ex);
} catch (IllegalArgumentException ex) {
if (Util.isVerbose()) {
ex.printStackTrace();
--- a/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth.properties Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth.properties Wed Jul 05 17:49:56 2017 +0200
@@ -19,10 +19,14 @@
############ FILE CHOOSER STRINGS #############
FileChooser.lookInLabelText=Look In:
+FileChooser.lookInLabelMnemonic=73
FileChooser.saveInLabelText=Save In:
FileChooser.fileNameLabelText=File Name:
-FileChooser.folderNameLabelText=Folder name:
+FileChooser.fileNameLabelMnemonic=78
+FileChooser.folderNameLabelText=Folder Name:
+FileChooser.folderNameLabelMnemonic=78
FileChooser.filesOfTypeLabelText=Files of Type:
+FileChooser.filesOfTypeLabelMnemonic=84
FileChooser.upFolderToolTipText=Up One Level
FileChooser.upFolderAccessibleName=Up
FileChooser.homeFolderToolTipText=Home
--- a/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_de.properties Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_de.properties Wed Jul 05 17:49:56 2017 +0200
@@ -19,10 +19,14 @@
############ FILE CHOOSER STRINGS #############
FileChooser.lookInLabelText=Suchen in:
+FileChooser.lookInLabelMnemonic=73
FileChooser.saveInLabelText=Speichern in:
FileChooser.fileNameLabelText=Dateiname:
+FileChooser.fileNameLabelMnemonic=78
FileChooser.folderNameLabelText=Ordnername:
+FileChooser.folderNameLabelMnemonic=78
FileChooser.filesOfTypeLabelText=Dateityp:
+FileChooser.filesOfTypeLabelMnemonic=84
FileChooser.upFolderToolTipText=Eine Ebene h\u00F6her
FileChooser.upFolderAccessibleName=Nach oben
FileChooser.homeFolderToolTipText=Home
--- a/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_es.properties Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_es.properties Wed Jul 05 17:49:56 2017 +0200
@@ -19,10 +19,14 @@
############ FILE CHOOSER STRINGS #############
FileChooser.lookInLabelText=Buscar en:
+FileChooser.lookInLabelMnemonic=73
FileChooser.saveInLabelText=Guardar en:
FileChooser.fileNameLabelText=Nombre de Archivo:
+FileChooser.fileNameLabelMnemonic=78
FileChooser.folderNameLabelText=Nombre de la Carpeta:
+FileChooser.folderNameLabelMnemonic=78
FileChooser.filesOfTypeLabelText=Archivos de Tipo:
+FileChooser.filesOfTypeLabelMnemonic=84
FileChooser.upFolderToolTipText=Subir un Nivel
FileChooser.upFolderAccessibleName=Arriba
FileChooser.homeFolderToolTipText=Inicio
--- a/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_fr.properties Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_fr.properties Wed Jul 05 17:49:56 2017 +0200
@@ -19,10 +19,14 @@
############ FILE CHOOSER STRINGS #############
FileChooser.lookInLabelText=Rechercher dans :
+FileChooser.lookInLabelMnemonic=73
FileChooser.saveInLabelText=Enregistrer dans :
FileChooser.fileNameLabelText=Nom du fichier :
+FileChooser.fileNameLabelMnemonic=78
FileChooser.folderNameLabelText=Nom du dossier :
+FileChooser.folderNameLabelMnemonic=78
FileChooser.filesOfTypeLabelText=Fichiers de type :
+FileChooser.filesOfTypeLabelMnemonic=84
FileChooser.upFolderToolTipText=Remonte d'un niveau.
FileChooser.upFolderAccessibleName=Monter
FileChooser.homeFolderToolTipText=R\u00E9pertoire d'origine
--- a/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_it.properties Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_it.properties Wed Jul 05 17:49:56 2017 +0200
@@ -19,10 +19,14 @@
############ FILE CHOOSER STRINGS #############
FileChooser.lookInLabelText=Cerca in:
+FileChooser.lookInLabelMnemonic=73
FileChooser.saveInLabelText=Salva in:
FileChooser.fileNameLabelText=Nome file:
+FileChooser.fileNameLabelMnemonic=78
FileChooser.folderNameLabelText=Nome della cartella:
+FileChooser.folderNameLabelMnemonic=78
FileChooser.filesOfTypeLabelText=Tipo file:
+FileChooser.filesOfTypeLabelMnemonic=84
FileChooser.upFolderToolTipText=Cartella superiore
FileChooser.upFolderAccessibleName=Superiore
FileChooser.homeFolderToolTipText=Home
--- a/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_ja.properties Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_ja.properties Wed Jul 05 17:49:56 2017 +0200
@@ -19,10 +19,14 @@
############ FILE CHOOSER STRINGS #############
FileChooser.lookInLabelText=\u53C2\u7167:
+FileChooser.lookInLabelMnemonic=73
FileChooser.saveInLabelText=\u4FDD\u5B58:
FileChooser.fileNameLabelText=\u30D5\u30A1\u30A4\u30EB\u540D:
+FileChooser.fileNameLabelMnemonic=78
FileChooser.folderNameLabelText=\u30D5\u30A9\u30EB\u30C0\u540D:
+FileChooser.folderNameLabelMnemonic=78
FileChooser.filesOfTypeLabelText=\u30D5\u30A1\u30A4\u30EB\u306E\u30BF\u30A4\u30D7:
+FileChooser.filesOfTypeLabelMnemonic=84
FileChooser.upFolderToolTipText=1\u30EC\u30D9\u30EB\u4E0A\u3078
FileChooser.upFolderAccessibleName=\u4E0A\u3078
FileChooser.homeFolderToolTipText=\u30DB\u30FC\u30E0
--- a/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_ko.properties Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_ko.properties Wed Jul 05 17:49:56 2017 +0200
@@ -19,10 +19,14 @@
############ FILE CHOOSER STRINGS #############
FileChooser.lookInLabelText=\uAC80\uC0C9 \uC704\uCE58:
+FileChooser.lookInLabelMnemonic=73
FileChooser.saveInLabelText=\uC800\uC7A5 \uC704\uCE58:
FileChooser.fileNameLabelText=\uD30C\uC77C \uC774\uB984:
+FileChooser.fileNameLabelMnemonic=78
FileChooser.folderNameLabelText=\uD3F4\uB354 \uC774\uB984:
+FileChooser.folderNameLabelMnemonic=78
FileChooser.filesOfTypeLabelText=\uD30C\uC77C \uC720\uD615:
+FileChooser.filesOfTypeLabelMnemonic=84
FileChooser.upFolderToolTipText=\uD55C \uB808\uBCA8 \uC704\uB85C
FileChooser.upFolderAccessibleName=\uC704\uB85C
FileChooser.homeFolderToolTipText=\uD648
--- a/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_pt_BR.properties Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_pt_BR.properties Wed Jul 05 17:49:56 2017 +0200
@@ -19,10 +19,14 @@
############ FILE CHOOSER STRINGS #############
FileChooser.lookInLabelText=Consultar Em:
+FileChooser.lookInLabelMnemonic=73
FileChooser.saveInLabelText=Salvar Em:
FileChooser.fileNameLabelText=Nome do Arquivo:
+FileChooser.fileNameLabelMnemonic=78
FileChooser.folderNameLabelText=Nome da pasta:
+FileChooser.folderNameLabelMnemonic=78
FileChooser.filesOfTypeLabelText=Arquivos do Tipo:
+FileChooser.filesOfTypeLabelMnemonic=84
FileChooser.upFolderToolTipText=Um N\u00EDvel Acima
FileChooser.upFolderAccessibleName=Acima
FileChooser.homeFolderToolTipText=In\u00EDcio
--- a/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_sv.properties Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_sv.properties Wed Jul 05 17:49:56 2017 +0200
@@ -19,10 +19,14 @@
############ FILE CHOOSER STRINGS #############
FileChooser.lookInLabelText=Leta i:
+FileChooser.lookInLabelMnemonic=73
FileChooser.saveInLabelText=Spara i:
FileChooser.fileNameLabelText=Filnamn:
+FileChooser.fileNameLabelMnemonic=78
FileChooser.folderNameLabelText=Mapp:
+FileChooser.folderNameLabelMnemonic=78
FileChooser.filesOfTypeLabelText=Filformat:
+FileChooser.filesOfTypeLabelMnemonic=84
FileChooser.upFolderToolTipText=Upp en niv\u00E5
FileChooser.upFolderAccessibleName=Upp
FileChooser.homeFolderToolTipText=Hem
--- a/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_zh_CN.properties Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_zh_CN.properties Wed Jul 05 17:49:56 2017 +0200
@@ -19,10 +19,14 @@
############ FILE CHOOSER STRINGS #############
FileChooser.lookInLabelText=\u67E5\u770B:
+FileChooser.lookInLabelMnemonic=73
FileChooser.saveInLabelText=\u4FDD\u5B58:
FileChooser.fileNameLabelText=\u6587\u4EF6\u540D:
+FileChooser.fileNameLabelMnemonic=78
FileChooser.folderNameLabelText=\u6587\u4EF6\u5939\u540D:
+FileChooser.folderNameLabelMnemonic=78
FileChooser.filesOfTypeLabelText=\u6587\u4EF6\u7C7B\u578B:
+FileChooser.filesOfTypeLabelMnemonic=84
FileChooser.upFolderToolTipText=\u5411\u4E0A\u4E00\u7EA7
FileChooser.upFolderAccessibleName=\u5411\u4E0A
FileChooser.homeFolderToolTipText=\u4E3B\u76EE\u5F55
--- a/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_zh_TW.properties Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_zh_TW.properties Wed Jul 05 17:49:56 2017 +0200
@@ -19,10 +19,14 @@
############ FILE CHOOSER STRINGS #############
FileChooser.lookInLabelText=\u67E5\u8A62:
+FileChooser.lookInLabelMnemonic=73
FileChooser.saveInLabelText=\u5132\u5B58\u65BC:
FileChooser.fileNameLabelText=\u6A94\u6848\u540D\u7A31:
+FileChooser.fileNameLabelMnemonic=78
FileChooser.folderNameLabelText=\u8CC7\u6599\u593E\u540D\u7A31:
+FileChooser.folderNameLabelMnemonic=78
FileChooser.filesOfTypeLabelText=\u6A94\u6848\u985E\u578B:
+FileChooser.filesOfTypeLabelMnemonic=84
FileChooser.upFolderToolTipText=\u5F80\u4E0A\u4E00\u5C64
FileChooser.upFolderAccessibleName=\u5F80\u4E0A
FileChooser.homeFolderToolTipText=\u4E3B\u76EE\u9304
--- a/jdk/src/share/classes/java/io/BufferedReader.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/io/BufferedReader.java Wed Jul 05 17:49:56 2017 +0200
@@ -514,9 +514,12 @@
synchronized (lock) {
if (in == null)
return;
- in.close();
- in = null;
- cb = null;
+ try {
+ in.close();
+ } finally {
+ in = null;
+ cb = null;
+ }
}
}
}
--- a/jdk/src/share/classes/java/io/BufferedWriter.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/io/BufferedWriter.java Wed Jul 05 17:49:56 2017 +0200
@@ -255,15 +255,15 @@
}
}
+ @SuppressWarnings("try")
public void close() throws IOException {
synchronized (lock) {
if (out == null) {
return;
}
- try {
+ try (Writer w = out) {
flushBuffer();
} finally {
- out.close();
out = null;
cb = null;
}
--- a/jdk/src/share/classes/java/io/Closeable.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/io/Closeable.java Wed Jul 05 17:49:56 2017 +0200
@@ -42,6 +42,12 @@
* with it. If the stream is already closed then invoking this
* method has no effect.
*
+ * <p> As noted in {@link AutoCloseable#close()}, cases where the
+ * close may fail require careful attention. It is strongly advised
+ * to relinquish the underlying resources and to internally
+ * <em>mark</em> the {@code Closeable} as closed, prior to throwing
+ * the {@code IOException}.
+ *
* @throws IOException if an I/O error occurs
*/
public void close() throws IOException;
--- a/jdk/src/share/classes/java/io/FilterOutputStream.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/io/FilterOutputStream.java Wed Jul 05 17:49:56 2017 +0200
@@ -152,11 +152,10 @@
* @see java.io.FilterOutputStream#flush()
* @see java.io.FilterOutputStream#out
*/
+ @SuppressWarnings("try")
public void close() throws IOException {
- try {
- flush();
- } catch (IOException ignored) {
+ try (OutputStream ostream = out) {
+ flush();
}
- out.close();
}
}
--- a/jdk/src/share/classes/java/lang/AutoCloseable.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/lang/AutoCloseable.java Wed Jul 05 17:49:56 2017 +0200
@@ -43,6 +43,15 @@
* throw more specific exceptions, or to throw no exception at all
* if the close operation cannot fail.
*
+ * <p> Cases where the close operation may fail require careful
+ * attention by implementers. It is strongly advised to relinquish
+ * the underlying resources and to internally <em>mark</em> the
+ * resource as closed, prior to throwing the exception. The {@code
+ * close} method is unlikely to be invoked more than once and so
+ * this ensures that the resources are released in a timely manner.
+ * Furthermore it reduces problems that could arise when the resource
+ * wraps, or is wrapped, by another resource.
+ *
* <p><em>Implementers of this interface are also strongly advised
* to not have the {@code close} method throw {@link
* InterruptedException}.</em>
--- a/jdk/src/share/classes/java/lang/Integer.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/lang/Integer.java Wed Jul 05 17:49:56 2017 +0200
@@ -776,17 +776,17 @@
* Determines the integer value of the system property with the
* specified name.
*
- * <p>The first argument is treated as the name of a system property.
- * System properties are accessible through the
- * {@link java.lang.System#getProperty(java.lang.String)} method. The
+ * <p>The first argument is treated as the name of a system
+ * property. System properties are accessible through the {@link
+ * java.lang.System#getProperty(java.lang.String)} method. The
* string value of this property is then interpreted as an integer
- * value and an {@code Integer} object representing this value is
- * returned. Details of possible numeric formats can be found with
- * the definition of {@code getProperty}.
+ * value using the grammar supported by {@link Integer#decode decode} and
+ * an {@code Integer} object representing this value is returned.
*
- * <p>If there is no property with the specified name, if the specified name
- * is empty or {@code null}, or if the property does not have
- * the correct numeric format, then {@code null} is returned.
+ * <p>If there is no property with the specified name, if the
+ * specified name is empty or {@code null}, or if the property
+ * does not have the correct numeric format, then {@code null} is
+ * returned.
*
* <p>In other words, this method returns an {@code Integer}
* object equal to the value of:
@@ -808,13 +808,12 @@
* Determines the integer value of the system property with the
* specified name.
*
- * <p>The first argument is treated as the name of a system property.
- * System properties are accessible through the {@link
+ * <p>The first argument is treated as the name of a system
+ * property. System properties are accessible through the {@link
* java.lang.System#getProperty(java.lang.String)} method. The
* string value of this property is then interpreted as an integer
- * value and an {@code Integer} object representing this value is
- * returned. Details of possible numeric formats can be found with
- * the definition of {@code getProperty}.
+ * value using the grammar supported by {@link Integer#decode decode} and
+ * an {@code Integer} object representing this value is returned.
*
* <p>The second argument is the default value. An {@code Integer} object
* that represents the value of the second argument is returned if there
@@ -856,9 +855,9 @@
* system property. System properties are accessible through the
* {@link java.lang.System#getProperty(java.lang.String)} method.
* The string value of this property is then interpreted as an
- * integer value, as per the {@code Integer.decode} method,
+ * integer value, as per the {@link Integer#decode decode} method,
* and an {@code Integer} object representing this value is
- * returned.
+ * returned; in summary:
*
* <ul><li>If the property value begins with the two ASCII characters
* {@code 0x} or the ASCII character {@code #}, not
@@ -882,16 +881,14 @@
* @param nm property name.
* @param val default value.
* @return the {@code Integer} value of the property.
- * @see java.lang.System#getProperty(java.lang.String)
- * @see java.lang.System#getProperty(java.lang.String, java.lang.String)
- * @see java.lang.Integer#decode
+ * @see System#getProperty(java.lang.String)
+ * @see System#getProperty(java.lang.String, java.lang.String)
*/
public static Integer getInteger(String nm, Integer val) {
String v = null;
try {
v = System.getProperty(nm);
- } catch (IllegalArgumentException e) {
- } catch (NullPointerException e) {
+ } catch (IllegalArgumentException | NullPointerException e) {
}
if (v != null) {
try {
--- a/jdk/src/share/classes/java/lang/InternalError.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/lang/InternalError.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 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
@@ -32,8 +32,7 @@
* @author unascribed
* @since JDK1.0
*/
-public
-class InternalError extends VirtualMachineError {
+public class InternalError extends VirtualMachineError {
private static final long serialVersionUID = -9062593416125562365L;
/**
@@ -47,9 +46,45 @@
* Constructs an <code>InternalError</code> with the specified
* detail message.
*
- * @param s the detail message.
+ * @param message the detail message.
+ */
+ public InternalError(String message) {
+ super(message);
+ }
+
+
+ /**
+ * Constructs an {@code InternalError} with the specified detail
+ * message and cause. <p>Note that the detail message associated
+ * with {@code cause} is <i>not</i> automatically incorporated in
+ * this error's detail message.
+ *
+ * @param message the detail message (which is saved for later retrieval
+ * by the {@link #getMessage()} method).
+ * @param cause the cause (which is saved for later retrieval by the
+ * {@link #getCause()} method). (A {@code null} value is
+ * permitted, and indicates that the cause is nonexistent or
+ * unknown.)
+ * @since 1.8
*/
- public InternalError(String s) {
- super(s);
+ public InternalError(String message, Throwable cause) {
+ super(message, cause);
}
+
+ /**
+ * Constructs an {@code InternalError} with the specified cause
+ * and a detail message of {@code (cause==null ? null :
+ * cause.toString())} (which typically contains the class and
+ * detail message of {@code cause}).
+ *
+ * @param cause the cause (which is saved for later retrieval by the
+ * {@link #getCause()} method). (A {@code null} value is
+ * permitted, and indicates that the cause is nonexistent or
+ * unknown.)
+ * @since 1.8
+ */
+ public InternalError(Throwable cause) {
+ super(cause);
+ }
+
}
--- a/jdk/src/share/classes/java/lang/Long.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/lang/Long.java Wed Jul 05 17:49:56 2017 +0200
@@ -806,22 +806,20 @@
* Determines the {@code long} value of the system property
* with the specified name.
*
- * <p>The first argument is treated as the name of a system property.
- * System properties are accessible through the {@link
+ * <p>The first argument is treated as the name of a system
+ * property. System properties are accessible through the {@link
* java.lang.System#getProperty(java.lang.String)} method. The
- * string value of this property is then interpreted as a
- * {@code long} value and a {@code Long} object
- * representing this value is returned. Details of possible
- * numeric formats can be found with the definition of
- * {@code getProperty}.
+ * string value of this property is then interpreted as a {@code
+ * long} value using the grammar supported by {@link Long#decode decode}
+ * and a {@code Long} object representing this value is returned.
*
* <p>If there is no property with the specified name, if the
- * specified name is empty or {@code null}, or if the
- * property does not have the correct numeric format, then
- * {@code null} is returned.
+ * specified name is empty or {@code null}, or if the property
+ * does not have the correct numeric format, then {@code null} is
+ * returned.
*
- * <p>In other words, this method returns a {@code Long} object equal to
- * the value of:
+ * <p>In other words, this method returns a {@code Long} object
+ * equal to the value of:
*
* <blockquote>
* {@code getLong(nm, null)}
@@ -840,14 +838,12 @@
* Determines the {@code long} value of the system property
* with the specified name.
*
- * <p>The first argument is treated as the name of a system property.
- * System properties are accessible through the {@link
+ * <p>The first argument is treated as the name of a system
+ * property. System properties are accessible through the {@link
* java.lang.System#getProperty(java.lang.String)} method. The
- * string value of this property is then interpreted as a
- * {@code long} value and a {@code Long} object
- * representing this value is returned. Details of possible
- * numeric formats can be found with the definition of
- * {@code getProperty}.
+ * string value of this property is then interpreted as a {@code
+ * long} value using the grammar supported by {@link Long#decode decode}
+ * and a {@code Long} object representing this value is returned.
*
* <p>The second argument is the default value. A {@code Long} object
* that represents the value of the second argument is returned if there
@@ -889,8 +885,8 @@
* the {@link java.lang.System#getProperty(java.lang.String)}
* method. The string value of this property is then interpreted
* as a {@code long} value, as per the
- * {@code Long.decode} method, and a {@code Long} object
- * representing this value is returned.
+ * {@link Long#decode decode} method, and a {@code Long} object
+ * representing this value is returned; in summary:
*
* <ul>
* <li>If the property value begins with the two ASCII characters
@@ -921,16 +917,14 @@
* @param nm property name.
* @param val default value.
* @return the {@code Long} value of the property.
- * @see java.lang.System#getProperty(java.lang.String)
- * @see java.lang.System#getProperty(java.lang.String, java.lang.String)
- * @see java.lang.Long#decode
+ * @see System#getProperty(java.lang.String)
+ * @see System#getProperty(java.lang.String, java.lang.String)
*/
public static Long getLong(String nm, Long val) {
String v = null;
try {
v = System.getProperty(nm);
- } catch (IllegalArgumentException e) {
- } catch (NullPointerException e) {
+ } catch (IllegalArgumentException | NullPointerException e) {
}
if (v != null) {
try {
--- a/jdk/src/share/classes/java/lang/System.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/lang/System.java Wed Jul 05 17:49:56 2017 +0200
@@ -632,6 +632,7 @@
*
* <p>On UNIX systems, it returns {@code "\n"}; on Microsoft
* Windows systems it returns {@code "\r\n"}.
+ * @since 1.7
*/
public static String lineSeparator() {
return lineSeparator;
--- a/jdk/src/share/classes/java/lang/VirtualMachineError.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/lang/VirtualMachineError.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,9 +1,9 @@
/*
- * Copyright (c) 1995, 1997, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
+ * under the terms of the GNU General Public License version 2 only, asP
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
@@ -33,8 +33,9 @@
* @author Frank Yellin
* @since JDK1.0
*/
-abstract public
-class VirtualMachineError extends Error {
+abstract public class VirtualMachineError extends Error {
+ private static final long serialVersionUID = 4161983926571568670L;
+
/**
* Constructs a <code>VirtualMachineError</code> with no detail message.
*/
@@ -46,9 +47,43 @@
* Constructs a <code>VirtualMachineError</code> with the specified
* detail message.
*
- * @param s the detail message.
+ * @param message the detail message.
*/
- public VirtualMachineError(String s) {
- super(s);
+ public VirtualMachineError(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructs a {@code VirtualMachineError} with the specified
+ * detail message and cause. <p>Note that the detail message
+ * associated with {@code cause} is <i>not</i> automatically
+ * incorporated in this error's detail message.
+ *
+ * @param message the detail message (which is saved for later retrieval
+ * by the {@link #getMessage()} method).
+ * @param cause the cause (which is saved for later retrieval by the
+ * {@link #getCause()} method). (A {@code null} value is
+ * permitted, and indicates that the cause is nonexistent or
+ * unknown.)
+ * @since 1.8
+ */
+ public VirtualMachineError(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Constructs an a {@code VirtualMachineError} with the specified
+ * cause and a detail message of {@code (cause==null ? null :
+ * cause.toString())} (which typically contains the class and
+ * detail message of {@code cause}).
+ *
+ * @param cause the cause (which is saved for later retrieval by the
+ * {@link #getCause()} method). (A {@code null} value is
+ * permitted, and indicates that the cause is nonexistent or
+ * unknown.)
+ * @since 1.8
+ */
+ public VirtualMachineError(Throwable cause) {
+ super(cause);
}
}
--- a/jdk/src/share/classes/java/lang/reflect/Array.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/lang/reflect/Array.java Wed Jul 05 17:49:56 2017 +0200
@@ -474,10 +474,10 @@
* Private
*/
- private static native Object newArray(Class componentType, int length)
+ private static native Object newArray(Class<?> componentType, int length)
throws NegativeArraySizeException;
- private static native Object multiNewArray(Class componentType,
+ private static native Object multiNewArray(Class<?> componentType,
int[] dimensions)
throws IllegalArgumentException, NegativeArraySizeException;
--- a/jdk/src/share/classes/java/lang/reflect/Constructor.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/lang/reflect/Constructor.java Wed Jul 05 17:49:56 2017 +0200
@@ -27,14 +27,12 @@
import sun.reflect.ConstructorAccessor;
import sun.reflect.Reflection;
-import sun.reflect.annotation.AnnotationParser;
import sun.reflect.generics.repository.ConstructorRepository;
import sun.reflect.generics.factory.CoreReflectionFactory;
import sun.reflect.generics.factory.GenericsFactory;
import sun.reflect.generics.scope.ConstructorScope;
import java.lang.annotation.Annotation;
import java.lang.annotation.AnnotationFormatError;
-import java.lang.reflect.Modifier;
/**
* {@code Constructor} provides information about, and access to, a single
@@ -184,6 +182,7 @@
* @since 1.5
*/
@Override
+ @SuppressWarnings({ "rawtypes", "unchecked" })
public TypeVariable<Constructor<T>>[] getTypeParameters() {
if (getSignature() != null) {
return (TypeVariable<Constructor<T>>[])getGenericInfo().getTypeParameters();
@@ -197,7 +196,7 @@
*/
@Override
public Class<?>[] getParameterTypes() {
- return (Class<?>[]) parameterTypes.clone();
+ return parameterTypes.clone();
}
/**
@@ -217,7 +216,7 @@
*/
@Override
public Class<?>[] getExceptionTypes() {
- return (Class<?>[])exceptionTypes.clone();
+ return exceptionTypes.clone();
}
@@ -392,7 +391,9 @@
if (ca == null) {
ca = acquireConstructorAccessor();
}
- return (T) ca.newInstance(initargs);
+ @SuppressWarnings("unchecked")
+ T inst = (T) ca.newInstance(initargs);
+ return inst;
}
/**
--- a/jdk/src/share/classes/java/lang/reflect/Executable.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/lang/reflect/Executable.java Wed Jul 05 17:49:56 2017 +0200
@@ -29,9 +29,6 @@
import java.util.Map;
import sun.reflect.annotation.AnnotationParser;
import sun.reflect.generics.repository.ConstructorRepository;
-import sun.reflect.generics.factory.CoreReflectionFactory;
-import sun.reflect.generics.factory.GenericsFactory;
-import sun.reflect.generics.scope.ConstructorScope;
/**
* A shared superclass for the common functionality of {@link Method}
@@ -366,8 +363,8 @@
* {@inheritDoc}
* @throws NullPointerException {@inheritDoc}
*/
- @SuppressWarnings("unchecked")
- public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
+ @SuppressWarnings("unchecked")
+ public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
if (annotationClass == null)
throw new NullPointerException();
--- a/jdk/src/share/classes/java/lang/reflect/Field.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/lang/reflect/Field.java Wed Jul 05 17:49:56 2017 +0200
@@ -1012,6 +1012,7 @@
* @throws NullPointerException {@inheritDoc}
* @since 1.5
*/
+ @SuppressWarnings("unchecked")
public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
if (annotationClass == null)
throw new NullPointerException();
--- a/jdk/src/share/classes/java/lang/reflect/Method.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/lang/reflect/Method.java Wed Jul 05 17:49:56 2017 +0200
@@ -194,6 +194,7 @@
* @since 1.5
*/
@Override
+ @SuppressWarnings({ "rawtypes", "unchecked" })
public TypeVariable<Method>[] getTypeParameters() {
if (getGenericSignature() != null)
return (TypeVariable<Method>[])getGenericInfo().getTypeParameters();
@@ -246,7 +247,7 @@
*/
@Override
public Class<?>[] getParameterTypes() {
- return (Class<?>[]) parameterTypes.clone();
+ return parameterTypes.clone();
}
/**
@@ -266,7 +267,7 @@
*/
@Override
public Class<?>[] getExceptionTypes() {
- return (Class<?>[]) exceptionTypes.clone();
+ return exceptionTypes.clone();
}
/**
--- a/jdk/src/share/classes/java/lang/reflect/Proxy.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/lang/reflect/Proxy.java Wed Jul 05 17:49:56 2017 +0200
@@ -604,15 +604,12 @@
* Invoke its constructor with the designated invocation handler.
*/
try {
- Constructor cons = cl.getConstructor(constructorParams);
+ Constructor<?> cons = cl.getConstructor(constructorParams);
return cons.newInstance(new Object[] { h });
- } catch (NoSuchMethodException e) {
- throw new InternalError(e.toString());
- } catch (IllegalAccessException e) {
- throw new InternalError(e.toString());
- } catch (InstantiationException e) {
- throw new InternalError(e.toString());
- } catch (InvocationTargetException e) {
+ } catch (NoSuchMethodException |
+ IllegalAccessException |
+ InstantiationException |
+ InvocationTargetException e) {
throw new InternalError(e.toString());
}
}
@@ -661,6 +658,6 @@
return p.h;
}
- private static native Class defineClass0(ClassLoader loader, String name,
- byte[] b, int off, int len);
+ private static native Class<?> defineClass0(ClassLoader loader, String name,
+ byte[] b, int off, int len);
}
--- a/jdk/src/share/classes/java/net/HttpCookie.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/net/HttpCookie.java Wed Jul 05 17:49:56 2017 +0200
@@ -748,10 +748,14 @@
&& (embeddedDotInDomain == -1 || embeddedDotInDomain == domain.length() - 1))
return false;
- // if the host name contains no dot and the domain name is .local
+ // if the host name contains no dot and the domain name
+ // is .local or host.local
int firstDotInHost = host.indexOf('.');
- if (firstDotInHost == -1 && isLocalDomain)
+ if (firstDotInHost == -1 &&
+ (isLocalDomain ||
+ domain.equalsIgnoreCase(host + ".local"))) {
return true;
+ }
int domainLength = domain.length();
int lengthDiff = host.length() - domainLength;
--- a/jdk/src/share/classes/java/nio/Bits.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/nio/Bits.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -699,6 +699,14 @@
}
};
}
+ @Override
+ public ByteBuffer newDirectByteBuffer(long addr, int cap, Object ob) {
+ return new DirectByteBuffer(addr, cap, ob);
+ }
+ @Override
+ public void truncate(Buffer buf) {
+ buf.truncate();
+ }
});
}
--- a/jdk/src/share/classes/java/nio/Buffer.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/nio/Buffer.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -543,6 +543,13 @@
return mark;
}
+ final void truncate() { // package-private
+ mark = -1;
+ position = 0;
+ limit = 0;
+ capacity = 0;
+ }
+
final void discardMark() { // package-private
mark = -1;
}
--- a/jdk/src/share/classes/java/nio/Direct-X-Buffer.java.template Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/nio/Direct-X-Buffer.java.template Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -58,12 +58,13 @@
// NOTE: moved up to Buffer.java for speed in JNI GetDirectBufferAddress
// protected long address;
- // If this buffer is a view of another buffer then we keep a reference to
- // that buffer so that its memory isn't freed before we're done with it
- protected Object viewedBuffer = null;
+ // An object attached to this buffer. If this buffer is a view of another
+ // buffer then we use this field to keep a reference to that buffer to
+ // ensure that its memory isn't freed before we are done with it.
+ private final Object att;
- public Object viewedBuffer() {
- return viewedBuffer;
+ public Object attachment() {
+ return att;
}
#if[byte]
@@ -136,6 +137,7 @@
address = base;
}
cleaner = Cleaner.create(this, new Deallocator(base, size, cap));
+ att = null;
#else[rw]
super(cap);
#end[rw]
@@ -143,12 +145,24 @@
#if[rw]
+ // Invoked to construct a direct ByteBuffer referring to the block of
+ // memory. A given arbitrary object may also be attached to the buffer.
+ //
+ Direct$Type$Buffer(long addr, int cap, Object ob) {
+ super(-1, 0, cap, cap);
+ address = addr;
+ cleaner = null;
+ att = ob;
+ }
+
+
// Invoked only by JNI: NewDirectByteBuffer(void*, long)
//
private Direct$Type$Buffer(long addr, int cap) {
super(-1, 0, cap, cap);
address = addr;
cleaner = null;
+ att = null;
}
#end[rw]
@@ -162,8 +176,8 @@
#if[rw]
super(-1, 0, cap, cap, fd);
address = addr;
- viewedBuffer = null;
cleaner = Cleaner.create(this, unmapper);
+ att = null;
#else[rw]
super(cap, addr, fd, unmapper);
#end[rw]
@@ -180,10 +194,10 @@
#if[rw]
super(mark, pos, lim, cap);
address = db.address() + off;
- viewedBuffer = db;
#if[byte]
cleaner = null;
#end[byte]
+ att = db;
#else[rw]
super(db, mark, pos, lim, cap, off);
#end[rw]
--- a/jdk/src/share/classes/java/security/AccessControlContext.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/security/AccessControlContext.java Wed Jul 05 17:49:56 2017 +0200
@@ -29,8 +29,6 @@
import java.util.List;
import sun.security.util.Debug;
import sun.security.util.SecurityConstants;
-import sun.misc.JavaSecurityAccess;
-import sun.misc.SharedSecrets;
/**
@@ -312,7 +310,7 @@
Debug.isOn("permission=" + perm.getClass().getCanonicalName());
if (dumpDebug && Debug.isOn("stack")) {
- Thread.currentThread().dumpStack();
+ Thread.dumpStack();
}
if (dumpDebug && Debug.isOn("domain")) {
@@ -353,7 +351,7 @@
if (!dumpDebug) {
debug.println("access denied " + perm);
}
- Thread.currentThread().dumpStack();
+ Thread.dumpStack();
final ProtectionDomain pd = context[i];
final Debug db = debug;
AccessController.doPrivileged (new PrivilegedAction<Void>() {
@@ -561,7 +559,7 @@
match = (that.context[j] == null);
}
} else {
- Class thisPdClass = thisPd.getClass();
+ Class<?> thisPdClass = thisPd.getClass();
ProtectionDomain thatPd;
for (int j = 0; (j < that.context.length) && !match; j++) {
thatPd = that.context[j];
--- a/jdk/src/share/classes/java/security/AccessController.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/security/AccessController.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -406,7 +406,7 @@
* callerClass[2] = AccessController.doPrivileged
* callerClass[3] = caller
*/
- final Class callerClass = sun.reflect.Reflection.getCallerClass(3);
+ final Class<?> callerClass = sun.reflect.Reflection.getCallerClass(3);
ProtectionDomain callerPd = doPrivileged
(new PrivilegedAction<ProtectionDomain>() {
public ProtectionDomain run() {
@@ -538,7 +538,7 @@
}
if (dumpDebug && Debug.isOn("stack")) {
- Thread.currentThread().dumpStack();
+ Thread.dumpStack();
}
if (dumpDebug && Debug.isOn("domain")) {
--- a/jdk/src/share/classes/java/security/BasicPermission.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/security/BasicPermission.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,7 +25,6 @@
package java.security;
-import java.security.*;
import java.util.Enumeration;
import java.util.Map;
import java.util.HashMap;
@@ -333,14 +332,14 @@
*
* @see #serialPersistentFields
*/
- private Class permClass;
+ private Class<?> permClass;
/**
* Create an empty BasicPermissionCollection object.
*
*/
- public BasicPermissionCollection(Class clazz) {
+ public BasicPermissionCollection(Class<?> clazz) {
perms = new HashMap<String, Permission>(11);
all_allowed = false;
permClass = clazz;
@@ -542,6 +541,9 @@
ObjectInputStream.GetField gfields = in.readFields();
// Get permissions
+ // writeObject writes a Hashtable<String, Permission> for the
+ // permissions key, so this cast is safe, unless the data is corrupt.
+ @SuppressWarnings("unchecked")
Hashtable<String, Permission> permissions =
(Hashtable<String, Permission>)gfields.get("permissions", null);
perms = new HashMap<String, Permission>(permissions.size()*2);
@@ -551,7 +553,7 @@
all_allowed = gfields.get("all_allowed", false);
// Get permClass
- permClass = (Class) gfields.get("permClass", null);
+ permClass = (Class<?>) gfields.get("permClass", null);
if (permClass == null) {
// set permClass
--- a/jdk/src/share/classes/java/security/KeyRep.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/security/KeyRep.java Wed Jul 05 17:49:56 2017 +0200
@@ -26,6 +26,7 @@
package java.security;
import java.io.*;
+import java.util.Locale;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
@@ -137,7 +138,7 @@
this.type = type;
this.algorithm = algorithm;
- this.format = format.toUpperCase();
+ this.format = format.toUpperCase(Locale.ENGLISH);
this.encoded = encoded.clone();
}
--- a/jdk/src/share/classes/java/security/Permissions.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/security/Permissions.java Wed Jul 05 17:49:56 2017 +0200
@@ -31,7 +31,6 @@
import java.util.Map;
import java.util.HashMap;
import java.util.List;
-import java.util.ArrayList;
import java.util.Iterator;
import java.util.Collections;
import java.io.Serializable;
@@ -238,7 +237,7 @@
*/
private PermissionCollection getPermissionCollection(Permission p,
boolean createEmpty) {
- Class c = p.getClass();
+ Class<?> c = p.getClass();
PermissionCollection pc = permsMap.get(c);
@@ -390,6 +389,9 @@
allPermission = (PermissionCollection) gfields.get("allPermission", null);
// Get permissions
+ // writeObject writes a Hashtable<Class<?>, PermissionCollection> for
+ // the perms key, so this cast is safe, unless the data is corrupt.
+ @SuppressWarnings("unchecked")
Hashtable<Class<?>, PermissionCollection> perms =
(Hashtable<Class<?>, PermissionCollection>)gfields.get("perms", null);
permsMap = new HashMap<Class<?>, PermissionCollection>(perms.size()*2);
@@ -590,6 +592,9 @@
ObjectInputStream.GetField gfields = in.readFields();
// Get permissions
+ // writeObject writes a Hashtable<Class<?>, PermissionCollection> for
+ // the perms key, so this cast is safe, unless the data is corrupt.
+ @SuppressWarnings("unchecked")
Hashtable<Permission, Permission> perms =
(Hashtable<Permission, Permission>)gfields.get("perms", null);
permsMap = new HashMap<Permission, Permission>(perms.size()*2);
--- a/jdk/src/share/classes/java/security/Policy.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/security/Policy.java Wed Jul 05 17:49:56 2017 +0200
@@ -26,16 +26,7 @@
package java.security;
-import java.io.*;
-import java.lang.RuntimePermission;
-import java.lang.reflect.*;
-import java.net.MalformedURLException;
-import java.net.URL;
import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.PropertyPermission;
-import java.util.StringTokenizer;
-import java.util.Vector;
import java.util.WeakHashMap;
import sun.security.jca.GetInstance;
import sun.security.util.Debug;
@@ -786,6 +777,8 @@
private static class UnsupportedEmptyCollection
extends PermissionCollection {
+ private static final long serialVersionUID = -8492269157353014774L;
+
private Permissions perms;
/**
--- a/jdk/src/share/classes/java/security/ProtectionDomain.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/security/ProtectionDomain.java Wed Jul 05 17:49:56 2017 +0200
@@ -33,7 +33,6 @@
import java.util.WeakHashMap;
import sun.misc.JavaSecurityProtectionDomainAccess;
import static sun.misc.JavaSecurityProtectionDomainAccess.ProtectionDomainCache;
-import sun.misc.SharedSecrets;
import sun.security.util.Debug;
import sun.security.util.SecurityConstants;
import sun.misc.JavaSecurityAccess;
@@ -403,7 +402,7 @@
e = permissions.elements(); // domain vs policy
while (e.hasMoreElements()) {
Permission pdp = e.nextElement();
- Class pdpClass = pdp.getClass();
+ Class<?> pdpClass = pdp.getClass();
String pdpActions = pdp.getActions();
String pdpName = pdp.getName();
for (int i = 0; i < plVector.size(); i++) {
--- a/jdk/src/share/classes/java/security/Provider.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/security/Provider.java Wed Jul 05 17:49:56 2017 +0200
@@ -31,9 +31,6 @@
import java.lang.ref.*;
import java.lang.reflect.*;
-import java.security.cert.CertStoreParameters;
-import javax.security.auth.login.Configuration;
-
/**
* This class represents a "provider" for the
* Java Security API, where a provider implements some or all parts of
@@ -453,8 +450,8 @@
* Internal method to be called AFTER the security check has been
* performed.
*/
- private void implPutAll(Map t) {
- for (Map.Entry e : ((Map<?,?>)t).entrySet()) {
+ private void implPutAll(Map<?,?> t) {
+ for (Map.Entry<?,?> e : t.entrySet()) {
implPut(e.getKey(), e.getValue());
}
}
@@ -562,9 +559,9 @@
* occur if the legacy properties are inconsistent or incomplete.
*/
private void removeInvalidServices(Map<ServiceKey,Service> map) {
- for (Iterator t = map.entrySet().iterator(); t.hasNext(); ) {
- Map.Entry entry = (Map.Entry)t.next();
- Service s = (Service)entry.getValue();
+ for (Iterator<Map.Entry<ServiceKey, Service>> t =
+ map.entrySet().iterator(); t.hasNext(); ) {
+ Service s = t.next().getValue();
if (s.isValid() == false) {
t.remove();
}
@@ -918,15 +915,15 @@
final String name;
final boolean supportsParameter;
final String constructorParameterClassName;
- private volatile Class constructorParameterClass;
+ private volatile Class<?> constructorParameterClass;
EngineDescription(String name, boolean sp, String paramName) {
this.name = name;
this.supportsParameter = sp;
this.constructorParameterClassName = paramName;
}
- Class getConstructorParameterClass() throws ClassNotFoundException {
- Class clazz = constructorParameterClass;
+ Class<?> getConstructorParameterClass() throws ClassNotFoundException {
+ Class<?> clazz = constructorParameterClass;
if (clazz == null) {
clazz = Class.forName(constructorParameterClassName);
constructorParameterClass = clazz;
@@ -1038,7 +1035,7 @@
private Map<UString,String> attributes;
// Reference to the cached implementation Class object
- private volatile Reference<Class> classRef;
+ private volatile Reference<Class<?>> classRef;
// flag indicating whether this service has its attributes for
// supportedKeyFormats or supportedKeyClasses set
@@ -1055,7 +1052,7 @@
// whether this service has been registered with the Provider
private boolean registered;
- private static final Class[] CLASS0 = new Class[0];
+ private static final Class<?>[] CLASS0 = new Class<?>[0];
// this constructor and these methods are used for parsing
// the legacy string properties.
@@ -1234,12 +1231,12 @@
("constructorParameter not used with " + type
+ " engines");
}
- Class clazz = getImplClass();
+ Class<?> clazz = getImplClass();
return clazz.newInstance();
} else {
- Class paramClass = cap.getConstructorParameterClass();
+ Class<?> paramClass = cap.getConstructorParameterClass();
if (constructorParameter != null) {
- Class argClass = constructorParameter.getClass();
+ Class<?> argClass = constructorParameter.getClass();
if (paramClass.isAssignableFrom(argClass) == false) {
throw new InvalidParameterException
("constructorParameter must be instanceof "
@@ -1247,8 +1244,8 @@
+ " for engine type " + type);
}
}
- Class clazz = getImplClass();
- Constructor cons = clazz.getConstructor(paramClass);
+ Class<?> clazz = getImplClass();
+ Constructor<?> cons = clazz.getConstructor(paramClass);
return cons.newInstance(constructorParameter);
}
} catch (NoSuchAlgorithmException e) {
@@ -1267,10 +1264,10 @@
}
// return the implementation Class object for this service
- private Class getImplClass() throws NoSuchAlgorithmException {
+ private Class<?> getImplClass() throws NoSuchAlgorithmException {
try {
- Reference<Class> ref = classRef;
- Class clazz = (ref == null) ? null : ref.get();
+ Reference<Class<?>> ref = classRef;
+ Class<?> clazz = (ref == null) ? null : ref.get();
if (clazz == null) {
ClassLoader cl = provider.getClass().getClassLoader();
if (cl == null) {
@@ -1278,7 +1275,7 @@
} else {
clazz = cl.loadClass(className);
}
- classRef = new WeakReference<Class>(clazz);
+ classRef = new WeakReference<Class<?>>(clazz);
}
return clazz;
} catch (ClassNotFoundException e) {
@@ -1295,18 +1292,18 @@
*/
private Object newInstanceGeneric(Object constructorParameter)
throws Exception {
- Class clazz = getImplClass();
+ Class<?> clazz = getImplClass();
if (constructorParameter == null) {
Object o = clazz.newInstance();
return o;
}
- Class argClass = constructorParameter.getClass();
+ Class<?> argClass = constructorParameter.getClass();
Constructor[] cons = clazz.getConstructors();
// find first public constructor that can take the
// argument as parameter
for (int i = 0; i < cons.length; i++) {
- Constructor con = cons[i];
- Class[] paramTypes = con.getParameterTypes();
+ Constructor<?> con = cons[i];
+ Class<?>[] paramTypes = con.getParameterTypes();
if (paramTypes.length != 1) {
continue;
}
@@ -1394,10 +1391,10 @@
s = getAttribute("SupportedKeyClasses");
if (s != null) {
String[] classNames = s.split("\\|");
- List<Class> classList =
+ List<Class<?>> classList =
new ArrayList<>(classNames.length);
for (String className : classNames) {
- Class clazz = getKeyClass(className);
+ Class<?> clazz = getKeyClass(className);
if (clazz != null) {
classList.add(clazz);
}
@@ -1414,7 +1411,7 @@
}
// get the key class object of the specified name
- private Class getKeyClass(String name) {
+ private Class<?> getKeyClass(String name) {
try {
return Class.forName(name);
} catch (ClassNotFoundException e) {
@@ -1451,8 +1448,8 @@
if (supportedClasses == null) {
return false;
}
- Class keyClass = key.getClass();
- for (Class clazz : supportedClasses) {
+ Class<?> keyClass = key.getClass();
+ for (Class<?> clazz : supportedClasses) {
if (clazz.isAssignableFrom(keyClass)) {
return true;
}
--- a/jdk/src/share/classes/java/security/Security.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/security/Security.java Wed Jul 05 17:49:56 2017 +0200
@@ -33,8 +33,6 @@
import sun.security.util.Debug;
import sun.security.util.PropertyExpander;
-import java.security.Provider.Service;
-
import sun.security.jca.*;
/**
@@ -660,15 +658,16 @@
}
// Map containing cached Spi Class objects of the specified type
- private static final Map<String, Class> spiMap = new ConcurrentHashMap<>();
+ private static final Map<String, Class<?>> spiMap =
+ new ConcurrentHashMap<>();
/**
* Return the Class object for the given engine type
* (e.g. "MessageDigest"). Works for Spis in the java.security package
* only.
*/
- private static Class getSpiClass(String type) {
- Class clazz = spiMap.get(type);
+ private static Class<?> getSpiClass(String type) {
+ Class<?> clazz = spiMap.get(type);
if (clazz != null) {
return clazz;
}
@@ -1078,7 +1077,7 @@
if ((serviceName == null) || (serviceName.length() == 0) ||
(serviceName.endsWith("."))) {
- return Collections.EMPTY_SET;
+ return Collections.emptySet();
}
HashSet<String> result = new HashSet<>();
@@ -1088,8 +1087,10 @@
// Check the keys for each provider.
for (Enumeration<Object> e = providers[i].keys();
e.hasMoreElements(); ) {
- String currentKey = ((String)e.nextElement()).toUpperCase();
- if (currentKey.startsWith(serviceName.toUpperCase())) {
+ String currentKey =
+ ((String)e.nextElement()).toUpperCase(Locale.ENGLISH);
+ if (currentKey.startsWith(
+ serviceName.toUpperCase(Locale.ENGLISH))) {
// We should skip the currentKey if it contains a
// whitespace. The reason is: such an entry in the
// provider property contains attributes for the
@@ -1097,7 +1098,8 @@
// in entries which lead to the implementation
// classes.
if (currentKey.indexOf(" ") < 0) {
- result.add(currentKey.substring(serviceName.length() + 1));
+ result.add(currentKey.substring(
+ serviceName.length() + 1));
}
}
}
--- a/jdk/src/share/classes/java/security/UnresolvedPermission.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/security/UnresolvedPermission.java Wed Jul 05 17:49:56 2017 +0200
@@ -28,9 +28,7 @@
import java.io.IOException;
import java.io.ByteArrayInputStream;
import java.util.ArrayList;
-import java.util.Enumeration;
import java.util.Hashtable;
-import java.util.Vector;
import java.lang.reflect.*;
import java.security.cert.*;
@@ -247,19 +245,19 @@
}
}
try {
- Class pc = p.getClass();
+ Class<?> pc = p.getClass();
if (name == null && actions == null) {
try {
- Constructor c = pc.getConstructor(PARAMS0);
+ Constructor<?> c = pc.getConstructor(PARAMS0);
return (Permission)c.newInstance(new Object[] {});
} catch (NoSuchMethodException ne) {
try {
- Constructor c = pc.getConstructor(PARAMS1);
+ Constructor<?> c = pc.getConstructor(PARAMS1);
return (Permission) c.newInstance(
new Object[] { name});
} catch (NoSuchMethodException ne1) {
- Constructor c = pc.getConstructor(PARAMS2);
+ Constructor<?> c = pc.getConstructor(PARAMS2);
return (Permission) c.newInstance(
new Object[] { name, actions });
}
@@ -267,16 +265,16 @@
} else {
if (name != null && actions == null) {
try {
- Constructor c = pc.getConstructor(PARAMS1);
+ Constructor<?> c = pc.getConstructor(PARAMS1);
return (Permission) c.newInstance(
new Object[] { name});
} catch (NoSuchMethodException ne) {
- Constructor c = pc.getConstructor(PARAMS2);
+ Constructor<?> c = pc.getConstructor(PARAMS2);
return (Permission) c.newInstance(
new Object[] { name, actions });
}
} else {
- Constructor c = pc.getConstructor(PARAMS2);
+ Constructor<?> c = pc.getConstructor(PARAMS2);
return (Permission) c.newInstance(
new Object[] { name, actions });
}
--- a/jdk/src/share/classes/java/security/UnresolvedPermissionCollection.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/security/UnresolvedPermissionCollection.java Wed Jul 05 17:49:56 2017 +0200
@@ -197,8 +197,12 @@
ObjectInputStream.GetField gfields = in.readFields();
// Get permissions
+ @SuppressWarnings("unchecked")
+ // writeObject writes a Hashtable<String, Vector<UnresolvedPermission>>
+ // for the permissions key, so this cast is safe, unless the data is corrupt.
Hashtable<String, Vector<UnresolvedPermission>> permissions =
- (Hashtable<String, Vector<UnresolvedPermission>>)gfields.get("permissions", null);
+ (Hashtable<String, Vector<UnresolvedPermission>>)
+ gfields.get("permissions", null);
perms = new HashMap<String, List<UnresolvedPermission>>(permissions.size()*2);
// Convert each entry (Vector) into a List
--- a/jdk/src/share/classes/java/security/cert/CertificateRevokedException.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/security/cert/CertificateRevokedException.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -32,7 +32,6 @@
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
-import java.util.Map.Entry;
import javax.security.auth.x500.X500Principal;
import sun.security.util.ObjectIdentifier;
@@ -95,7 +94,7 @@
this.revocationDate = new Date(revocationDate.getTime());
this.reason = reason;
this.authority = authority;
- this.extensions = new HashMap(extensions);
+ this.extensions = new HashMap<String, Extension>(extensions);
}
/**
@@ -148,8 +147,7 @@
return null;
} else {
try {
- Date invalidity =
- (Date) InvalidityDateExtension.toImpl(ext).get("DATE");
+ Date invalidity = InvalidityDateExtension.toImpl(ext).get("DATE");
return new Date(invalidity.getTime());
} catch (IOException ioe) {
return null;
--- a/jdk/src/share/classes/java/security/cert/X509CRLSelector.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/security/cert/X509CRLSelector.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -632,7 +632,7 @@
byte[] encoded = in.getOctetString();
CRLNumberExtension crlNumExt =
new CRLNumberExtension(Boolean.FALSE, encoded);
- crlNum = (BigInteger)crlNumExt.get(CRLNumberExtension.NUMBER);
+ crlNum = crlNumExt.get(CRLNumberExtension.NUMBER);
} catch (IOException ex) {
if (debug != null) {
debug.println("X509CRLSelector.match: exception in "
--- a/jdk/src/share/classes/java/security/cert/X509CertSelector.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/security/cert/X509CertSelector.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -277,7 +277,7 @@
try {
issuer = (issuerDN == null ? null : new X500Principal(issuerDN));
} catch (IllegalArgumentException e) {
- throw (IOException)new IOException("Invalid name").initCause(e);
+ throw new IOException("Invalid name", e);
}
}
@@ -341,7 +341,7 @@
try {
subject = (subjectDN == null ? null : new X500Principal(subjectDN));
} catch (IllegalArgumentException e) {
- throw (IOException)new IOException("Invalid name").initCause(e);
+ throw new IOException("Invalid name", e);
}
}
@@ -872,7 +872,7 @@
* @param object2 a Collection containing the second object to compare
* @return true if the objects are equal, false otherwise
*/
- static boolean equalNames(Collection object1, Collection object2) {
+ static boolean equalNames(Collection<?> object1, Collection<?> object2) {
if ((object1 == null) || (object2 == null)) {
return object1 == object2;
}
@@ -1672,19 +1672,15 @@
private static Set<List<?>> cloneAndCheckNames(Collection<List<?>> names) throws IOException {
// Copy the Lists and Collection
Set<List<?>> namesCopy = new HashSet<List<?>>();
- Iterator<List<?>> i = names.iterator();
- while (i.hasNext()) {
- Object o = i.next();
- if (!(o instanceof List)) {
- throw new IOException("expected a List");
- }
- namesCopy.add(new ArrayList<Object>((List<?>)o));
+ for (List<?> o : names)
+ {
+ namesCopy.add(new ArrayList<Object>(o));
}
// Check the contents of the Lists and clone any byte arrays
- i = namesCopy.iterator();
- while (i.hasNext()) {
- List<Object> nameList = (List<Object>)i.next();
+ for (List<?> list : namesCopy) {
+ @SuppressWarnings("unchecked") // See javadoc for parameter "names".
+ List<Object> nameList = (List<Object>)list;
if (nameList.size() != 2) {
throw new IOException("name list size not 2");
}
@@ -2184,8 +2180,7 @@
if (debug != null) {
String time = "n/a";
try {
- Date notAfter =
- (Date)ext.get(PrivateKeyUsageExtension.NOT_AFTER);
+ Date notAfter = ext.get(PrivateKeyUsageExtension.NOT_AFTER);
time = notAfter.toString();
} catch (CertificateException ex) {
// not able to retrieve notAfter value
@@ -2201,8 +2196,7 @@
if (debug != null) {
String time = "n/a";
try {
- Date notBefore = (Date)
- ext.get(PrivateKeyUsageExtension.NOT_BEFORE);
+ Date notBefore = ext.get(PrivateKeyUsageExtension.NOT_BEFORE);
time = notBefore.toString();
} catch (CertificateException ex) {
// not able to retrieve notBefore value
@@ -2214,14 +2208,6 @@
e2.printStackTrace();
}
return false;
- } catch (CertificateException e3) {
- if (debug != null) {
- debug.println("X509CertSelector.match: CertificateException "
- + "in private key usage check; X509CertSelector: "
- + this.toString());
- e3.printStackTrace();
- }
- return false;
} catch (IOException e4) {
if (debug != null) {
debug.println("X509CertSelector.match: IOException in "
@@ -2252,7 +2238,7 @@
+ subjectPublicKeyAlgID + ", xcert subjectPublicKeyAlgID = "
+ algID.getOID());
}
- if (!subjectPublicKeyAlgID.equals(algID.getOID())) {
+ if (!subjectPublicKeyAlgID.equals((Object)algID.getOID())) {
if (debug != null) {
debug.println("X509CertSelector.match: "
+ "subject public key alg IDs don't match");
@@ -2301,7 +2287,7 @@
EXTENDED_KEY_USAGE_ID);
if (ext != null) {
Vector<ObjectIdentifier> certKeyPurposeVector =
- (Vector<ObjectIdentifier>)ext.get(ExtendedKeyUsageExtension.USAGES);
+ ext.get(ExtendedKeyUsageExtension.USAGES);
if (!certKeyPurposeVector.contains(ANY_EXTENDED_KEY_USAGE)
&& !certKeyPurposeVector.containsAll(keyPurposeOIDSet)) {
if (debug != null) {
@@ -2337,8 +2323,8 @@
}
return false;
}
- GeneralNames certNames = (GeneralNames)
- sanExt.get(SubjectAlternativeNameExtension.SUBJECT_NAME);
+ GeneralNames certNames =
+ sanExt.get(SubjectAlternativeNameExtension.SUBJECT_NAME);
Iterator<GeneralNameInterface> i =
subjectAlternativeGeneralNames.iterator();
while (i.hasNext()) {
@@ -2406,7 +2392,7 @@
}
return false;
}
- List<PolicyInformation> policies = (List<PolicyInformation>)ext.get(CertificatePoliciesExtension.POLICIES);
+ List<PolicyInformation> policies = ext.get(CertificatePoliciesExtension.POLICIES);
/*
* Convert the Vector of PolicyInformation to a Vector
* of CertificatePolicyIds for easier comparison.
@@ -2467,7 +2453,7 @@
if (ext == null) {
return true;
}
- if ((debug != null) && debug.isOn("certpath")) {
+ if ((debug != null) && Debug.isOn("certpath")) {
debug.println("X509CertSelector.match pathToNames:\n");
Iterator<GeneralNameInterface> i =
pathToGeneralNames.iterator();
@@ -2476,10 +2462,10 @@
}
}
- GeneralSubtrees permitted = (GeneralSubtrees)
- ext.get(NameConstraintsExtension.PERMITTED_SUBTREES);
- GeneralSubtrees excluded = (GeneralSubtrees)
- ext.get(NameConstraintsExtension.EXCLUDED_SUBTREES);
+ GeneralSubtrees permitted =
+ ext.get(NameConstraintsExtension.PERMITTED_SUBTREES);
+ GeneralSubtrees excluded =
+ ext.get(NameConstraintsExtension.EXCLUDED_SUBTREES);
if (excluded != null) {
if (matchExcluded(excluded) == false) {
return false;
@@ -2597,12 +2583,13 @@
return true;
}
- private static Set<?> cloneSet(Set<?> set) {
+ @SuppressWarnings("unchecked") // Safe casts assuming clone() works correctly
+ private static <T> Set<T> cloneSet(Set<T> set) {
if (set instanceof HashSet) {
- Object clone = ((HashSet<?>)set).clone();
- return (Set<?>)clone;
+ Object clone = ((HashSet<T>)set).clone();
+ return (Set<T>)clone;
} else {
- return new HashSet<Object>(set);
+ return new HashSet<T>(set);
}
}
@@ -2617,17 +2604,13 @@
// Must clone these because addPathToName et al. modify them
if (subjectAlternativeNames != null) {
copy.subjectAlternativeNames =
- (Set<List<?>>)cloneSet(subjectAlternativeNames);
+ cloneSet(subjectAlternativeNames);
copy.subjectAlternativeGeneralNames =
- (Set<GeneralNameInterface>)cloneSet
- (subjectAlternativeGeneralNames);
+ cloneSet(subjectAlternativeGeneralNames);
}
if (pathToGeneralNames != null) {
- copy.pathToNames =
- (Set<List<?>>)cloneSet(pathToNames);
- copy.pathToGeneralNames =
- (Set<GeneralNameInterface>)cloneSet
- (pathToGeneralNames);
+ copy.pathToNames = cloneSet(pathToNames);
+ copy.pathToGeneralNames = cloneSet(pathToGeneralNames);
}
return copy;
} catch (CloneNotSupportedException e) {
--- a/jdk/src/share/classes/java/util/Locale.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/util/Locale.java Wed Jul 05 17:49:56 2017 +0200
@@ -1589,7 +1589,7 @@
* @since 1.7
*/
public String getDisplayScript() {
- return getDisplayScript(getDefault());
+ return getDisplayScript(getDefault(Category.DISPLAY));
}
/**
--- a/jdk/src/share/classes/java/util/Observable.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/util/Observable.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 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
@@ -44,7 +44,7 @@
* notifications on separate threads, or may guarantee that their
* subclass follows this order, as they choose.
* <p>
- * Note that this notification mechanism is has nothing to do with threads
+ * Note that this notification mechanism has nothing to do with threads
* and is completely separate from the <tt>wait</tt> and <tt>notify</tt>
* mechanism of class <tt>Object</tt>.
* <p>
--- a/jdk/src/share/classes/java/util/prefs/Preferences.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/util/prefs/Preferences.java Wed Jul 05 17:49:56 2017 +0200
@@ -256,11 +256,9 @@
.getContextClassLoader())
.newInstance();
} catch (Exception e) {
- InternalError error = new InternalError(
+ throw new InternalError(
"Can't instantiate Preferences factory "
- + factoryName);
- error.initCause(e);
- throw error;
+ + factoryName, e);
}
}
}
@@ -299,11 +297,9 @@
return (PreferencesFactory)
Class.forName(platformFactory, false, null).newInstance();
} catch (Exception e) {
- InternalError error = new InternalError(
+ throw new InternalError(
"Can't instantiate platform default Preferences factory "
- + platformFactory);
- error.initCause(e);
- throw error;
+ + platformFactory, e);
}
}
--- a/jdk/src/share/classes/java/util/regex/Matcher.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/java/util/regex/Matcher.java Wed Jul 05 17:49:56 2017 +0200
@@ -515,6 +515,7 @@
* @throws IllegalArgumentException
* If there is no capturing group in the pattern
* with the given name
+ * @since 1.7
*/
public String group(String name) {
if (name == null)
--- a/jdk/src/share/classes/javax/crypto/Cipher.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/crypto/Cipher.java Wed Jul 05 17:49:56 2017 +0200
@@ -28,7 +28,6 @@
import java.util.*;
import java.util.regex.*;
-import static java.util.Locale.ENGLISH;
import java.security.*;
import java.security.Provider.Service;
@@ -44,7 +43,6 @@
import sun.security.util.Debug;
import sun.security.jca.*;
-import sun.security.jca.GetInstance.Instance;
/**
* This class provides the functionality of a cryptographic cipher for
@@ -227,10 +225,10 @@
// remaining services to try in provider selection
// null once provider is selected
- private Iterator serviceIterator;
+ private Iterator<Service> serviceIterator;
// list of transform Strings to lookup in the provider
- private List transforms;
+ private List<Transform> transforms;
private final Object lock;
@@ -271,7 +269,8 @@
}
private Cipher(CipherSpi firstSpi, Service firstService,
- Iterator serviceIterator, String transformation, List transforms) {
+ Iterator<Service> serviceIterator, String transformation,
+ List<Transform> transforms) {
this.firstSpi = firstSpi;
this.firstService = firstService;
this.serviceIterator = serviceIterator;
@@ -392,11 +391,11 @@
// Map<String,Pattern> for previously compiled patterns
// XXX use ConcurrentHashMap once available
- private final static Map patternCache =
- Collections.synchronizedMap(new HashMap());
+ private final static Map<String, Pattern> patternCache =
+ Collections.synchronizedMap(new HashMap<String, Pattern>());
private static boolean matches(String regexp, String str) {
- Pattern pattern = (Pattern)patternCache.get(regexp);
+ Pattern pattern = patternCache.get(regexp);
if (pattern == null) {
pattern = Pattern.compile(regexp);
patternCache.put(regexp, pattern);
@@ -406,7 +405,7 @@
}
- private static List getTransforms(String transformation)
+ private static List<Transform> getTransforms(String transformation)
throws NoSuchAlgorithmException {
String[] parts = tokenizeTransformation(transformation);
@@ -426,7 +425,7 @@
return Collections.singletonList(tr);
} else { // if ((mode != null) && (pad != null)) {
// DES/CBC/PKCS5Padding
- List list = new ArrayList(4);
+ List<Transform> list = new ArrayList<>(4);
list.add(new Transform(alg, "/" + mode + "/" + pad, null, null));
list.add(new Transform(alg, "/" + mode, null, pad));
list.add(new Transform(alg, "//" + pad, mode, null));
@@ -436,10 +435,10 @@
}
// get the transform matching the specified service
- private static Transform getTransform(Service s, List transforms) {
+ private static Transform getTransform(Service s,
+ List<Transform> transforms) {
String alg = s.getAlgorithm().toUpperCase(Locale.ENGLISH);
- for (Iterator t = transforms.iterator(); t.hasNext(); ) {
- Transform tr = (Transform)t.next();
+ for (Transform tr : transforms) {
if (alg.endsWith(tr.suffix)) {
return tr;
}
@@ -482,19 +481,18 @@
public static final Cipher getInstance(String transformation)
throws NoSuchAlgorithmException, NoSuchPaddingException
{
- List transforms = getTransforms(transformation);
- List cipherServices = new ArrayList(transforms.size());
- for (Iterator t = transforms.iterator(); t.hasNext(); ) {
- Transform transform = (Transform)t.next();
+ List<Transform> transforms = getTransforms(transformation);
+ List<ServiceId> cipherServices = new ArrayList<>(transforms.size());
+ for (Transform transform : transforms) {
cipherServices.add(new ServiceId("Cipher", transform.transform));
}
- List services = GetInstance.getServices(cipherServices);
+ List<Service> services = GetInstance.getServices(cipherServices);
// make sure there is at least one service from a signed provider
// and that it can use the specified mode and padding
- Iterator t = services.iterator();
+ Iterator<Service> t = services.iterator();
Exception failure = null;
while (t.hasNext()) {
- Service s = (Service)t.next();
+ Service s = t.next();
if (JceSecurity.canUseProvider(s.getProvider()) == false) {
continue;
}
@@ -620,11 +618,10 @@
throw new IllegalArgumentException("Missing provider");
}
Exception failure = null;
- List transforms = getTransforms(transformation);
+ List<Transform> transforms = getTransforms(transformation);
boolean providerChecked = false;
String paddingError = null;
- for (Iterator t = transforms.iterator(); t.hasNext();) {
- Transform tr = (Transform)t.next();
+ for (Transform tr : transforms) {
Service s = provider.getService("Cipher", tr.transform);
if (s == null) {
continue;
@@ -727,7 +724,7 @@
firstService = null;
firstSpi = null;
} else {
- s = (Service)serviceIterator.next();
+ s = serviceIterator.next();
thisSpi = null;
}
if (JceSecurity.canUseProvider(s.getProvider()) == false) {
@@ -821,7 +818,7 @@
firstService = null;
firstSpi = null;
} else {
- s = (Service)serviceIterator.next();
+ s = serviceIterator.next();
thisSpi = null;
}
// if provider says it does not support this key, ignore it
@@ -1622,7 +1619,7 @@
// Check whether the cert has a key usage extension
// marked as a critical extension.
X509Certificate cert = (X509Certificate)certificate;
- Set critSet = cert.getCriticalExtensionOIDs();
+ Set<String> critSet = cert.getCriticalExtensionOIDs();
if (critSet != null && !critSet.isEmpty()
&& critSet.contains(KEY_USAGE_EXTENSION_OID)) {
--- a/jdk/src/share/classes/javax/crypto/CryptoAllPermission.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/crypto/CryptoAllPermission.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -171,8 +171,8 @@
*
* @return an enumeration of all the CryptoAllPermission objects.
*/
- public Enumeration elements() {
- Vector v = new Vector(1);
+ public Enumeration<Permission> elements() {
+ Vector<Permission> v = new Vector<>(1);
if (all_allowed) v.add(CryptoAllPermission.INSTANCE);
return v.elements();
}
--- a/jdk/src/share/classes/javax/crypto/CryptoPermission.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/crypto/CryptoPermission.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -475,14 +475,14 @@
private static final long serialVersionUID = -511215555898802763L;
- private Vector permissions;
+ private Vector<Permission> permissions;
/**
* Creates an empty CryptoPermissionCollection
* object.
*/
CryptoPermissionCollection() {
- permissions = new Vector(3);
+ permissions = new Vector<Permission>(3);
}
/**
@@ -520,7 +520,7 @@
CryptoPermission cp = (CryptoPermission)permission;
- Enumeration e = permissions.elements();
+ Enumeration<Permission> e = permissions.elements();
while (e.hasMoreElements()) {
CryptoPermission x = (CryptoPermission) e.nextElement();
@@ -538,7 +538,7 @@
* @return an enumeration of all the CryptoPermission objects.
*/
- public Enumeration elements()
+ public Enumeration<Permission> elements()
{
return permissions.elements();
}
--- a/jdk/src/share/classes/javax/crypto/CryptoPermissions.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/crypto/CryptoPermissions.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -62,14 +62,14 @@
private static final long serialVersionUID = 4946547168093391015L;
// This class is similar to java.security.Permissions
- private Hashtable perms;
+ private Hashtable<String, PermissionCollection> perms;
/**
* Creates a new CryptoPermissions object containing
* no CryptoPermissionCollections.
*/
CryptoPermissions() {
- perms = new Hashtable(7);
+ perms = new Hashtable<String, PermissionCollection>(7);
}
/**
@@ -166,7 +166,7 @@
*
* @return an enumeration of all the Permissions.
*/
- public Enumeration elements() {
+ public Enumeration<Permission> elements() {
// go through each Permissions in the hash table
// and call their elements() function.
return new PermissionsEnumerator(perms.elements());
@@ -198,8 +198,7 @@
PermissionCollection thatWildcard =
- (PermissionCollection)other.perms.get(
- CryptoPermission.ALG_NAME_WILDCARD);
+ other.perms.get(CryptoPermission.ALG_NAME_WILDCARD);
int maxKeySize = 0;
if (thatWildcard != null) {
maxKeySize = ((CryptoPermission)
@@ -208,14 +207,12 @@
// For each algorithm in this CryptoPermissions,
// find out if there is anything we should add into
// ret.
- Enumeration thisKeys = this.perms.keys();
+ Enumeration<String> thisKeys = this.perms.keys();
while (thisKeys.hasMoreElements()) {
- String alg = (String)thisKeys.nextElement();
+ String alg = thisKeys.nextElement();
- PermissionCollection thisPc =
- (PermissionCollection)this.perms.get(alg);
- PermissionCollection thatPc =
- (PermissionCollection)other.perms.get(alg);
+ PermissionCollection thisPc = this.perms.get(alg);
+ PermissionCollection thatPc = other.perms.get(alg);
CryptoPermission[] partialResult;
@@ -238,8 +235,7 @@
}
PermissionCollection thisWildcard =
- (PermissionCollection)this.perms.get(
- CryptoPermission.ALG_NAME_WILDCARD);
+ this.perms.get(CryptoPermission.ALG_NAME_WILDCARD);
// If this CryptoPermissions doesn't
// have a wildcard, we are done.
@@ -252,16 +248,15 @@
maxKeySize =
((CryptoPermission)
thisWildcard.elements().nextElement()).getMaxKeySize();
- Enumeration thatKeys = other.perms.keys();
+ Enumeration<String> thatKeys = other.perms.keys();
while (thatKeys.hasMoreElements()) {
- String alg = (String)thatKeys.nextElement();
+ String alg = thatKeys.nextElement();
if (this.perms.containsKey(alg)) {
continue;
}
- PermissionCollection thatPc =
- (PermissionCollection)other.perms.get(alg);
+ PermissionCollection thatPc = other.perms.get(alg);
CryptoPermission[] partialResult;
@@ -286,9 +281,9 @@
*/
private CryptoPermission[] getMinimum(PermissionCollection thisPc,
PermissionCollection thatPc) {
- Vector permVector = new Vector(2);
+ Vector<CryptoPermission> permVector = new Vector<>(2);
- Enumeration thisPcPermissions = thisPc.elements();
+ Enumeration<Permission> thisPcPermissions = thisPc.elements();
// For each CryptoPermission in
// thisPc object, do the following:
@@ -307,7 +302,7 @@
CryptoPermission thisCp =
(CryptoPermission)thisPcPermissions.nextElement();
- Enumeration thatPcPermissions = thatPc.elements();
+ Enumeration<Permission> thatPcPermissions = thatPc.elements();
while (thatPcPermissions.hasMoreElements()) {
CryptoPermission thatCp =
(CryptoPermission)thatPcPermissions.nextElement();
@@ -342,9 +337,9 @@
*/
private CryptoPermission[] getMinimum(int maxKeySize,
PermissionCollection pc) {
- Vector permVector = new Vector(1);
+ Vector<CryptoPermission> permVector = new Vector<>(1);
- Enumeration enum_ = pc.elements();
+ Enumeration<Permission> enum_ = pc.elements();
while (enum_.hasMoreElements()) {
CryptoPermission cp =
@@ -383,19 +378,17 @@
// If this CryptoPermissions includes CryptoAllPermission,
// we should return CryptoAllPermission.
if (perms.containsKey(CryptoAllPermission.ALG_NAME)) {
- return
- (PermissionCollection)(perms.get(CryptoAllPermission.ALG_NAME));
+ return perms.get(CryptoAllPermission.ALG_NAME);
}
- PermissionCollection pc = (PermissionCollection)perms.get(alg);
+ PermissionCollection pc = perms.get(alg);
// If there isn't a PermissionCollection for
// the given algorithm,we should return the
// PermissionCollection for the wildcard
// if there is one.
if (pc == null) {
- pc = (PermissionCollection)perms.get(
- CryptoPermission.ALG_NAME_WILDCARD);
+ pc = perms.get(CryptoPermission.ALG_NAME_WILDCARD);
}
return pc;
}
@@ -414,7 +407,7 @@
String alg = cryptoPerm.getAlgorithm();
- PermissionCollection pc = (PermissionCollection)perms.get(alg);
+ PermissionCollection pc = perms.get(alg);
if (pc == null) {
pc = cryptoPerm.newPermissionCollection();
@@ -423,14 +416,14 @@
}
}
-final class PermissionsEnumerator implements Enumeration {
+final class PermissionsEnumerator implements Enumeration<Permission> {
// all the perms
- private Enumeration perms;
+ private Enumeration<PermissionCollection> perms;
// the current set
- private Enumeration permset;
+ private Enumeration<Permission> permset;
- PermissionsEnumerator(Enumeration e) {
+ PermissionsEnumerator(Enumeration<PermissionCollection> e) {
perms = e;
permset = getNextEnumWithMore();
}
@@ -454,7 +447,7 @@
return (permset != null);
}
- public synchronized Object nextElement() {
+ public synchronized Permission nextElement() {
// hasMoreElements will update permset to the next permset
// with something in it...
@@ -466,11 +459,10 @@
}
- private Enumeration getNextEnumWithMore() {
+ private Enumeration<Permission> getNextEnumWithMore() {
while (perms.hasMoreElements()) {
- PermissionCollection pc =
- (PermissionCollection) perms.nextElement();
- Enumeration next = pc.elements();
+ PermissionCollection pc = perms.nextElement();
+ Enumeration<Permission> next = pc.elements();
if (next.hasMoreElements())
return next;
}
--- a/jdk/src/share/classes/javax/crypto/CryptoPolicyParser.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/crypto/CryptoPolicyParser.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -29,7 +29,6 @@
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Vector;
-import java.util.StringTokenizer;
import static java.util.Locale.ENGLISH;
import java.security.GeneralSecurityException;
@@ -64,7 +63,7 @@
final class CryptoPolicyParser {
- private Vector grantEntries;
+ private Vector<GrantEntry> grantEntries;
// Convenience variables for parsing
private StreamTokenizer st;
@@ -74,7 +73,7 @@
* Creates a CryptoPolicyParser object.
*/
CryptoPolicyParser() {
- grantEntries = new Vector();
+ grantEntries = new Vector<GrantEntry>();
}
/**
@@ -127,7 +126,7 @@
* The crypto jurisdiction policy must be consistent. The
* following hashtable is used for checking consistency.
*/
- Hashtable processedPermissions = null;
+ Hashtable<String, Vector<String>> processedPermissions = null;
/*
* The main parsing loop. The loop is executed once for each entry
@@ -152,7 +151,8 @@
/**
* parse a Grant entry
*/
- private GrantEntry parseGrantEntry(Hashtable processedPermissions)
+ private GrantEntry parseGrantEntry(
+ Hashtable<String, Vector<String>> processedPermissions)
throws ParsingException, IOException
{
GrantEntry e = new GrantEntry();
@@ -180,7 +180,7 @@
* parse a CryptoPermission entry
*/
private CryptoPermissionEntry parsePermissionEntry(
- Hashtable processedPermissions)
+ Hashtable<String, Vector<String>> processedPermissions)
throws ParsingException, IOException
{
CryptoPermissionEntry e = new CryptoPermissionEntry();
@@ -252,7 +252,7 @@
// AlgorithmParameterSpec class name.
String algParamSpecClassName = match("quoted string");
- Vector paramsV = new Vector(1);
+ Vector<Integer> paramsV = new Vector<>(1);
while (peek(",")) {
match(",");
if (peek("number")) {
@@ -285,14 +285,14 @@
AlgorithmParameterSpec ret = null;
try {
- Class apsClass = Class.forName(type);
- Class[] paramClasses = new Class[params.length];
+ Class<?> apsClass = Class.forName(type);
+ Class<?>[] paramClasses = new Class<?>[params.length];
for (int i = 0; i < params.length; i++) {
paramClasses[i] = int.class;
}
- Constructor c = apsClass.getConstructor(paramClasses);
+ Constructor<?> c = apsClass.getConstructor(paramClasses);
ret = (AlgorithmParameterSpec) c.newInstance((Object[]) params);
} catch (Exception e) {
throw new ParsingException("Cannot call the constructor of " +
@@ -456,15 +456,15 @@
}
CryptoPermission[] getPermissions() {
- Vector result = new Vector();
+ Vector<CryptoPermission> result = new Vector<>();
- Enumeration grantEnum = grantEntries.elements();
+ Enumeration<GrantEntry> grantEnum = grantEntries.elements();
while (grantEnum.hasMoreElements()) {
- GrantEntry ge = (GrantEntry)grantEnum.nextElement();
- Enumeration permEnum = ge.permissionElements();
+ GrantEntry ge = grantEnum.nextElement();
+ Enumeration<CryptoPermissionEntry> permEnum =
+ ge.permissionElements();
while (permEnum.hasMoreElements()) {
- CryptoPermissionEntry pe =
- (CryptoPermissionEntry)permEnum.nextElement();
+ CryptoPermissionEntry pe = permEnum.nextElement();
if (pe.cryptoPermission.equals(
"javax.crypto.CryptoAllPermission")) {
result.addElement(CryptoAllPermission.INSTANCE);
@@ -491,15 +491,14 @@
return ret;
}
- private boolean isConsistent(String alg,
- String exemptionMechanism,
- Hashtable processedPermissions) {
+ private boolean isConsistent(String alg, String exemptionMechanism,
+ Hashtable<String, Vector<String>> processedPermissions) {
String thisExemptionMechanism =
exemptionMechanism == null ? "none" : exemptionMechanism;
if (processedPermissions == null) {
- processedPermissions = new Hashtable();
- Vector exemptionMechanisms = new Vector(1);
+ processedPermissions = new Hashtable<String, Vector<String>>();
+ Vector<String> exemptionMechanisms = new Vector<>(1);
exemptionMechanisms.addElement(thisExemptionMechanism);
processedPermissions.put(alg, exemptionMechanisms);
return true;
@@ -509,15 +508,15 @@
return false;
}
- Vector exemptionMechanisms;
+ Vector<String> exemptionMechanisms;
if (processedPermissions.containsKey(alg)) {
- exemptionMechanisms = (Vector)processedPermissions.get(alg);
+ exemptionMechanisms = processedPermissions.get(alg);
if (exemptionMechanisms.contains(thisExemptionMechanism)) {
return false;
}
} else {
- exemptionMechanisms = new Vector(1);
+ exemptionMechanisms = new Vector<String>(1);
}
exemptionMechanisms.addElement(thisExemptionMechanism);
@@ -556,10 +555,10 @@
private static class GrantEntry {
- private Vector permissionEntries;
+ private Vector<CryptoPermissionEntry> permissionEntries;
GrantEntry() {
- permissionEntries = new Vector();
+ permissionEntries = new Vector<CryptoPermissionEntry>();
}
void add(CryptoPermissionEntry pe)
@@ -580,7 +579,7 @@
/**
* Enumerate all the permission entries in this GrantEntry.
*/
- Enumeration permissionElements(){
+ Enumeration<CryptoPermissionEntry> permissionElements(){
return permissionEntries.elements();
}
--- a/jdk/src/share/classes/javax/crypto/EncryptedPrivateKeyInfo.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/crypto/EncryptedPrivateKeyInfo.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -80,7 +80,7 @@
throw new NullPointerException("the encoded parameter " +
"must be non-null");
}
- this.encoded = (byte[])encoded.clone();
+ this.encoded = encoded.clone();
DerValue val = new DerValue(this.encoded);
DerValue[] seq = new DerValue[2];
@@ -143,7 +143,7 @@
throw new IllegalArgumentException("the encryptedData " +
"parameter must not be empty");
} else {
- this.encryptedData = (byte[])encryptedData.clone();
+ this.encryptedData = encryptedData.clone();
}
// delay the generation of ASN.1 encoding until
// getEncoded() is called
@@ -183,7 +183,7 @@
throw new IllegalArgumentException("the encryptedData " +
"parameter must not be empty");
} else {
- this.encryptedData = (byte[])encryptedData.clone();
+ this.encryptedData = encryptedData.clone();
}
// delay the generation of ASN.1 encoding until
@@ -222,7 +222,7 @@
* each time this method is called.
*/
public byte[] getEncryptedData() {
- return (byte[])this.encryptedData.clone();
+ return this.encryptedData.clone();
}
/**
@@ -247,26 +247,13 @@
throws InvalidKeySpecException {
byte[] encoded = null;
try {
- encoded = cipher.doFinal((byte[])encryptedData);
+ encoded = cipher.doFinal(encryptedData);
checkPKCS8Encoding(encoded);
- } catch (GeneralSecurityException gse) {
- InvalidKeySpecException ikse = new
- InvalidKeySpecException(
- "Cannot retrieve the PKCS8EncodedKeySpec");
- ikse.initCause(gse);
- throw ikse;
- } catch (IOException ioe) {
- InvalidKeySpecException ikse = new
- InvalidKeySpecException(
- "Cannot retrieve the PKCS8EncodedKeySpec");
- ikse.initCause(ioe);
- throw ikse;
- } catch (IllegalStateException ise) {
- InvalidKeySpecException ikse = new
- InvalidKeySpecException(
- "Cannot retrieve the PKCS8EncodedKeySpec");
- ikse.initCause(ise);
- throw ikse;
+ } catch (GeneralSecurityException |
+ IOException |
+ IllegalStateException ex) {
+ throw new InvalidKeySpecException(
+ "Cannot retrieve the PKCS8EncodedKeySpec", ex);
}
return new PKCS8EncodedKeySpec(encoded);
}
@@ -289,16 +276,9 @@
} catch (NoSuchAlgorithmException nsae) {
// rethrow
throw nsae;
- } catch (GeneralSecurityException gse) {
- InvalidKeyException ike = new InvalidKeyException
- ("Cannot retrieve the PKCS8EncodedKeySpec");
- ike.initCause(gse);
- throw ike;
- } catch (IOException ioe) {
- InvalidKeyException ike = new InvalidKeyException
- ("Cannot retrieve the PKCS8EncodedKeySpec");
- ike.initCause(ioe);
- throw ike;
+ } catch (GeneralSecurityException | IOException ex) {
+ throw new InvalidKeyException(
+ "Cannot retrieve the PKCS8EncodedKeySpec", ex);
}
return new PKCS8EncodedKeySpec(encoded);
}
@@ -413,7 +393,7 @@
out.write(DerValue.tag_Sequence, tmp);
this.encoded = out.toByteArray();
}
- return (byte[])this.encoded.clone();
+ return this.encoded.clone();
}
private static void checkTag(DerValue val, byte tag, String valName)
@@ -424,6 +404,7 @@
}
}
+ @SuppressWarnings("fallthrough")
private static void checkPKCS8Encoding(byte[] encodedKey)
throws IOException {
DerInputStream in = new DerInputStream(encodedKey);
@@ -432,6 +413,7 @@
switch (values.length) {
case 4:
checkTag(values[3], DerValue.TAG_CONTEXT, "attributes");
+ /* fall through */
case 3:
checkTag(values[0], DerValue.tag_Integer, "version");
DerInputStream algid = values[1].toDerInputStream();
--- a/jdk/src/share/classes/javax/crypto/JarVerifier.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/crypto/JarVerifier.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -86,23 +86,19 @@
// Get a link to the Jarfile to search.
try {
- jf = (JarFile)
- AccessController.doPrivileged(
- new PrivilegedExceptionAction() {
- public Object run() throws Exception {
- JarURLConnection conn =
- (JarURLConnection) url.openConnection();
- // You could do some caching here as
- // an optimization.
- conn.setUseCaches(false);
- return conn.getJarFile();
- }
- });
+ jf = AccessController.doPrivileged(
+ new PrivilegedExceptionAction<JarFile>() {
+ public JarFile run() throws Exception {
+ JarURLConnection conn =
+ (JarURLConnection) url.openConnection();
+ // You could do some caching here as
+ // an optimization.
+ conn.setUseCaches(false);
+ return conn.getJarFile();
+ }
+ });
} catch (java.security.PrivilegedActionException pae) {
- SecurityException se = new SecurityException(
- "Cannot load " + url.toString());
- se.initCause(pae);
- throw se;
+ throw new SecurityException("Cannot load " + url.toString(), pae);
}
if (jf != null) {
--- a/jdk/src/share/classes/javax/crypto/JceSecurity.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/crypto/JceSecurity.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -57,10 +57,12 @@
// Map<Provider,?> of the providers we already have verified
// value == PROVIDER_VERIFIED is successfully verified
// value is failure cause Exception in error case
- private final static Map verificationResults = new IdentityHashMap();
+ private final static Map<Provider, Object> verificationResults =
+ new IdentityHashMap<>();
// Map<Provider,?> of the providers currently being verified
- private final static Map verifyingProviders = new IdentityHashMap();
+ private final static Map<Provider, Object> verifyingProviders =
+ new IdentityHashMap<>();
// Set the default value. May be changed in the static initializer.
private static boolean isRestricted = true;
@@ -73,25 +75,23 @@
static {
try {
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws Exception {
- setupJurisdictionPolicies();
- return null;
- }
- });
+ AccessController.doPrivileged(
+ new PrivilegedExceptionAction<Object>() {
+ public Object run() throws Exception {
+ setupJurisdictionPolicies();
+ return null;
+ }
+ });
isRestricted = defaultPolicy.implies(
CryptoAllPermission.INSTANCE) ? false : true;
} catch (Exception e) {
- SecurityException se =
- new SecurityException(
- "Can not initialize cryptographic mechanism");
- se.initCause(e);
- throw se;
+ throw new SecurityException(
+ "Can not initialize cryptographic mechanism", e);
}
}
- static Instance getInstance(String type, Class clazz, String algorithm,
+ static Instance getInstance(String type, Class<?> clazz, String algorithm,
String provider) throws NoSuchAlgorithmException,
NoSuchProviderException {
Service s = GetInstance.getService(type, algorithm, provider);
@@ -104,7 +104,7 @@
return GetInstance.getInstance(s, clazz);
}
- static Instance getInstance(String type, Class clazz, String algorithm,
+ static Instance getInstance(String type, Class<?> clazz, String algorithm,
Provider provider) throws NoSuchAlgorithmException {
Service s = GetInstance.getService(type, algorithm, provider);
Exception ve = JceSecurity.getVerificationResult(provider);
@@ -116,12 +116,11 @@
return GetInstance.getInstance(s, clazz);
}
- static Instance getInstance(String type, Class clazz, String algorithm)
+ static Instance getInstance(String type, Class<?> clazz, String algorithm)
throws NoSuchAlgorithmException {
- List services = GetInstance.getServices(type, algorithm);
+ List<Service> services = GetInstance.getServices(type, algorithm);
NoSuchAlgorithmException failure = null;
- for (Iterator t = services.iterator(); t.hasNext(); ) {
- Service s = (Service)t.next();
+ for (Service s : services) {
if (canUseProvider(s.getProvider()) == false) {
// allow only signed providers
continue;
@@ -213,16 +212,17 @@
}
// reference to a Map we use as a cache for codebases
- private static final Map codeBaseCacheRef = new WeakHashMap();
+ private static final Map<Class<?>, URL> codeBaseCacheRef =
+ new WeakHashMap<>();
/*
* Retuns the CodeBase for the given class.
*/
- static URL getCodeBase(final Class clazz) {
- URL url = (URL)codeBaseCacheRef.get(clazz);
+ static URL getCodeBase(final Class<?> clazz) {
+ URL url = codeBaseCacheRef.get(clazz);
if (url == null) {
- url = (URL)AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
+ url = AccessController.doPrivileged(new PrivilegedAction<URL>() {
+ public URL run() {
ProtectionDomain pd = clazz.getProtectionDomain();
if (pd != null) {
CodeSource cs = pd.getCodeSource();
@@ -290,9 +290,9 @@
JarFile jf = new JarFile(jarPathName);
- Enumeration entries = jf.entries();
+ Enumeration<JarEntry> entries = jf.entries();
while (entries.hasMoreElements()) {
- JarEntry je = (JarEntry)entries.nextElement();
+ JarEntry je = entries.nextElement();
InputStream is = null;
try {
if (je.getName().startsWith("default_")) {
--- a/jdk/src/share/classes/javax/crypto/JceSecurityManager.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/crypto/JceSecurityManager.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -28,7 +28,6 @@
import java.security.*;
import java.net.*;
import java.util.*;
-import java.util.jar.*;
/**
* The JCE security manager.
@@ -50,8 +49,10 @@
private static final CryptoPermissions defaultPolicy;
private static final CryptoPermissions exemptPolicy;
private static final CryptoAllPermission allPerm;
- private static final Vector TrustedCallersCache = new Vector(2);
- private static final Map exemptCache = new HashMap();
+ private static final Vector<Class<?>> TrustedCallersCache =
+ new Vector<>(2);
+ private static final Map<URL, CryptoPermissions> exemptCache =
+ new HashMap<>();
// singleton instance
static final JceSecurityManager INSTANCE;
@@ -60,12 +61,12 @@
defaultPolicy = JceSecurity.getDefaultPolicy();
exemptPolicy = JceSecurity.getExemptPolicy();
allPerm = CryptoAllPermission.INSTANCE;
- INSTANCE = (JceSecurityManager)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return new JceSecurityManager();
- }
- });
+ INSTANCE = AccessController.doPrivileged(
+ new PrivilegedAction<JceSecurityManager>() {
+ public JceSecurityManager run() {
+ return new JceSecurityManager();
+ }
+ });
}
private JceSecurityManager() {
@@ -94,11 +95,11 @@
// javax.crypto.* packages.
// NOTE: javax.crypto.* package maybe subject to package
// insertion, so need to check its classloader as well.
- Class[] context = getClassContext();
+ Class<?>[] context = getClassContext();
URL callerCodeBase = null;
int i;
for (i=0; i<context.length; i++) {
- Class cls = context[i];
+ Class<?> cls = context[i];
callerCodeBase = JceSecurity.getCodeBase(cls);
if (callerCodeBase != null) {
break;
@@ -119,7 +120,7 @@
CryptoPermissions appPerms;
synchronized (this.getClass()) {
if (exemptCache.containsKey(callerCodeBase)) {
- appPerms = (CryptoPermissions)exemptCache.get(callerCodeBase);
+ appPerms = exemptCache.get(callerCodeBase);
} else {
appPerms = getAppPermissions(callerCodeBase);
exemptCache.put(callerCodeBase, appPerms);
@@ -143,7 +144,7 @@
if (appPc == null) {
return defaultPerm;
}
- Enumeration enum_ = appPc.elements();
+ Enumeration<Permission> enum_ = appPc.elements();
while (enum_.hasMoreElements()) {
CryptoPermission cp = (CryptoPermission)enum_.nextElement();
if (cp.getExemptionMechanism() == null) {
@@ -215,7 +216,7 @@
* Returns the default permission for the given algorithm.
*/
private CryptoPermission getDefaultPermission(String alg) {
- Enumeration enum_ =
+ Enumeration<Permission> enum_ =
defaultPolicy.getPermissionCollection(alg).elements();
return (CryptoPermission)enum_.nextElement();
}
--- a/jdk/src/share/classes/javax/crypto/KeyAgreement.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/crypto/KeyAgreement.java Wed Jul 05 17:49:56 2017 +0200
@@ -93,7 +93,7 @@
// remaining services to try in provider selection
// null once provider is selected
- private Iterator serviceIterator;
+ private Iterator<Service> serviceIterator;
private final Object lock;
@@ -112,7 +112,7 @@
lock = null;
}
- private KeyAgreement(Service s, Iterator t, String algorithm) {
+ private KeyAgreement(Service s, Iterator<Service> t, String algorithm) {
firstService = s;
serviceIterator = t;
this.algorithm = algorithm;
@@ -165,11 +165,12 @@
*/
public static final KeyAgreement getInstance(String algorithm)
throws NoSuchAlgorithmException {
- List services = GetInstance.getServices("KeyAgreement", algorithm);
+ List<Service> services =
+ GetInstance.getServices("KeyAgreement", algorithm);
// make sure there is at least one service from a signed provider
- Iterator t = services.iterator();
+ Iterator<Service> t = services.iterator();
while (t.hasNext()) {
- Service s = (Service)t.next();
+ Service s = t.next();
if (JceSecurity.canUseProvider(s.getProvider()) == false) {
continue;
}
@@ -301,7 +302,7 @@
s = firstService;
firstService = null;
} else {
- s = (Service)serviceIterator.next();
+ s = serviceIterator.next();
}
if (JceSecurity.canUseProvider(s.getProvider()) == false) {
continue;
@@ -358,7 +359,7 @@
s = firstService;
firstService = null;
} else {
- s = (Service)serviceIterator.next();
+ s = serviceIterator.next();
}
// if provider says it does not support this key, ignore it
if (s.supportsParameter(key) == false) {
--- a/jdk/src/share/classes/javax/crypto/KeyGenerator.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/crypto/KeyGenerator.java Wed Jul 05 17:49:56 2017 +0200
@@ -127,7 +127,7 @@
private final Object lock = new Object();
- private Iterator serviceIterator;
+ private Iterator<Service> serviceIterator;
private int initType;
private int initKeySize;
@@ -150,7 +150,8 @@
private KeyGenerator(String algorithm) throws NoSuchAlgorithmException {
this.algorithm = algorithm;
- List list = GetInstance.getServices("KeyGenerator", algorithm);
+ List<Service> list =
+ GetInstance.getServices("KeyGenerator", algorithm);
serviceIterator = list.iterator();
initType = I_NONE;
// fetch and instantiate initial spi
@@ -320,7 +321,7 @@
return null;
}
while (serviceIterator.hasNext()) {
- Service s = (Service)serviceIterator.next();
+ Service s = serviceIterator.next();
if (JceSecurity.canUseProvider(s.getProvider()) == false) {
continue;
}
--- a/jdk/src/share/classes/javax/crypto/Mac.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/crypto/Mac.java Wed Jul 05 17:49:56 2017 +0200
@@ -95,7 +95,7 @@
// remaining services to try in provider selection
// null once provider is selected
- private Iterator serviceIterator;
+ private Iterator<Service> serviceIterator;
private final Object lock;
@@ -114,7 +114,7 @@
lock = null;
}
- private Mac(Service s, Iterator t, String algorithm) {
+ private Mac(Service s, Iterator<Service> t, String algorithm) {
firstService = s;
serviceIterator = t;
this.algorithm = algorithm;
@@ -163,11 +163,11 @@
*/
public static final Mac getInstance(String algorithm)
throws NoSuchAlgorithmException {
- List services = GetInstance.getServices("Mac", algorithm);
+ List<Service> services = GetInstance.getServices("Mac", algorithm);
// make sure there is at least one service from a signed provider
- Iterator t = services.iterator();
+ Iterator<Service> t = services.iterator();
while (t.hasNext()) {
- Service s = (Service)t.next();
+ Service s = t.next();
if (JceSecurity.canUseProvider(s.getProvider()) == false) {
continue;
}
@@ -288,7 +288,7 @@
s = firstService;
firstService = null;
} else {
- s = (Service)serviceIterator.next();
+ s = serviceIterator.next();
}
if (JceSecurity.canUseProvider(s.getProvider()) == false) {
continue;
@@ -331,7 +331,7 @@
s = firstService;
firstService = null;
} else {
- s = (Service)serviceIterator.next();
+ s = serviceIterator.next();
}
// if provider says it does not support this key, ignore it
if (s.supportsParameter(key) == false) {
--- a/jdk/src/share/classes/javax/crypto/SealedObject.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/crypto/SealedObject.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -193,11 +193,11 @@
* @exception NullPointerException if the given sealed object is null.
*/
protected SealedObject(SealedObject so) {
- this.encryptedContent = (byte[]) so.encryptedContent.clone();
+ this.encryptedContent = so.encryptedContent.clone();
this.sealAlg = so.sealAlg;
this.paramsAlg = so.paramsAlg;
if (so.encodedParams != null) {
- this.encodedParams = (byte[]) so.encodedParams.clone();
+ this.encodedParams = so.encodedParams.clone();
} else {
this.encodedParams = null;
}
@@ -353,10 +353,8 @@
try {
return unseal(key, provider);
- } catch (IllegalBlockSizeException ibse) {
- throw new InvalidKeyException(ibse.getMessage());
- } catch (BadPaddingException bpe) {
- throw new InvalidKeyException(bpe.getMessage());
+ } catch (IllegalBlockSizeException | BadPaddingException ex) {
+ throw new InvalidKeyException(ex.getMessage());
}
}
@@ -450,9 +448,9 @@
{
s.defaultReadObject();
if (encryptedContent != null)
- encryptedContent = (byte[])encryptedContent.clone();
+ encryptedContent = encryptedContent.clone();
if (encodedParams != null)
- encodedParams = (byte[])encodedParams.clone();
+ encodedParams = encodedParams.clone();
}
}
@@ -465,7 +463,7 @@
super(in);
}
- protected Class resolveClass(ObjectStreamClass v)
+ protected Class<?> resolveClass(ObjectStreamClass v)
throws IOException, ClassNotFoundException
{
--- a/jdk/src/share/classes/javax/crypto/SecretKeyFactory.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/crypto/SecretKeyFactory.java Wed Jul 05 17:49:56 2017 +0200
@@ -96,7 +96,7 @@
// remaining services to try in provider selection
// null once provider is selected
- private Iterator serviceIterator;
+ private Iterator<Service> serviceIterator;
/**
* Creates a SecretKeyFactory object.
@@ -114,7 +114,8 @@
private SecretKeyFactory(String algorithm) throws NoSuchAlgorithmException {
this.algorithm = algorithm;
- List list = GetInstance.getServices("SecretKeyFactory", algorithm);
+ List<Service> list =
+ GetInstance.getServices("SecretKeyFactory", algorithm);
serviceIterator = list.iterator();
// fetch and instantiate initial spi
if (nextSpi(null) == null) {
@@ -290,7 +291,7 @@
return null;
}
while (serviceIterator.hasNext()) {
- Service s = (Service)serviceIterator.next();
+ Service s = serviceIterator.next();
if (JceSecurity.canUseProvider(s.getProvider()) == false) {
continue;
}
@@ -367,7 +368,7 @@
* (e.g., the given key has an algorithm or format not supported by this
* secret-key factory).
*/
- public final KeySpec getKeySpec(SecretKey key, Class keySpec)
+ public final KeySpec getKeySpec(SecretKey key, Class<?> keySpec)
throws InvalidKeySpecException {
if (serviceIterator == null) {
return spi.engineGetKeySpec(key, keySpec);
--- a/jdk/src/share/classes/javax/crypto/SecretKeyFactorySpi.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/crypto/SecretKeyFactorySpi.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -88,7 +88,7 @@
* (e.g., the given key has an algorithm or format not supported by this
* secret-key factory).
*/
- protected abstract KeySpec engineGetKeySpec(SecretKey key, Class keySpec)
+ protected abstract KeySpec engineGetKeySpec(SecretKey key, Class<?> keySpec)
throws InvalidKeySpecException;
/**
--- a/jdk/src/share/classes/javax/crypto/spec/DESKeySpec.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/crypto/spec/DESKeySpec.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -165,7 +165,7 @@
* each time this method is called.
*/
public byte[] getKey() {
- return (byte[])this.key.clone();
+ return this.key.clone();
}
/**
--- a/jdk/src/share/classes/javax/crypto/spec/DESedeKeySpec.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/crypto/spec/DESedeKeySpec.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -95,7 +95,7 @@
* each time this method is called.
*/
public byte[] getKey() {
- return (byte[])this.key.clone();
+ return this.key.clone();
}
/**
--- a/jdk/src/share/classes/javax/crypto/spec/IvParameterSpec.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/crypto/spec/IvParameterSpec.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -94,6 +94,6 @@
* each time this method is called.
*/
public byte[] getIV() {
- return (byte[])this.iv.clone();
+ return this.iv.clone();
}
}
--- a/jdk/src/share/classes/javax/crypto/spec/PBEKeySpec.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/crypto/spec/PBEKeySpec.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -80,7 +80,7 @@
if ((password == null) || (password.length == 0)) {
this.password = new char[0];
} else {
- this.password = (char[])password.clone();
+ this.password = password.clone();
}
}
@@ -109,7 +109,7 @@
if ((password == null) || (password.length == 0)) {
this.password = new char[0];
} else {
- this.password = (char[])password.clone();
+ this.password = password.clone();
}
if (salt == null) {
throw new NullPointerException("the salt parameter " +
@@ -118,7 +118,7 @@
throw new IllegalArgumentException("the salt parameter " +
"must not be empty");
} else {
- this.salt = (byte[]) salt.clone();
+ this.salt = salt.clone();
}
if (iterationCount<=0) {
throw new IllegalArgumentException("invalid iterationCount value");
@@ -151,7 +151,7 @@
if ((password == null) || (password.length == 0)) {
this.password = new char[0];
} else {
- this.password = (char[])password.clone();
+ this.password = password.clone();
}
if (salt == null) {
throw new NullPointerException("the salt parameter " +
@@ -160,7 +160,7 @@
throw new IllegalArgumentException("the salt parameter " +
"must not be empty");
} else {
- this.salt = (byte[]) salt.clone();
+ this.salt = salt.clone();
}
if (iterationCount<=0) {
throw new IllegalArgumentException("invalid iterationCount value");
@@ -196,7 +196,7 @@
if (password == null) {
throw new IllegalStateException("password has been cleared");
}
- return (char[]) password.clone();
+ return password.clone();
}
/**
@@ -210,7 +210,7 @@
*/
public final byte[] getSalt() {
if (salt != null) {
- return (byte[]) salt.clone();
+ return salt.clone();
} else {
return null;
}
--- a/jdk/src/share/classes/javax/crypto/spec/PBEParameterSpec.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/crypto/spec/PBEParameterSpec.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -25,7 +25,6 @@
package javax.crypto.spec;
-import java.math.BigInteger;
import java.security.spec.AlgorithmParameterSpec;
/**
@@ -53,7 +52,7 @@
* @exception NullPointerException if <code>salt</code> is null.
*/
public PBEParameterSpec(byte[] salt, int iterationCount) {
- this.salt = (byte[])salt.clone();
+ this.salt = salt.clone();
this.iterationCount = iterationCount;
}
@@ -64,7 +63,7 @@
* each time this method is called.
*/
public byte[] getSalt() {
- return (byte[])this.salt.clone();
+ return this.salt.clone();
}
/**
--- a/jdk/src/share/classes/javax/crypto/spec/PSource.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/crypto/spec/PSource.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -25,9 +25,6 @@
package javax.crypto.spec;
-import java.math.BigInteger;
-import java.security.spec.AlgorithmParameterSpec;
-
/**
* This class specifies the source for encoding input P in OAEP Padding,
* as defined in the
@@ -97,7 +94,7 @@
*/
public PSpecified(byte[] p) {
super("PSpecified");
- this.p = (byte[]) p.clone();
+ this.p = p.clone();
}
/**
* Returns the value of encoding input P.
@@ -105,7 +102,7 @@
* returned each time this method is called.
*/
public byte[] getValue() {
- return (p.length==0? p: (byte[])p.clone());
+ return (p.length==0? p: p.clone());
}
}
}
--- a/jdk/src/share/classes/javax/crypto/spec/RC2ParameterSpec.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/crypto/spec/RC2ParameterSpec.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -117,7 +117,7 @@
* Returns a new array each time this method is called.
*/
public byte[] getIV() {
- return (iv == null? null:(byte[])iv.clone());
+ return (iv == null? null:iv.clone());
}
/**
--- a/jdk/src/share/classes/javax/crypto/spec/RC5ParameterSpec.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/crypto/spec/RC5ParameterSpec.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -157,7 +157,7 @@
* Returns a new array each time this method is called.
*/
public byte[] getIV() {
- return (iv == null? null:(byte[])iv.clone());
+ return (iv == null? null:iv.clone());
}
/**
--- a/jdk/src/share/classes/javax/crypto/spec/SecretKeySpec.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/crypto/spec/SecretKeySpec.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -25,8 +25,6 @@
package javax.crypto.spec;
-import java.io.UnsupportedEncodingException;
-import java.security.Key;
import java.security.spec.KeySpec;
import javax.crypto.SecretKey;
@@ -95,7 +93,7 @@
if (key.length == 0) {
throw new IllegalArgumentException("Empty key");
}
- this.key = (byte[])key.clone();
+ this.key = key.clone();
this.algorithm = algorithm;
}
@@ -181,7 +179,7 @@
* each time this method is called.
*/
public byte[] getEncoded() {
- return (byte[])this.key.clone();
+ return this.key.clone();
}
/**
--- a/jdk/src/share/classes/javax/naming/CompositeName.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/naming/CompositeName.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -394,7 +394,7 @@
* If posn is outside the specified range.
*/
public Name getPrefix(int posn) {
- Enumeration comps = impl.getPrefix(posn);
+ Enumeration<String> comps = impl.getPrefix(posn);
return (new CompositeName(comps));
}
@@ -412,7 +412,7 @@
* If posn is outside the specified range.
*/
public Name getSuffix(int posn) {
- Enumeration comps = impl.getSuffix(posn);
+ Enumeration<String> comps = impl.getSuffix(posn);
return (new CompositeName(comps));
}
@@ -563,7 +563,7 @@
private void writeObject(java.io.ObjectOutputStream s)
throws java.io.IOException {
s.writeInt(size());
- Enumeration comps = getAll();
+ Enumeration<String> comps = getAll();
while (comps.hasMoreElements()) {
s.writeObject(comps.nextElement());
}
--- a/jdk/src/share/classes/javax/naming/CompoundName.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/naming/CompoundName.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -376,7 +376,7 @@
* If posn is outside the specified range.
*/
public Name getPrefix(int posn) {
- Enumeration comps = impl.getPrefix(posn);
+ Enumeration<String> comps = impl.getPrefix(posn);
return (new CompoundName(comps, mySyntax));
}
@@ -396,7 +396,7 @@
* If posn is outside the specified range.
*/
public Name getSuffix(int posn) {
- Enumeration comps = impl.getSuffix(posn);
+ Enumeration<String> comps = impl.getSuffix(posn);
return (new CompoundName(comps, mySyntax));
}
@@ -557,7 +557,7 @@
throws java.io.IOException {
s.writeObject(mySyntax);
s.writeInt(size());
- Enumeration comps = getAll();
+ Enumeration<String> comps = getAll();
while (comps.hasMoreElements()) {
s.writeObject(comps.nextElement());
}
--- a/jdk/src/share/classes/javax/naming/InitialContext.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/naming/InitialContext.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -232,10 +232,12 @@
* @see #InitialContext(boolean)
* @since 1.3
*/
+ @SuppressWarnings("unchecked")
protected void init(Hashtable<?,?> environment)
throws NamingException
{
- myProps = ResourceManager.getInitialEnvironment(environment);
+ myProps = (Hashtable<Object,Object>)
+ ResourceManager.getInitialEnvironment(environment);
if (myProps.get(Context.INITIAL_CONTEXT_FACTORY) != null) {
// user has specified initial context factory; try to get it
@@ -265,6 +267,7 @@
* @see #lookup(Name)
* @since 1.6
*/
+ @SuppressWarnings("unchecked")
public static <T> T doLookup(Name name)
throws NamingException {
return (T) (new InitialContext()).lookup(name);
@@ -279,6 +282,7 @@
* @throws NamingException if a naming exception is encountered
* @since 1.6
*/
+ @SuppressWarnings("unchecked")
public static <T> T doLookup(String name)
throws NamingException {
return (T) (new InitialContext()).lookup(name);
--- a/jdk/src/share/classes/javax/naming/NameImpl.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/naming/NameImpl.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -25,6 +25,7 @@
package javax.naming;
+import java.util.Locale;
import java.util.Vector;
import java.util.Enumeration;
import java.util.Properties;
@@ -45,7 +46,7 @@
private static final byte RIGHT_TO_LEFT = 2;
private static final byte FLAT = 0;
- private Vector components;
+ private Vector<String> components;
private byte syntaxDirection = LEFT_TO_RIGHT;
private String syntaxSeparator = "/";
@@ -97,7 +98,7 @@
return (i);
}
- private final int extractComp(String name, int i, int len, Vector comps)
+ private final int extractComp(String name, int i, int len, Vector<String> comps)
throws InvalidNameException {
String beginQuote;
String endQuote;
@@ -216,7 +217,8 @@
}
private static boolean toBoolean(String name) {
- return ((name != null) && name.toLowerCase().equals("true"));
+ return ((name != null) &&
+ name.toLowerCase(Locale.ENGLISH).equals("true"));
}
private final void recordNamingConvention(Properties p) {
@@ -270,7 +272,7 @@
if (syntax != null) {
recordNamingConvention(syntax);
}
- components = new Vector();
+ components = new Vector<>();
}
NameImpl(Properties syntax, String n) throws InvalidNameException {
@@ -284,8 +286,8 @@
i = extractComp(n, i, len, components);
String comp = rToL
- ? (String)components.firstElement()
- : (String)components.lastElement();
+ ? components.firstElement()
+ : components.lastElement();
if (comp.length() >= 1) {
compsAllEmpty = false;
}
@@ -304,7 +306,7 @@
}
}
- NameImpl(Properties syntax, Enumeration comps) {
+ NameImpl(Properties syntax, Enumeration<String> comps) {
this(syntax);
// %% comps could shrink in the middle.
@@ -455,9 +457,9 @@
for (int i = 0; i < size; i++) {
if (syntaxDirection == RIGHT_TO_LEFT) {
comp =
- stringifyComp((String) components.elementAt(size - 1 - i));
+ stringifyComp(components.elementAt(size - 1 - i));
} else {
- comp = stringifyComp((String) components.elementAt(i));
+ comp = stringifyComp(components.elementAt(i));
}
if ((i != 0) && (syntaxSeparator != null))
answer.append(syntaxSeparator);
@@ -474,12 +476,12 @@
if ((obj != null) && (obj instanceof NameImpl)) {
NameImpl target = (NameImpl)obj;
if (target.size() == this.size()) {
- Enumeration mycomps = getAll();
- Enumeration comps = target.getAll();
+ Enumeration<String> mycomps = getAll();
+ Enumeration<String> comps = target.getAll();
while (mycomps.hasMoreElements()) {
// %% comps could shrink in the middle.
- String my = (String)mycomps.nextElement();
- String his = (String)comps.nextElement();
+ String my = mycomps.nextElement();
+ String his = comps.nextElement();
if (syntaxTrimBlanks) {
my = my.trim();
his = his.trim();
@@ -526,11 +528,14 @@
comp1 = comp1.trim();
comp2 = comp2.trim();
}
+
+ int local;
if (syntaxCaseInsensitive) {
- comp1 = comp1.toLowerCase();
- comp2 = comp2.toLowerCase();
+ local = comp1.compareToIgnoreCase(comp2);
+ } else {
+ local = comp1.compareTo(comp2);
}
- int local = comp1.compareTo(comp2);
+
if (local != 0) {
return local;
}
@@ -543,22 +548,22 @@
return (components.size());
}
- public Enumeration getAll() {
+ public Enumeration<String> getAll() {
return components.elements();
}
public String get(int posn) {
- return ((String) components.elementAt(posn));
+ return components.elementAt(posn);
}
- public Enumeration getPrefix(int posn) {
+ public Enumeration<String> getPrefix(int posn) {
if (posn < 0 || posn > size()) {
throw new ArrayIndexOutOfBoundsException(posn);
}
return new NameImplEnumerator(components, 0, posn);
}
- public Enumeration getSuffix(int posn) {
+ public Enumeration<String> getSuffix(int posn) {
int cnt = size();
if (posn < 0 || posn > cnt) {
throw new ArrayIndexOutOfBoundsException(posn);
@@ -570,15 +575,15 @@
return (components.isEmpty());
}
- public boolean startsWith(int posn, Enumeration prefix) {
+ public boolean startsWith(int posn, Enumeration<String> prefix) {
if (posn < 0 || posn > size()) {
return false;
}
try {
- Enumeration mycomps = getPrefix(posn);
+ Enumeration<String> mycomps = getPrefix(posn);
while (mycomps.hasMoreElements()) {
- String my = (String)mycomps.nextElement();
- String his = (String)prefix.nextElement();
+ String my = mycomps.nextElement();
+ String his = prefix.nextElement();
if (syntaxTrimBlanks) {
my = my.trim();
his = his.trim();
@@ -597,7 +602,7 @@
return true;
}
- public boolean endsWith(int posn, Enumeration suffix) {
+ public boolean endsWith(int posn, Enumeration<String> suffix) {
// posn is number of elements in suffix
// startIndex is the starting position in this name
// at which to start the comparison. It is calculated by
@@ -607,10 +612,10 @@
return false;
}
try {
- Enumeration mycomps = getSuffix(startIndex);
+ Enumeration<String> mycomps = getSuffix(startIndex);
while (mycomps.hasMoreElements()) {
- String my = (String)mycomps.nextElement();
- String his = (String)suffix.nextElement();
+ String my = mycomps.nextElement();
+ String his = suffix.nextElement();
if (syntaxTrimBlanks) {
my = my.trim();
his = his.trim();
@@ -629,11 +634,11 @@
return true;
}
- public boolean addAll(Enumeration comps) throws InvalidNameException {
+ public boolean addAll(Enumeration<String> comps) throws InvalidNameException {
boolean added = false;
while (comps.hasMoreElements()) {
try {
- Object comp = comps.nextElement();
+ String comp = comps.nextElement();
if (size() > 0 && syntaxDirection == FLAT) {
throw new InvalidNameException(
"A flat name can only have a single component");
@@ -647,12 +652,12 @@
return added;
}
- public boolean addAll(int posn, Enumeration comps)
+ public boolean addAll(int posn, Enumeration<String> comps)
throws InvalidNameException {
boolean added = false;
for (int i = posn; comps.hasMoreElements(); i++) {
try {
- Object comp = comps.nextElement();
+ String comp = comps.nextElement();
if (size() > 0 && syntaxDirection == FLAT) {
throw new InvalidNameException(
"A flat name can only have a single component");
@@ -690,13 +695,13 @@
public int hashCode() {
int hash = 0;
- for (Enumeration e = getAll(); e.hasMoreElements();) {
- String comp = (String)e.nextElement();
+ for (Enumeration<String> e = getAll(); e.hasMoreElements();) {
+ String comp = e.nextElement();
if (syntaxTrimBlanks) {
comp = comp.trim();
}
if (syntaxCaseInsensitive) {
- comp = comp.toLowerCase();
+ comp = comp.toLowerCase(Locale.ENGLISH);
}
hash += comp.hashCode();
@@ -706,12 +711,12 @@
}
final
-class NameImplEnumerator implements Enumeration {
- Vector vector;
+class NameImplEnumerator implements Enumeration<String> {
+ Vector<String> vector;
int count;
int limit;
- NameImplEnumerator(Vector v, int start, int lim) {
+ NameImplEnumerator(Vector<String> v, int start, int lim) {
vector = v;
count = start;
limit = lim;
@@ -721,7 +726,7 @@
return count < limit;
}
- public Object nextElement() {
+ public String nextElement() {
if (count < limit) {
return vector.elementAt(count++);
}
--- a/jdk/src/share/classes/javax/naming/Reference.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/naming/Reference.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -120,7 +120,7 @@
*/
public Reference(String className) {
this.className = className;
- addrs = new Vector();
+ addrs = new Vector<>();
}
/**
@@ -134,7 +134,7 @@
*/
public Reference(String className, RefAddr addr) {
this.className = className;
- addrs = new Vector();
+ addrs = new Vector<>();
addrs.addElement(addr);
}
@@ -225,7 +225,7 @@
int len = addrs.size();
RefAddr addr;
for (int i = 0; i < len; i++) {
- addr = (RefAddr) addrs.elementAt(i);
+ addr = addrs.elementAt(i);
if (addr.getType().compareTo(addrType) == 0)
return addr;
}
@@ -241,7 +241,7 @@
* range.
*/
public RefAddr get(int posn) {
- return ((RefAddr) addrs.elementAt(posn));
+ return addrs.elementAt(posn);
}
/**
@@ -331,8 +331,8 @@
// ignore factory information
if (target.className.equals(this.className) &&
target.size() == this.size()) {
- Enumeration mycomps = getAll();
- Enumeration comps = target.getAll();
+ Enumeration<RefAddr> mycomps = getAll();
+ Enumeration<RefAddr> comps = target.getAll();
while (mycomps.hasMoreElements())
if (!(mycomps.nextElement().equals(comps.nextElement())))
return false;
@@ -350,7 +350,7 @@
*/
public int hashCode() {
int hash = className.hashCode();
- for (Enumeration e = getAll(); e.hasMoreElements();)
+ for (Enumeration<RefAddr> e = getAll(); e.hasMoreElements();)
hash += e.nextElement().hashCode();
return hash;
}
@@ -382,7 +382,7 @@
public Object clone() {
Reference r = new Reference(className, classFactory, classFactoryLocation);
Enumeration<RefAddr> a = getAll();
- r.addrs = new Vector();
+ r.addrs = new Vector<>();
while (a.hasMoreElements())
r.addrs.addElement(a.nextElement());
--- a/jdk/src/share/classes/javax/naming/directory/BasicAttribute.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/naming/directory/BasicAttribute.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -91,6 +91,7 @@
*/
protected boolean ordered = false;
+ @SuppressWarnings("unchecked")
public Object clone() {
BasicAttribute attr;
try {
@@ -98,7 +99,7 @@
} catch (CloneNotSupportedException e) {
attr = new BasicAttribute(attrID, ordered);
}
- attr.values = (Vector)values.clone();
+ attr.values = (Vector<Object>)values.clone();
return attr;
}
@@ -149,7 +150,7 @@
}
} else {
// order is not relevant; check for existence
- Enumeration theirs = target.getAll();
+ Enumeration<?> theirs = target.getAll();
while (theirs.hasMoreElements()) {
if (find(theirs.nextElement()) < 0)
return false;
@@ -215,7 +216,7 @@
answer.append("No values");
} else {
boolean start = true;
- for (Enumeration e = values.elements(); e.hasMoreElements(); ) {
+ for (Enumeration<Object> e = values.elements(); e.hasMoreElements(); ) {
if (!start)
answer.append(", ");
answer.append(e.nextElement());
@@ -254,7 +255,7 @@
*/
public BasicAttribute(String id, boolean ordered) {
attrID = id;
- values = new Vector();
+ values = new Vector<>();
this.ordered = ordered;
}
@@ -327,7 +328,7 @@
// For finding first element that has a null in JDK1.1 Vector.
// In the Java 2 platform, can just replace this with Vector.indexOf(target);
private int find(Object target) {
- Class cl;
+ Class<?> cl;
if (target == null) {
int ct = values.size();
for (int i = 0 ; i < ct ; i++) {
@@ -514,7 +515,7 @@
throws java.io.IOException, ClassNotFoundException {
s.defaultReadObject(); // read in the attrID
int n = s.readInt(); // number of values
- values = new Vector(n);
+ values = new Vector<>(n);
while (--n >= 0) {
values.addElement(s.readObject());
}
@@ -522,31 +523,31 @@
class ValuesEnumImpl implements NamingEnumeration<Object> {
- Enumeration list;
+ Enumeration<Object> list;
- ValuesEnumImpl() {
- list = values.elements();
- }
+ ValuesEnumImpl() {
+ list = values.elements();
+ }
- public boolean hasMoreElements() {
- return list.hasMoreElements();
- }
+ public boolean hasMoreElements() {
+ return list.hasMoreElements();
+ }
- public Object nextElement() {
- return(list.nextElement());
- }
+ public Object nextElement() {
+ return(list.nextElement());
+ }
- public Object next() throws NamingException {
- return list.nextElement();
- }
+ public Object next() throws NamingException {
+ return list.nextElement();
+ }
- public boolean hasMore() throws NamingException {
- return list.hasMoreElements();
- }
+ public boolean hasMore() throws NamingException {
+ return list.hasMoreElements();
+ }
- public void close() throws NamingException {
- list = null;
- }
+ public void close() throws NamingException {
+ list = null;
+ }
}
/**
--- a/jdk/src/share/classes/javax/naming/directory/BasicAttributes.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/naming/directory/BasicAttributes.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -28,6 +28,7 @@
import java.util.Hashtable;
import java.util.Enumeration;
+import java.util.Locale;
import javax.naming.NamingException;
import javax.naming.NamingEnumeration;
@@ -78,7 +79,7 @@
// If ignoreCase is true, key is aways lowercase.
// If ignoreCase is false, key is stored as supplied by put().
// %%% Not declared "private" due to bug 4064984.
- transient Hashtable attrs = new Hashtable(11);
+ transient Hashtable<String,Attribute> attrs = new Hashtable<>(11);
/**
* Constructs a new instance of Attributes.
@@ -138,6 +139,7 @@
this.put(new BasicAttribute(attrID, val));
}
+ @SuppressWarnings("unchecked")
public Object clone() {
BasicAttributes attrset;
try {
@@ -145,7 +147,7 @@
} catch (CloneNotSupportedException e) {
attrset = new BasicAttributes(ignoreCase);
}
- attrset.attrs = (Hashtable)attrs.clone();
+ attrset.attrs = (Hashtable<String,Attribute>)attrs.clone();
return attrset;
}
@@ -158,8 +160,8 @@
}
public Attribute get(String attrID) {
- Attribute attr = (Attribute) attrs.get(
- ignoreCase ? attrID.toLowerCase() : attrID);
+ Attribute attr = attrs.get(
+ ignoreCase ? attrID.toLowerCase(Locale.ENGLISH) : attrID);
return (attr);
}
@@ -178,14 +180,14 @@
public Attribute put(Attribute attr) {
String id = attr.getID();
if (ignoreCase) {
- id = id.toLowerCase();
+ id = id.toLowerCase(Locale.ENGLISH);
}
- return (Attribute)attrs.put(id, attr);
+ return attrs.put(id, attr);
}
public Attribute remove(String attrID) {
- String id = (ignoreCase ? attrID.toLowerCase() : attrID);
- return (Attribute)attrs.remove(id);
+ String id = (ignoreCase ? attrID.toLowerCase(Locale.ENGLISH) : attrID);
+ return attrs.remove(id);
}
/**
@@ -234,7 +236,7 @@
if (size() == target.size()) {
Attribute their, mine;
try {
- NamingEnumeration theirs = target.getAll();
+ NamingEnumeration<?> theirs = target.getAll();
while (theirs.hasMore()) {
their = (Attribute)theirs.next();
mine = get(their.getID());
@@ -268,7 +270,7 @@
public int hashCode() {
int hash = (ignoreCase ? 1 : 0);
try {
- NamingEnumeration all = getAll();
+ NamingEnumeration<?> all = getAll();
while (all.hasMore()) {
hash += all.next().hashCode();
}
@@ -286,7 +288,7 @@
throws java.io.IOException {
s.defaultWriteObject(); // write out the ignoreCase flag
s.writeInt(attrs.size());
- Enumeration attrEnum = attrs.elements();
+ Enumeration<Attribute> attrEnum = attrs.elements();
while (attrEnum.hasMoreElements()) {
s.writeObject(attrEnum.nextElement());
}
@@ -300,8 +302,8 @@
s.defaultReadObject(); // read in the ignoreCase flag
int n = s.readInt(); // number of attributes
attrs = (n >= 1)
- ? new Hashtable(n * 2)
- : new Hashtable(2); // can't have initial size of 0 (grrr...)
+ ? new Hashtable<String,Attribute>(n * 2)
+ : new Hashtable<String,Attribute>(2); // can't have initial size of 0 (grrr...)
while (--n >= 0) {
put((Attribute)s.readObject());
}
--- a/jdk/src/share/classes/javax/naming/ldap/InitialLdapContext.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/naming/ldap/InitialLdapContext.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -129,15 +129,16 @@
* @see #reconnect
* @see LdapContext#reconnect
*/
+ @SuppressWarnings("unchecked")
public InitialLdapContext(Hashtable<?,?> environment,
Control[] connCtls)
throws NamingException {
super(true); // don't initialize yet
// Clone environment since caller owns it.
- Hashtable env = (environment == null)
- ? new Hashtable(11)
- : (Hashtable)environment.clone();
+ Hashtable<Object,Object> env = (environment == null)
+ ? new Hashtable<>(11)
+ : (Hashtable<Object,Object>)environment.clone();
// Put connect controls into environment. Copy them first since
// caller owns the array.
--- a/jdk/src/share/classes/javax/naming/ldap/LdapName.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/naming/ldap/LdapName.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -104,9 +104,7 @@
public class LdapName implements Name {
- // private transient ArrayList<Rdn> rdns; // parsed name components
-
- private transient ArrayList rdns; // parsed name components
+ private transient List<Rdn> rdns; // parsed name components
private transient String unparsed; // if non-null, the DN in unparsed form
private static final long serialVersionUID = -1595520034788997356L;
@@ -144,14 +142,14 @@
// "Invalid entries, list entries must be of type Rdn");
// }
- this.rdns = new ArrayList(rdns.size());
+ this.rdns = new ArrayList<>(rdns.size());
for (int i = 0; i < rdns.size(); i++) {
Object obj = rdns.get(i);
if (!(obj instanceof Rdn)) {
throw new IllegalArgumentException("Entry:" + obj +
" not a valid type;list entries must be of type Rdn");
}
- this.rdns.add(obj);
+ this.rdns.add((Rdn)obj);
}
}
@@ -161,14 +159,12 @@
* (if "name" is not null), the unparsed DN.
*
*/
- // private LdapName(String name, List<Rdn> rdns, int beg, int end) {
-
- private LdapName(String name, ArrayList rdns, int beg, int end) {
+ private LdapName(String name, List<Rdn> rdns, int beg, int end) {
unparsed = name;
// this.rdns = rdns.subList(beg, end);
- List sList = rdns.subList(beg, end);
- this.rdns = new ArrayList(sList);
+ List<Rdn> sList = rdns.subList(beg, end);
+ this.rdns = new ArrayList<>(sList);
}
/**
@@ -201,7 +197,7 @@
* Each element of the enumeration is of class String.
*/
public Enumeration<String> getAll() {
- final Iterator iter = rdns.iterator();
+ final Iterator<Rdn> iter = rdns.iterator();
return new Enumeration<String>() {
public boolean hasMoreElements() {
@@ -234,7 +230,7 @@
* specified range.
*/
public Rdn getRdn(int posn) {
- return (Rdn) rdns.get(posn);
+ return rdns.get(posn);
}
/**
@@ -370,7 +366,7 @@
doesListMatch(len1 - len2, len1, rdns));
}
- private boolean doesListMatch(int beg, int end, List rdns) {
+ private boolean doesListMatch(int beg, int end, List<Rdn> rdns) {
for (int i = beg; i < end; i++) {
if (!this.rdns.get(i).equals(rdns.get(i - beg))) {
return false;
@@ -457,10 +453,10 @@
LdapName s = (LdapName) suffix;
rdns.addAll(posn, s.rdns);
} else {
- Enumeration comps = suffix.getAll();
+ Enumeration<String> comps = suffix.getAll();
while (comps.hasMoreElements()) {
rdns.add(posn++,
- (new Rfc2253Parser((String) comps.nextElement()).
+ (new Rfc2253Parser(comps.nextElement()).
parseRdn()));
}
}
@@ -489,7 +485,7 @@
throw new IllegalArgumentException("Entry:" + obj +
" not a valid type;suffix list entries must be of type Rdn");
}
- rdns.add(i + posn, obj);
+ rdns.add(i + posn, (Rdn)obj);
}
return this;
}
@@ -627,11 +623,11 @@
StringBuilder builder = new StringBuilder();
int size = rdns.size();
if ((size - 1) >= 0) {
- builder.append((Rdn) rdns.get(size - 1));
+ builder.append(rdns.get(size - 1));
}
for (int next = size - 2; next >= 0; next--) {
builder.append(',');
- builder.append((Rdn) rdns.get(next));
+ builder.append(rdns.get(next));
}
unparsed = builder.toString();
return unparsed;
@@ -672,8 +668,8 @@
// Compare RDNs one by one for equality
for (int i = 0; i < rdns.size(); i++) {
// Compare a single pair of RDNs.
- Rdn rdn1 = (Rdn) rdns.get(i);
- Rdn rdn2 = (Rdn) that.rdns.get(i);
+ Rdn rdn1 = rdns.get(i);
+ Rdn rdn2 = that.rdns.get(i);
if (!rdn1.equals(rdn2)) {
return false;
}
@@ -727,8 +723,8 @@
int minSize = Math.min(rdns.size(), that.rdns.size());
for (int i = 0; i < minSize; i++) {
// Compare a single pair of RDNs.
- Rdn rdn1 = (Rdn)rdns.get(i);
- Rdn rdn2 = (Rdn)that.rdns.get(i);
+ Rdn rdn1 = rdns.get(i);
+ Rdn rdn2 = that.rdns.get(i);
int diff = rdn1.compareTo(rdn2);
if (diff != 0) {
@@ -752,7 +748,7 @@
// For each RDN...
for (int i = 0; i < rdns.size(); i++) {
- Rdn rdn = (Rdn) rdns.get(i);
+ Rdn rdn = rdns.get(i);
hash += rdn.hashCode();
}
return hash;
@@ -786,6 +782,6 @@
private void parse() throws InvalidNameException {
// rdns = (ArrayList<Rdn>) (new RFC2253Parser(unparsed)).getDN();
- rdns = (ArrayList) (new Rfc2253Parser(unparsed)).parseDn();
+ rdns = new Rfc2253Parser(unparsed).parseDn();
}
}
--- a/jdk/src/share/classes/javax/naming/ldap/Rdn.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/naming/ldap/Rdn.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -28,6 +28,7 @@
import java.util.Iterator;
import java.util.NoSuchElementException;
import java.util.ArrayList;
+import java.util.Locale;
import java.util.Collections;
import javax.naming.InvalidNameException;
@@ -104,8 +105,7 @@
public class Rdn implements Serializable, Comparable<Object> {
- // private transient ArrayList<RdnEntry> entries;
- private transient ArrayList entries;
+ private transient ArrayList<RdnEntry> entries;
// The common case.
private static final int DEFAULT_SIZE = 1;
@@ -130,12 +130,12 @@
if (attrSet.size() == 0) {
throw new InvalidNameException("Attributes cannot be empty");
}
- entries = new ArrayList(attrSet.size());
- NamingEnumeration attrs = attrSet.getAll();
+ entries = new ArrayList<>(attrSet.size());
+ NamingEnumeration<? extends Attribute> attrs = attrSet.getAll();
try {
for (int nEntries = 0; attrs.hasMore(); nEntries++) {
RdnEntry entry = new RdnEntry();
- Attribute attr = (Attribute) attrs.next();
+ Attribute attr = attrs.next();
entry.type = attr.getID();
entry.value = attr.get();
entries.add(nEntries, entry);
@@ -161,7 +161,7 @@
* parsing of the rdnString.
*/
public Rdn(String rdnString) throws InvalidNameException {
- entries = new ArrayList(DEFAULT_SIZE);
+ entries = new ArrayList<>(DEFAULT_SIZE);
(new Rfc2253Parser(rdnString)).parseRdn(this);
}
@@ -172,7 +172,7 @@
* @param rdn The non-null Rdn to be copied.
*/
public Rdn(Rdn rdn) {
- entries = new ArrayList(rdn.entries.size());
+ entries = new ArrayList<>(rdn.entries.size());
entries.addAll(rdn.entries);
}
@@ -199,7 +199,7 @@
"type or value cannot be empty, type:" + type +
" value:" + value);
}
- entries = new ArrayList(DEFAULT_SIZE);
+ entries = new ArrayList<>(DEFAULT_SIZE);
put(type, value);
}
@@ -210,7 +210,7 @@
// An empty constructor used by the parser
Rdn() {
- entries = new ArrayList(DEFAULT_SIZE);
+ entries = new ArrayList<>(DEFAULT_SIZE);
}
/*
@@ -257,7 +257,7 @@
* @return The non-null attribute value.
*/
public Object getValue() {
- return ((RdnEntry) entries.get(0)).getValue();
+ return entries.get(0).getValue();
}
/**
@@ -275,7 +275,7 @@
* @return The non-null attribute type.
*/
public String getType() {
- return ((RdnEntry) entries.get(0)).getType();
+ return entries.get(0).getType();
}
/**
@@ -329,8 +329,7 @@
for (int i = 0; i < minSize; i++) {
// Compare a single pair of type/value pairs.
- int diff = ((RdnEntry) entries.get(i)).compareTo(
- that.entries.get(i));
+ int diff = entries.get(i).compareTo(that.entries.get(i));
if (diff != 0) {
return diff;
}
@@ -408,7 +407,7 @@
public Attributes toAttributes() {
Attributes attrs = new BasicAttributes(true);
for (int i = 0; i < entries.size(); i++) {
- RdnEntry entry = (RdnEntry) entries.get(i);
+ RdnEntry entry = entries.get(i);
Attribute attr = attrs.put(entry.getType(), entry.getValue());
if (attr != null) {
attr.add(entry.getValue());
@@ -419,7 +418,7 @@
}
- private static class RdnEntry implements Comparable {
+ private static class RdnEntry implements Comparable<RdnEntry> {
private String type;
private Object value;
@@ -435,14 +434,8 @@
return value;
}
- public int compareTo(Object obj) {
-
- // Any change here affecting equality must be
- // reflected in hashCode().
- RdnEntry that = (RdnEntry) obj;
-
- int diff = type.toUpperCase().compareTo(
- that.type.toUpperCase());
+ public int compareTo(RdnEntry that) {
+ int diff = type.compareToIgnoreCase(that.type);
if (diff != 0) {
return diff;
}
@@ -469,7 +462,7 @@
}
public int hashCode() {
- return (type.toUpperCase().hashCode() +
+ return (type.toUpperCase(Locale.ENGLISH).hashCode() +
getValueComparable().hashCode());
}
@@ -486,7 +479,7 @@
if (value instanceof byte[]) {
comparable = escapeBinaryValue((byte[]) value);
} else {
- comparable = ((String) value).toUpperCase();
+ comparable = ((String) value).toUpperCase(Locale.ENGLISH);
}
return comparable;
}
@@ -576,7 +569,6 @@
builder.append(Character.forDigit(0xF & b, 16));
}
return builder.toString();
- // return builder.toString().toUpperCase();
}
/**
@@ -755,7 +747,7 @@
private void readObject(ObjectInputStream s)
throws IOException, ClassNotFoundException {
s.defaultReadObject();
- entries = new ArrayList(DEFAULT_SIZE);
+ entries = new ArrayList<>(DEFAULT_SIZE);
String unparsed = (String) s.readObject();
try {
(new Rfc2253Parser(unparsed)).parseRdn(this);
--- a/jdk/src/share/classes/javax/naming/ldap/Rfc2253Parser.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/naming/ldap/Rfc2253Parser.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -54,14 +54,14 @@
*/
// public List<Rdn> getDN() throws InvalidNameException {
- List parseDn() throws InvalidNameException {
+ List<Rdn> parseDn() throws InvalidNameException {
cur = 0;
// ArrayList<Rdn> rdns =
// new ArrayList<Rdn>(len / 3 + 10); // leave room for growth
- ArrayList rdns =
- new ArrayList(len / 3 + 10); // leave room for growth
+ ArrayList<Rdn> rdns =
+ new ArrayList<>(len / 3 + 10); // leave room for growth
if (len == 0) {
return rdns;
--- a/jdk/src/share/classes/javax/naming/ldap/StartTlsRequest.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/naming/ldap/StartTlsRequest.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -192,7 +192,7 @@
}
try {
VersionHelper helper = VersionHelper.getVersionHelper();
- Class clas = helper.loadClass(
+ Class<?> clas = helper.loadClass(
"com.sun.jndi.ldap.ext.StartTlsResponseImpl");
resp = (StartTlsResponse) clas.newInstance();
@@ -226,19 +226,19 @@
* Acquire the class loader associated with this thread.
*/
private final ClassLoader getContextClassLoader() {
- return (ClassLoader) AccessController.doPrivileged(
- new PrivilegedAction() {
- public Object run() {
+ return AccessController.doPrivileged(
+ new PrivilegedAction<ClassLoader>() {
+ public ClassLoader run() {
return Thread.currentThread().getContextClassLoader();
}
}
);
}
- private final static boolean privilegedHasNext(final Iterator iter) {
- Boolean answer = (Boolean) AccessController.doPrivileged(
- new PrivilegedAction() {
- public Object run() {
+ private final static boolean privilegedHasNext(final Iterator<StartTlsResponse> iter) {
+ Boolean answer = AccessController.doPrivileged(
+ new PrivilegedAction<Boolean>() {
+ public Boolean run() {
return Boolean.valueOf(iter.hasNext());
}
});
--- a/jdk/src/share/classes/javax/naming/spi/ContinuationContext.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/naming/spi/ContinuationContext.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -38,11 +38,11 @@
class ContinuationContext implements Context, Resolver {
protected CannotProceedException cpe;
- protected Hashtable env;
+ protected Hashtable<?,?> env;
protected Context contCtx = null;
protected ContinuationContext(CannotProceedException cpe,
- Hashtable env) {
+ Hashtable<?,?> env) {
this.cpe = cpe;
this.env = env;
}
@@ -109,24 +109,24 @@
ctx.rename(name, newName);
}
- public NamingEnumeration list(Name name) throws NamingException {
+ public NamingEnumeration<NameClassPair> list(Name name) throws NamingException {
Context ctx = getTargetContext();
return ctx.list(name);
}
- public NamingEnumeration list(String name) throws NamingException {
+ public NamingEnumeration<NameClassPair> list(String name) throws NamingException {
Context ctx = getTargetContext();
return ctx.list(name);
}
- public NamingEnumeration listBindings(Name name)
+ public NamingEnumeration<Binding> listBindings(Name name)
throws NamingException
{
Context ctx = getTargetContext();
return ctx.listBindings(name);
}
- public NamingEnumeration listBindings(String name) throws NamingException {
+ public NamingEnumeration<Binding> listBindings(String name) throws NamingException {
Context ctx = getTargetContext();
return ctx.listBindings(name);
}
@@ -193,7 +193,7 @@
return ctx.removeFromEnvironment(propName);
}
- public Hashtable getEnvironment() throws NamingException {
+ public Hashtable<?,?> getEnvironment() throws NamingException {
Context ctx = getTargetContext();
return ctx.getEnvironment();
}
--- a/jdk/src/share/classes/javax/naming/spi/ContinuationDirContext.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/naming/spi/ContinuationDirContext.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -38,6 +38,7 @@
import javax.naming.directory.DirContext;
import javax.naming.directory.Attributes;
import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
import javax.naming.directory.ModificationItem;
/**
@@ -50,7 +51,7 @@
class ContinuationDirContext extends ContinuationContext implements DirContext {
- ContinuationDirContext(CannotProceedException cpe, Hashtable env) {
+ ContinuationDirContext(CannotProceedException cpe, Hashtable<?,?> env) {
super(cpe, env);
}
@@ -204,7 +205,7 @@
res.getDirContext().createSubcontext(res.getString(), attrs);
}
- public NamingEnumeration search(Name name,
+ public NamingEnumeration<SearchResult> search(Name name,
Attributes matchingAttributes,
String[] attributesToReturn)
throws NamingException {
@@ -213,7 +214,7 @@
attributesToReturn);
}
- public NamingEnumeration search(String name,
+ public NamingEnumeration<SearchResult> search(String name,
Attributes matchingAttributes,
String[] attributesToReturn)
throws NamingException {
@@ -223,13 +224,13 @@
attributesToReturn);
}
- public NamingEnumeration search(Name name,
+ public NamingEnumeration<SearchResult> search(Name name,
Attributes matchingAttributes)
throws NamingException {
DirContextNamePair res = getTargetContext(name);
return res.getDirContext().search(res.getName(), matchingAttributes);
}
- public NamingEnumeration search(String name,
+ public NamingEnumeration<SearchResult> search(String name,
Attributes matchingAttributes)
throws NamingException {
DirContextStringPair res = getTargetContext(name);
@@ -237,7 +238,7 @@
matchingAttributes);
}
- public NamingEnumeration search(Name name,
+ public NamingEnumeration<SearchResult> search(Name name,
String filter,
SearchControls cons)
throws NamingException {
@@ -245,7 +246,7 @@
return res.getDirContext().search(res.getName(), filter, cons);
}
- public NamingEnumeration search(String name,
+ public NamingEnumeration<SearchResult> search(String name,
String filter,
SearchControls cons)
throws NamingException {
@@ -253,7 +254,7 @@
return res.getDirContext().search(res.getString(), filter, cons);
}
- public NamingEnumeration search(Name name,
+ public NamingEnumeration<SearchResult> search(Name name,
String filterExpr,
Object[] args,
SearchControls cons)
@@ -263,7 +264,7 @@
cons);
}
- public NamingEnumeration search(String name,
+ public NamingEnumeration<SearchResult> search(String name,
String filterExpr,
Object[] args,
SearchControls cons)
--- a/jdk/src/share/classes/javax/naming/spi/DirectoryManager.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/naming/spi/DirectoryManager.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -84,15 +84,16 @@
*
* @see NamingManager#getContinuationContext(CannotProceedException)
*/
+ @SuppressWarnings("unchecked")
public static DirContext getContinuationDirContext(
CannotProceedException cpe) throws NamingException {
- Hashtable env = cpe.getEnvironment();
+ Hashtable<Object,Object> env = (Hashtable<Object,Object>)cpe.getEnvironment();
if (env == null) {
- env = new Hashtable(7);
+ env = new Hashtable<>(7);
} else {
// Make a (shallow) copy of the environment.
- env = (Hashtable) env.clone();
+ env = (Hashtable<Object,Object>) env.clone();
}
env.put(CPE, cpe);
@@ -217,7 +218,7 @@
}
private static Object createObjectFromFactories(Object obj, Name name,
- Context nameCtx, Hashtable environment, Attributes attrs)
+ Context nameCtx, Hashtable<?,?> environment, Attributes attrs)
throws Exception {
FactoryEnumeration factories = ResourceManager.getFactories(
--- a/jdk/src/share/classes/javax/naming/spi/NamingManager.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/naming/spi/NamingManager.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -139,7 +139,7 @@
throws IllegalAccessException,
InstantiationException,
MalformedURLException {
- Class clas = null;
+ Class<?> clas = null;
// Try to use current class loader
try {
@@ -172,7 +172,7 @@
* @return factory created; null if cannot create
*/
private static Object createObjectFromFactories(Object obj, Name name,
- Context nameCtx, Hashtable environment) throws Exception {
+ Context nameCtx, Hashtable<?,?> environment) throws Exception {
FactoryEnumeration factories = ResourceManager.getFactories(
Context.OBJECT_FACTORIES, environment, nameCtx);
@@ -349,7 +349,7 @@
* invoking a factory.
*/
static Object processURLAddrs(Reference ref, Name name, Context nameCtx,
- Hashtable environment)
+ Hashtable<?,?> environment)
throws NamingException {
for (int i = 0; i < ref.size(); i++) {
@@ -368,7 +368,7 @@
}
private static Object processURL(Object refInfo, Name name,
- Context nameCtx, Hashtable environment)
+ Context nameCtx, Hashtable<?,?> environment)
throws NamingException {
Object answer;
@@ -427,7 +427,7 @@
* @see #getObjectInstance
*/
static Context getContext(Object obj, Name name, Context nameCtx,
- Hashtable environment) throws NamingException {
+ Hashtable<?,?> environment) throws NamingException {
Object answer;
if (obj instanceof Context) {
@@ -452,7 +452,7 @@
// Used by ContinuationContext
static Resolver getResolver(Object obj, Name name, Context nameCtx,
- Hashtable environment) throws NamingException {
+ Hashtable<?,?> environment) throws NamingException {
Object answer;
if (obj instanceof Resolver) {
@@ -585,7 +585,7 @@
*/
private static Object getURLObject(String scheme, Object urlInfo,
Name name, Context nameCtx,
- Hashtable environment)
+ Hashtable<?,?> environment)
throws NamingException {
// e.g. "ftpURLContextFactory"
@@ -771,15 +771,16 @@
* @return A non-null Context object for continuing the operation.
* @exception NamingException If a naming exception occurred.
*/
+ @SuppressWarnings("unchecked")
public static Context getContinuationContext(CannotProceedException cpe)
throws NamingException {
- Hashtable env = cpe.getEnvironment();
+ Hashtable<Object,Object> env = (Hashtable<Object,Object>)cpe.getEnvironment();
if (env == null) {
- env = new Hashtable(7);
+ env = new Hashtable<>(7);
} else {
// Make a (shallow) copy of the environment.
- env = (Hashtable) env.clone();
+ env = (Hashtable<Object,Object>)env.clone();
}
env.put(CPE, cpe);
--- a/jdk/src/share/classes/javax/net/ssl/HttpsURLConnection.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/net/ssl/HttpsURLConnection.java Wed Jul 05 17:49:56 2017 +0200
@@ -144,8 +144,7 @@
throws SSLPeerUnverifiedException {
java.security.cert.Certificate[] certs = getServerCertificates();
- return ((X500Principal)
- ((X509Certificate)certs[0]).getSubjectX500Principal());
+ return ((X509Certificate)certs[0]).getSubjectX500Principal();
}
/**
@@ -173,8 +172,7 @@
java.security.cert.Certificate[] certs = getLocalCertificates();
if (certs != null) {
- return ((X500Principal)
- ((X509Certificate)certs[0]).getSubjectX500Principal());
+ return ((X509Certificate)certs[0]).getSubjectX500Principal();
} else {
return null;
}
--- a/jdk/src/share/classes/javax/sql/rowset/serial/SerialBlob.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/sql/rowset/serial/SerialBlob.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -382,7 +382,7 @@
*/
public java.io.OutputStream setBinaryStream(long pos)
throws SerialException, SQLException {
- if (this.blob.setBinaryStream(pos) != null) {
+ if (this.blob != null) {
return this.blob.setBinaryStream(pos);
} else {
throw new SerialException("Unsupported operation. SerialBlob cannot " +
--- a/jdk/src/share/classes/javax/sql/rowset/serial/SerialClob.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/sql/rowset/serial/SerialClob.java Wed Jul 05 17:49:56 2017 +0200
@@ -436,7 +436,7 @@
*/
public java.io.OutputStream setAsciiStream(long pos)
throws SerialException, SQLException {
- if (this.clob.setAsciiStream(pos) != null) {
+ if (this.clob != null) {
return this.clob.setAsciiStream(pos);
} else {
throw new SerialException("Unsupported operation. SerialClob cannot " +
@@ -466,7 +466,7 @@
*/
public java.io.Writer setCharacterStream(long pos)
throws SerialException, SQLException {
- if (this.clob.setCharacterStream(pos) != null) {
+ if (this.clob != null) {
return this.clob.setCharacterStream(pos);
} else {
throw new SerialException("Unsupported operation. SerialClob cannot " +
--- a/jdk/src/share/classes/javax/swing/SwingUtilities.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/swing/SwingUtilities.java Wed Jul 05 17:49:56 2017 +0200
@@ -1274,8 +1274,7 @@
* <p>
* Additional documentation and examples for this method can be
* found in
- * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How to Use Threads</a>,
- * in <em>The Java Tutorial</em>.
+ * <A HREF="http://download.oracle.com/javase/tutorial/uiswing/concurrency/index.html">Concurrency in Swing</a>.
* <p>
* As of 1.3 this method is just a cover for <code>java.awt.EventQueue.invokeLater()</code>.
* <p>
@@ -1326,8 +1325,7 @@
* <p>
* Additional documentation and examples for this method can be
* found in
- * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How to Use Threads</a>,
- * in <em>The Java Tutorial</em>.
+ * <A HREF="http://download.oracle.com/javase/tutorial/uiswing/concurrency/index.html">Concurrency in Swing</a>.
* <p>
* As of 1.3 this method is just a cover for
* <code>java.awt.EventQueue.invokeAndWait()</code>.
--- a/jdk/src/share/classes/javax/swing/SwingWorker.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/swing/SwingWorker.java Wed Jul 05 17:49:56 2017 +0200
@@ -50,8 +50,8 @@
* When writing a multi-threaded application using Swing, there are
* two constraints to keep in mind:
* (refer to
- * <a href="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">
- * How to Use Threads
+ * <a href="http://download.oracle.com/javase/tutorial/uiswing/concurrency/index.html">
+ * Concurrency in Swing
* </a> for more details):
* <ul>
* <li> Time-consuming tasks should not be run on the <i>Event
--- a/jdk/src/share/classes/javax/swing/package.html Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/swing/package.html Wed Jul 05 17:49:56 2017 +0200
@@ -119,9 +119,9 @@
processing when working with Swing.
<p>
More information on this topic can be found in the
-<a href="http://java.sun.com/docs/books/tutorial/uiswing/">Swing tutorial</a>,
+<a href="http://download.oracle.com/javase/tutorial/uiswing/">Swing tutorial</a>,
in particular the section on
-<a href="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How to Use Threads</a>.
+<a href="http://download.oracle.com/javase/tutorial/uiswing/concurrency/index.html">Concurrency in Swing</a>.
<H2>
--- a/jdk/src/share/classes/javax/swing/text/AbstractDocument.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/swing/text/AbstractDocument.java Wed Jul 05 17:49:56 2017 +0200
@@ -409,8 +409,8 @@
* <p>
* This method is thread safe, although most Swing methods
* are not. Please see
- * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
- * to Use Threads</A> for more information.
+ * <A HREF="http://download.oracle.com/javase/tutorial/uiswing/concurrency/index.html">Concurrency
+ * in Swing</A> for more information.
*
* @param r the renderer to execute
*/
@@ -570,8 +570,8 @@
* <p>
* This method is thread safe, although most Swing methods
* are not. Please see
- * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
- * to Use Threads</A> for more information.
+ * <A HREF="http://download.oracle.com/javase/tutorial/uiswing/concurrency/index.html">Concurrency
+ * in Swing</A> for more information.
*
* @param offs the starting offset >= 0
* @param len the number of characters to remove >= 0
@@ -683,8 +683,8 @@
* <p>
* This method is thread safe, although most Swing methods
* are not. Please see
- * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
- * to Use Threads</A> for more information.
+ * <A HREF="http://download.oracle.com/javase/tutorial/uiswing/concurrency/index.html">Concurrency
+ * in Swing</A> for more information.
*
* @param offs the starting offset >= 0
* @param str the string to insert; does nothing with null/empty strings
@@ -818,8 +818,8 @@
* <p>
* This method is thread safe, although most Swing methods
* are not. Please see
- * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
- * to Use Threads</A> for more information.
+ * <A HREF="http://download.oracle.com/javase/tutorial/uiswing/concurrency/index.html">Concurrency
+ * in Swing</A> for more information.
*
* @param offs the position in the model >= 0
* @return the position
--- a/jdk/src/share/classes/javax/swing/text/DefaultCaret.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/swing/text/DefaultCaret.java Wed Jul 05 17:49:56 2017 +0200
@@ -237,8 +237,8 @@
* <p>
* This method is thread safe, although most Swing methods
* are not. Please see
- * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
- * to Use Threads</A> for more information.
+ * <A HREF="http://download.oracle.com/javase/tutorial/uiswing/concurrency/index.html">Concurrency
+ * in Swing</A> for more information.
*/
protected final synchronized void repaint() {
if (component != null) {
--- a/jdk/src/share/classes/javax/swing/text/DefaultStyledDocument.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/swing/text/DefaultStyledDocument.java Wed Jul 05 17:49:56 2017 +0200
@@ -173,8 +173,8 @@
* <p>
* This method is thread safe, although most Swing methods
* are not. Please see
- * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
- * to Use Threads</A> for more information.
+ * <A HREF="http://download.oracle.com/javase/tutorial/uiswing/concurrency/index.html">Concurrency
+ * in Swing</A> for more information.
*
* @param offset the starting offset >= 0
* @param data the element data
@@ -426,8 +426,8 @@
* <p>
* This method is thread safe, although most Swing methods
* are not. Please see
- * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
- * to Use Threads</A> for more information.
+ * <A HREF="http://download.oracle.com/javase/tutorial/uiswing/concurrency/index.html">Concurrency
+ * in Swing</A> for more information.
*
* @param pos the offset from the start of the document >= 0
* @param s the logical style to assign to the paragraph, null if none
@@ -483,8 +483,8 @@
* <p>
* This method is thread safe, although most Swing methods
* are not. Please see
- * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
- * to Use Threads</A> for more information.
+ * <A HREF="http://download.oracle.com/javase/tutorial/uiswing/concurrency/index.html">Concurrency
+ * in Swing</A> for more information.
*
* @param offset the offset in the document >= 0
* @param length the length >= 0
@@ -536,8 +536,8 @@
* <p>
* This method is thread safe, although most Swing methods
* are not. Please see
- * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
- * to Use Threads</A> for more information.
+ * <A HREF="http://download.oracle.com/javase/tutorial/uiswing/concurrency/index.html">Concurrency
+ * in Swing</A> for more information.
*
* @param offset the offset into the paragraph >= 0
* @param length the number of characters affected >= 0
--- a/jdk/src/share/classes/javax/swing/text/JTextComponent.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/swing/text/JTextComponent.java Wed Jul 05 17:49:56 2017 +0200
@@ -2213,8 +2213,8 @@
* <p>
* This method is thread-safe, although most Swing methods are not. Please
* see <A
- * HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">
- * How to Use Threads</A> for more information.
+ * HREF="http://download.oracle.com/javase/tutorial/uiswing/concurrency/index.html">
+ * Concurrency in Swing</A> for more information.
*
* <p>
* <b>Sample Usage</b>. This code snippet shows a cross-platform print
@@ -2471,8 +2471,8 @@
* <p>
* This method is thread-safe, although most Swing methods are not. Please
* see <A
- * HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">
- * How to Use Threads</A> for more information.
+ * HREF="http://download.oracle.com/javase/tutorial/uiswing/concurrency/index.html">
+ * Concurrency in Swing</A> for more information.
*
* <p>
* The returned {@code Printable} can be printed on any thread.
--- a/jdk/src/share/classes/javax/swing/text/PlainDocument.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/swing/text/PlainDocument.java Wed Jul 05 17:49:56 2017 +0200
@@ -100,8 +100,8 @@
* <p>
* This method is thread safe, although most Swing methods
* are not. Please see
- * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
- * to Use Threads</A> for more information.
+ * <A HREF="http://download.oracle.com/javase/tutorial/uiswing/concurrency/index.html">Concurrency
+ * in Swing</A> for more information.
*
* @param offs the starting offset >= 0
* @param str the string to insert; does nothing with null/empty strings
--- a/jdk/src/share/classes/javax/swing/text/StyleContext.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/swing/text/StyleContext.java Wed Jul 05 17:49:56 2017 +0200
@@ -292,8 +292,8 @@
* <p>
* This method is thread safe, although most Swing methods
* are not. Please see
- * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
- * to Use Threads</A> for more information.
+ * <A HREF="http://download.oracle.com/javase/tutorial/uiswing/concurrency/index.html">Concurrency
+ * in Swing</A> for more information.
*
* @param old the old attribute set
* @param name the non-null attribute name
@@ -321,8 +321,8 @@
* <p>
* This method is thread safe, although most Swing methods
* are not. Please see
- * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
- * to Use Threads</A> for more information.
+ * <A HREF="http://download.oracle.com/javase/tutorial/uiswing/concurrency/index.html">Concurrency
+ * in Swing</A> for more information.
*
* @param old the old attribute set
* @param attr the attributes to add
@@ -349,8 +349,8 @@
* <p>
* This method is thread safe, although most Swing methods
* are not. Please see
- * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
- * to Use Threads</A> for more information.
+ * <A HREF="http://download.oracle.com/javase/tutorial/uiswing/concurrency/index.html">Concurrency
+ * in Swing</A> for more information.
*
* @param old the old set of attributes
* @param name the non-null attribute name
@@ -377,8 +377,8 @@
* <p>
* This method is thread safe, although most Swing methods
* are not. Please see
- * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
- * to Use Threads</A> for more information.
+ * <A HREF="http://download.oracle.com/javase/tutorial/uiswing/concurrency/index.html">Concurrency
+ * in Swing</A> for more information.
*
* @param old the old attribute set
* @param names the attribute names
@@ -405,8 +405,8 @@
* <p>
* This method is thread safe, although most Swing methods
* are not. Please see
- * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
- * to Use Threads</A> for more information.
+ * <A HREF="http://download.oracle.com/javase/tutorial/uiswing/concurrency/index.html">Concurrency
+ * in Swing</A> for more information.
*
* @param old the old attribute set
* @param attrs the attributes
@@ -445,8 +445,8 @@
* <p>
* This method is thread safe, although most Swing methods
* are not. Please see
- * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
- * to Use Threads</A> for more information.
+ * <A HREF="http://download.oracle.com/javase/tutorial/uiswing/concurrency/index.html">Concurrency
+ * in Swing</A> for more information.
*
* @param a the set to reclaim
*/
--- a/jdk/src/share/classes/javax/swing/text/html/CSS.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/swing/text/html/CSS.java Wed Jul 05 17:49:56 2017 +0200
@@ -806,15 +806,11 @@
// translate border width into the cells, if it has non-zero value.
AttributeSet tableAttr = elem.getParentElement().
getParentElement().getAttributes();
- int borderWidth;
- try {
- borderWidth = Integer.parseInt(
- (String) tableAttr.getAttribute(HTML.Attribute.BORDER));
- } catch (NumberFormatException e) {
- borderWidth = 0;
- }
+
+ int borderWidth = getTableBorder(tableAttr);
if (borderWidth > 0) {
- translateAttribute(HTML.Attribute.BORDER, tableAttr, cssAttrSet);
+ // If table contains the BORDER attribute cells should have border width equals 1
+ translateAttribute(HTML.Attribute.BORDER, "1", cssAttrSet);
}
String pad = (String)tableAttr.getAttribute(HTML.Attribute.CELLPADDING);
if (pad != null) {
@@ -850,6 +846,21 @@
return cssAttrSet;
}
+ private static int getTableBorder(AttributeSet tableAttr) {
+ String borderValue = (String) tableAttr.getAttribute(HTML.Attribute.BORDER);
+
+ if (borderValue == HTML.NULL_ATTRIBUTE_VALUE || "".equals(borderValue)) {
+ // Some browsers accept <TABLE BORDER> and <TABLE BORDER=""> with the same semantics as BORDER=1
+ return 1;
+ }
+
+ try {
+ return Integer.parseInt(borderValue);
+ } catch (NumberFormatException e) {
+ return 0;
+ }
+ }
+
private static final Hashtable<String, Attribute> attributeMap = new Hashtable<String, Attribute>();
private static final Hashtable<String, Value> valueMap = new Hashtable<String, Value>();
@@ -1400,17 +1411,20 @@
}
}
} else {
-
- /*
- * The html size attribute has a mapping in the CSS world only
- * if it is par of a font or base font tag.
- */
-
if (key == HTML.Attribute.SIZE && !isHTMLFontTag(tag)) {
- continue;
+ /*
+ * The html size attribute has a mapping in the CSS world only
+ * if it is par of a font or base font tag.
+ */
+ } else if (tag == HTML.Tag.TABLE && key == HTML.Attribute.BORDER) {
+ int borderWidth = getTableBorder(htmlAttrSet);
+
+ if (borderWidth > 0) {
+ translateAttribute(HTML.Attribute.BORDER, Integer.toString(borderWidth), cssAttrSet);
+ }
+ } else {
+ translateAttribute(key, (String) htmlAttrSet.getAttribute(key), cssAttrSet);
}
-
- translateAttribute(key, htmlAttrSet, cssAttrSet);
}
} else if (name instanceof CSS.Attribute) {
cssAttrSet.addAttribute(name, htmlAttrSet.getAttribute(name));
@@ -1419,7 +1433,7 @@
}
private void translateAttribute(HTML.Attribute key,
- AttributeSet htmlAttrSet,
+ String htmlAttrValue,
MutableAttributeSet cssAttrSet) {
/*
* In the case of all remaining HTML.Attribute's they
@@ -1427,8 +1441,6 @@
*/
CSS.Attribute[] cssAttrList = getCssAttribute(key);
- String htmlAttrValue = (String)htmlAttrSet.getAttribute(key);
-
if (cssAttrList == null || htmlAttrValue == null) {
return;
}
--- a/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java Wed Jul 05 17:49:56 2017 +0200
@@ -474,8 +474,8 @@
* <p>
* This method is thread safe, although most Swing methods
* are not. Please see
- * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
- * to Use Threads</A> for more information.
+ * <A HREF="http://download.oracle.com/javase/tutorial/uiswing/concurrency/index.html">Concurrency
+ * in Swing</A> for more information.
*
* @param offset the offset into the paragraph (must be at least 0)
* @param length the number of characters affected (must be at least 0)
--- a/jdk/src/share/classes/javax/swing/text/html/TableView.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/javax/swing/text/html/TableView.java Wed Jul 05 17:49:56 2017 +0200
@@ -242,7 +242,8 @@
if (lv != null) {
cellSpacing = (int) lv.getValue();
} else {
- cellSpacing = 0;
+ // Default cell spacing equals 2
+ cellSpacing = 2;
}
lv = (CSS.LengthValue)
attr.getAttribute(CSS.Attribute.BORDER_TOP_WIDTH);
@@ -251,8 +252,7 @@
} else {
borderWidth = 0;
}
-
- }
+ }
}
/**
--- a/jdk/src/share/classes/sun/font/FontManagerFactory.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/font/FontManagerFactory.java Wed Jul 05 17:49:56 2017 +0200
@@ -78,20 +78,11 @@
ClassLoader cl = ClassLoader.getSystemClassLoader();
Class fmClass = Class.forName(fmClassName, true, cl);
instance = (FontManager) fmClass.newInstance();
- } catch (ClassNotFoundException ex) {
- InternalError err = new InternalError();
- err.initCause(ex);
- throw err;
+ } catch (ClassNotFoundException |
+ InstantiationException |
+ IllegalAccessException ex) {
+ throw new InternalError(ex);
- } catch (InstantiationException ex) {
- InternalError err = new InternalError();
- err.initCause(ex);
- throw err;
-
- } catch (IllegalAccessException ex) {
- InternalError err = new InternalError();
- err.initCause(ex);
- throw err;
}
return null;
}
--- a/jdk/src/share/classes/sun/io/ByteToCharASCII.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-/**
- * A algorithmic conversion from ASCII to Unicode
- *
- * @author Limin Shi
- */
-public class ByteToCharASCII extends ByteToCharConverter {
-
- // Return the character set id
- public String getCharacterEncoding()
- {
- return "ASCII";
- }
-
- public int flush(char[] output, int outStart, int outEnd) {
- // This converter will not buffer any data.
- byteOff = charOff = 0;
- return 0;
- }
-
- /**
- * Algorithmic character conversion
- */
- public int convert(byte[] input, int inOff, int inEnd,
- char[] output, int outOff, int outEnd)
- throws ConversionBufferFullException, UnknownCharacterException
- {
- byte inputByte;
-
- charOff = outOff;
- byteOff = inOff;
-
- // Loop until we hit the end of the input
- while(byteOff < inEnd)
- {
- // If we don't have room for the output, throw an exception
- if (charOff >= outEnd)
- throw new ConversionBufferFullException();
-
- // Convert the input byte
- inputByte = input[byteOff++];
-
- if (inputByte >= 0)
- output[charOff++] = (char)inputByte;
- else {
- if (subMode)
- output[charOff++] = '\uFFFD'; // Replace Char
- else {
- badInputLength = 1;
- throw new UnknownCharacterException();
- }
- }
- }
-
- // Return the length written to the output buffer
- return charOff-outOff;
- }
-
- /*
- * Reset after finding bad input
- */
- public void reset() {
- byteOff = charOff = 0;
- }
-
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharBig5.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.DoubleByte;
-import sun.nio.cs.ext.Big5;
-
-/**
- * Tables and data to convert Big5 to Unicode
- *
- */
-
-public class ByteToCharBig5 extends ByteToCharDBCS_ASCII {
-
- private static DoubleByte.Decoder dec =
- (DoubleByte.Decoder)new Big5().newDecoder();
-
- public String getCharacterEncoding() {
- return "Big5";
- }
-
- public ByteToCharBig5() {
- super(dec);
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharBig5_HKSCS.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.Big5_HKSCS;
-import sun.nio.cs.ext.HKSCS;
-import static sun.nio.cs.CharsetMapping.*;
-
-public class ByteToCharBig5_HKSCS extends ByteToCharDBCS_ASCII {
-
- protected static HKSCS.Decoder dec =
- (HKSCS.Decoder)new Big5_HKSCS().newDecoder();
-
-
- public String getCharacterEncoding() {
- return "Big5_HKSCS";
- }
-
- public ByteToCharBig5_HKSCS() {
- super(dec);
- }
-
- protected char decodeDouble(int byte1, int byte2) {
- char c = dec.decodeDouble(byte1, byte2);
- if (c == UNMAPPABLE_DECODING)
- c = dec.decodeBig5(byte1, byte2);
- return c;
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharBig5_Solaris.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.DoubleByte;
-import sun.nio.cs.ext.Big5_Solaris;
-
-public class ByteToCharBig5_Solaris extends ByteToCharDBCS_ASCII {
-
- private static DoubleByte.Decoder dec =
- (DoubleByte.Decoder)new Big5_Solaris().newDecoder();
-
- public String getCharacterEncoding() {
- return "Big5_Solaris";
- }
-
- public ByteToCharBig5_Solaris() {
- super(dec);
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharConverter.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,294 +0,0 @@
-/*
- * Copyright (c) 1996, 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import java.io.*;
-
-
-/**
- * An abstract base class for subclasses which convert character data
- * in an external encoding into Unicode characters.
- *
- * @author Asmus Freytag
- * @author Lloyd Honomichl
- *
- * @deprecated Replaced by {@link java.nio.charset}. THIS API WILL BE
- * REMOVED IN J2SE 1.6.
- */
-@Deprecated
-public abstract class ByteToCharConverter {
-
- /*
- * Substitution mode flag.
- */
- protected boolean subMode = true;
-
- /*
- * Characters to use for automatic substitution.
- */
- protected char[] subChars = { '\uFFFD' };
-
- /*
- * Offset of next character to be output
- */
- protected int charOff;
-
- /*
- * Offset of next byte to be converted
- */
- protected int byteOff;
-
- /*
- * Length of bad input that caused a MalformedInputException.
- */
- protected int badInputLength;
-
- /**
- * Create an instance of the default ByteToCharConverter subclass.
- */
- public static ByteToCharConverter getDefault() {
- Object cvt;
- cvt = Converters.newDefaultConverter(Converters.BYTE_TO_CHAR);
- return (ByteToCharConverter)cvt;
- }
-
- /**
- * Returns appropriate ByteToCharConverter subclass instance.
- * @param string represents encoding
- */
- public static ByteToCharConverter getConverter(String encoding)
- throws UnsupportedEncodingException
- {
- Object cvt;
- cvt = Converters.newConverter(Converters.BYTE_TO_CHAR, encoding);
- return (ByteToCharConverter)cvt;
- }
-
- /**
- * Returns the character set id for the conversion
- */
- public abstract String getCharacterEncoding();
-
- /**
- * Converts an array of bytes containing characters in an external
- * encoding into an array of Unicode characters. This method allows
- * a buffer by buffer conversion of a data stream. The state of the
- * conversion is saved between calls to convert. Among other things,
- * this means multibyte input sequences can be split between calls.
- * If a call to convert results in an exception, the conversion may be
- * continued by calling convert again with suitably modified parameters.
- * All conversions should be finished with a call to the flush method.
- *
- * @return the number of bytes written to output.
- * @param input byte array containing text to be converted.
- * @param inStart begin conversion at this offset in input array.
- * @param inEnd stop conversion at this offset in input array (exclusive).
- * @param output character array to receive conversion result.
- * @param outStart start writing to output array at this offset.
- * @param outEnd stop writing to output array at this offset (exclusive).
- * @exception MalformedInputException if the input buffer contains any
- * sequence of bytes that is illegal for the input character set.
- * @exception UnknownCharacterException for any character that
- * that cannot be converted to Unicode. Thrown only when converter
- * is not in substitution mode.
- * @exception ConversionBufferFullException if output array is filled prior
- * to converting all the input.
- */
- public abstract int convert(byte[] input, int inStart, int inEnd,
- char[] output, int outStart, int outEnd)
- throws MalformedInputException,
- UnknownCharacterException,
- ConversionBufferFullException;
-
- /**
- * Converts an array of bytes containing characters in an external
- * encoding into an array of Unicode characters. Unlike convert,
- * this method does not do incremental conversion. It assumes that
- * the given input array contains all the characters to be
- * converted. The state of the converter is reset at the beginning
- * of this method and is left in the reset state on successful
- * termination. The converter is not reset if an exception is
- * thrown. This allows the caller to determine where the bad input
- * was encountered by calling nextByteIndex.
- * <p>
- * This method uses substitution mode when performing the
- * conversion. The method setSubstitutionChars may be used to
- * determine what characters are substituted. Even though substitution
- * mode is used, the state of the converter's substitution mode is
- * not changed at the end of this method.
- *
- * @return an array of chars containing the converted characters.
- * @param input array containing Unicode characters to be converted.
- * @exception MalformedInputException if the input buffer contains any
- * sequence of chars that is illegal in the input character encoding.
- * After this exception is thrown,
- * the method nextByteIndex can be called to obtain the index of the
- * first invalid input byte and getBadInputLength can be called
- * to determine the length of the invalid input.
- *
- * @see #nextByteIndex
- * @see #setSubstitutionMode
- * @see sun.io.CharToByteConverter#setSubstitutionBytes(byte[])
- * @see #getBadInputLength
- */
- public char[] convertAll( byte input[] ) throws MalformedInputException {
- reset();
- boolean savedSubMode = subMode;
- subMode = true;
-
- char[] output = new char[ getMaxCharsPerByte() * input.length ];
-
- try {
- int outputLength = convert( input, 0, input.length,
- output, 0, output.length );
- outputLength += flush( output, outputLength, output.length );
-
- char [] returnedOutput = new char[ outputLength ];
- System.arraycopy( output, 0, returnedOutput, 0, outputLength );
- return returnedOutput;
- }
- catch( ConversionBufferFullException e ) {
- //Not supposed to happen. If it does, getMaxCharsPerByte() lied.
- throw new
- InternalError("this.getMaxCharsBerByte returned bad value");
- }
- catch( UnknownCharacterException e ) {
- // Not supposed to happen since we're in substitution mode.
- throw new InternalError();
- }
- finally {
- subMode = savedSubMode;
- }
- }
-
- /**
- * Writes any remaining output to the output buffer and resets the
- * converter to its initial state.
- *
- * @param output char array to receive flushed output.
- * @param outStart start writing to output array at this offset.
- * @param outEnd stop writing to output array at this offset (exclusive).
- * @exception MalformedInputException if the output to be flushed contained
- * a partial or invalid multibyte character sequence. flush will
- * write what it can to the output buffer and reset the converter before
- * throwing this exception. An additional call to flush is not required.
- * @exception ConversionBufferFullException if output array is filled
- * before all the output can be flushed. flush will write what it can
- * to the output buffer and remember its state. An additional call to
- * flush with a new output buffer will conclude the operation.
- */
- public abstract int flush( char[] output, int outStart, int outEnd )
- throws MalformedInputException, ConversionBufferFullException;
-
- /**
- * Resets converter to its initial state.
- */
- public abstract void reset();
-
- /**
- * Returns the maximum number of characters needed to convert a byte. Useful
- * for calculating the maximum output buffer size needed for a particular
- * input buffer.
- */
- public int getMaxCharsPerByte() {
- // Until UTF-16, this will do for every encoding
- return 1;
- }
-
- /**
- * Returns the length, in bytes, of the input which caused a
- * MalformedInputException. Always refers to the last
- * MalformedInputException thrown by the converter. If none have
- * ever been thrown, returns 0.
- */
- public int getBadInputLength() {
- return badInputLength;
- }
-
- /**
- * Returns the index of the character just past the last character
- * written by the previous call to convert.
- */
- public int nextCharIndex() {
- return charOff;
- }
-
- /**
- * Returns the index of the byte just past the last byte successfully
- * converted by the previous call to convert.
- */
- public int nextByteIndex() {
- return byteOff;
- }
-
- /**
- * Sets converter into substitution mode. In substitution mode,
- * the converter will replace untranslatable characters in the source
- * encoding with the substitution character set by setSubstitionChars.
- * When not in substitution mode, the converter will throw an
- * UnknownCharacterException when it encounters untranslatable input.
- *
- * @param doSub if true, enable substitution mode.
- * @see #setSubstitutionChars
- */
- public void setSubstitutionMode(boolean doSub) {
- subMode = doSub;
- }
-
- /**
- * Sets the substitution characters to use when the converter is in
- * substitution mode. The given chars must not be
- * longer than the value returned by getMaxCharsPerByte for this
- * converter.
- *
- * @param newSubBytes the substitution bytes
- * @exception IllegalArgumentException if given byte array is longer than
- * the value returned by the method getMaxBytesPerChar.
- * @see #setSubstitutionMode
- * @see #getMaxBytesPerChar
- */
- /**
- * sets the substitution character to use
- * @param c the substitution character
- */
- public void setSubstitutionChars(char[] c)
- throws IllegalArgumentException
- {
- if( c.length > getMaxCharsPerByte() ) {
- throw new IllegalArgumentException();
- }
-
- subChars = new char[ c.length ];
- System.arraycopy( c, 0, subChars, 0, c.length );
- }
-
- /**
- * returns a string representation of the character conversion
- */
- public String toString() {
- return "ByteToCharConverter: " + getCharacterEncoding();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp037.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM037;
-
-/**
- * A table to convert to Cp037 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp037 extends ByteToCharSingleByte {
-
- private final static IBM037 nioCoder = new IBM037();
-
- public String getCharacterEncoding() {
- return "Cp037";
- }
-
- public ByteToCharCp037() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp1006.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM1006;
-
-/**
- * A table to convert to Cp1006 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp1006 extends ByteToCharSingleByte {
-
- private final static IBM1006 nioCoder = new IBM1006();
-
- public String getCharacterEncoding() {
- return "Cp1006";
- }
-
- public ByteToCharCp1006() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp1025.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM1025;
-
-/**
- * A table to convert to Cp1025 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp1025 extends ByteToCharSingleByte {
-
- private final static IBM1025 nioCoder = new IBM1025();
-
- public String getCharacterEncoding() {
- return "Cp1025";
- }
-
- public ByteToCharCp1025() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp1026.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM1026;
-
-/**
- * A table to convert to Cp1026 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp1026 extends ByteToCharSingleByte {
-
- private final static IBM1026 nioCoder = new IBM1026();
-
- public String getCharacterEncoding() {
- return "Cp1026";
- }
-
- public ByteToCharCp1026() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp1046.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM1046;
-
-/**
- * A table to convert to Cp1046 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp1046 extends ByteToCharSingleByte {
-
- private final static IBM1046 nioCoder = new IBM1046();
-
- public String getCharacterEncoding() {
- return "Cp1046";
- }
-
- public ByteToCharCp1046() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp1047.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM1047;
-
-/**
- * A table to convert to Cp1047 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp1047 extends ByteToCharSingleByte {
-
- private final static IBM1047 nioCoder = new IBM1047();
-
- public String getCharacterEncoding() {
- return "Cp1047";
- }
-
- public ByteToCharCp1047() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp1097.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM1097;
-
-/**
- * A table to convert to Cp1097 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp1097 extends ByteToCharSingleByte {
-
- private final static IBM1097 nioCoder = new IBM1097();
-
- public String getCharacterEncoding() {
- return "Cp1097";
- }
-
- public ByteToCharCp1097() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp1098.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM1098;
-
-/**
- * A table to convert to Cp1098 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp1098 extends ByteToCharSingleByte {
-
- private final static IBM1098 nioCoder = new IBM1098();
-
- public String getCharacterEncoding() {
- return "Cp1098";
- }
-
- public ByteToCharCp1098() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp1112.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM1112;
-
-/**
- * A table to convert to Cp1112 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp1112 extends ByteToCharSingleByte {
-
- private final static IBM1112 nioCoder = new IBM1112();
-
- public String getCharacterEncoding() {
- return "Cp1112";
- }
-
- public ByteToCharCp1112() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp1122.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM1122;
-
-/**
- * A table to convert to Cp1122 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp1122 extends ByteToCharSingleByte {
-
- private final static IBM1122 nioCoder = new IBM1122();
-
- public String getCharacterEncoding() {
- return "Cp1122";
- }
-
- public ByteToCharCp1122() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp1123.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM1123;
-
-/**
- * A table to convert to Cp1123 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp1123 extends ByteToCharSingleByte {
-
- private final static IBM1123 nioCoder = new IBM1123();
-
- public String getCharacterEncoding() {
- return "Cp1123";
- }
-
- public ByteToCharCp1123() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp1124.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM1124;
-
-/**
- * A table to convert to Cp1124 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp1124 extends ByteToCharSingleByte {
-
- private final static IBM1124 nioCoder = new IBM1124();
-
- public String getCharacterEncoding() {
- return "Cp1124";
- }
-
- public ByteToCharCp1124() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp1140.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-/**
- * A table to convert Cp1140 to Unicode. This converter differs from
- * Cp037 is one code point, 0x9F, which changes from \u00A4 to \u20AC.
- * @author Alan Liu
- */
-public class ByteToCharCp1140 extends ByteToCharCp037 {
- public ByteToCharCp1140() {}
-
- public String getCharacterEncoding() {
- return "Cp1140";
- }
-
- protected char getUnicode(int byteIndex) {
- // Change single code point with respect to parent.
- // Cast to byte to get sign extension to match byteIndex.
- return (byteIndex == (byte)0x9F) ? '\u20AC' : super.getUnicode(byteIndex);
- }
-}
-
-//eof
--- a/jdk/src/share/classes/sun/io/ByteToCharCp1141.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-/**
- * A table to convert Cp1141 to Unicode. This converter differs from
- * Cp273 is one code point, 0x9F, which changes from \u00A4 to \u20AC.
- * @author Alan Liu
- */
-public class ByteToCharCp1141 extends ByteToCharCp273 {
- public ByteToCharCp1141() {}
-
- public String getCharacterEncoding() {
- return "Cp1141";
- }
-
- protected char getUnicode(int byteIndex) {
- // Change single code point with respect to parent.
- // Cast to byte to get sign extension to match byteIndex.
- return (byteIndex == (byte)0x9F) ? '\u20AC' : super.getUnicode(byteIndex);
- }
-}
-
-//eof
--- a/jdk/src/share/classes/sun/io/ByteToCharCp1142.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-/**
- * A table to convert Cp1142 to Unicode. This converter differs from
- * Cp277 is one code point, 0x5A, which changes from \u00A4 to \u20AC.
- * @author Alan Liu
- */
-public class ByteToCharCp1142 extends ByteToCharCp277 {
- public ByteToCharCp1142() {}
-
- public String getCharacterEncoding() {
- return "Cp1142";
- }
-
- protected char getUnicode(int byteIndex) {
- // Change single code point with respect to parent.
- // [Careful -- if the code point in question is >= 0x80, make
- // sure you do the comparison like this: (byteIndex == (byte)0x??)]
- return (byteIndex == 0x5A) ? '\u20AC' : super.getUnicode(byteIndex);
- }
-}
-
-//eof
--- a/jdk/src/share/classes/sun/io/ByteToCharCp1143.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-/**
- * A table to convert Cp1143 to Unicode. This converter differs from
- * Cp278 is one code point, 0x5A, which changes from \u00A4 to \u20AC.
- * @author Alan Liu
- */
-public class ByteToCharCp1143 extends ByteToCharCp278 {
- public ByteToCharCp1143() {}
-
- public String getCharacterEncoding() {
- return "Cp1143";
- }
-
- protected char getUnicode(int byteIndex) {
- // Change single code point with respect to parent.
- // [Careful -- if the code point in question is >= 0x80, make
- // sure you do the comparison like this: (byteIndex == (byte)0x??)]
- return (byteIndex == 0x5A) ? '\u20AC' : super.getUnicode(byteIndex);
- }
-}
-
-//eof
--- a/jdk/src/share/classes/sun/io/ByteToCharCp1144.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-/**
- * A table to convert Cp1144 to Unicode. This converter differs from
- * Cp280 is one code point, 0x9F, which changes from \u00A4 to \u20AC.
- * @author Alan Liu
- */
-public class ByteToCharCp1144 extends ByteToCharCp280 {
- public ByteToCharCp1144() {}
-
- public String getCharacterEncoding() {
- return "Cp1144";
- }
-
- protected char getUnicode(int byteIndex) {
- // Change single code point with respect to parent.
- // Cast to byte to get sign extension to match byteIndex.
- return (byteIndex == (byte)0x9F) ? '\u20AC' : super.getUnicode(byteIndex);
- }
-}
-
-//eof
--- a/jdk/src/share/classes/sun/io/ByteToCharCp1145.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-/**
- * A table to convert Cp1145 to Unicode. This converter differs from
- * Cp284 is one code point, 0x9F, which changes from \u00A4 to \u20AC.
- * @author Alan Liu
- */
-public class ByteToCharCp1145 extends ByteToCharCp284 {
- public ByteToCharCp1145() {}
-
- public String getCharacterEncoding() {
- return "Cp1145";
- }
-
- protected char getUnicode(int byteIndex) {
- // Change single code point with respect to parent.
- // Cast to byte to get sign extension to match byteIndex.
- return (byteIndex == (byte)0x9F) ? '\u20AC' : super.getUnicode(byteIndex);
- }
-}
-
-//eof
--- a/jdk/src/share/classes/sun/io/ByteToCharCp1146.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-/**
- * A table to convert Cp1146 to Unicode. This converter differs from
- * Cp285 is one code point, 0x9F, which changes from \u00A4 to \u20AC.
- * @author Alan Liu
- */
-public class ByteToCharCp1146 extends ByteToCharCp285 {
- public ByteToCharCp1146() {}
-
- public String getCharacterEncoding() {
- return "Cp1146";
- }
-
- protected char getUnicode(int byteIndex) {
- // Change single code point with respect to parent.
- // Cast to byte to get sign extension to match byteIndex.
- return (byteIndex == (byte)0x9F) ? '\u20AC' : super.getUnicode(byteIndex);
- }
-}
-
-//eof
--- a/jdk/src/share/classes/sun/io/ByteToCharCp1147.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-/**
- * A table to convert Cp1147 to Unicode. This converter differs from
- * Cp297 is one code point, 0x9F, which changes from \u00A4 to \u20AC.
- * @author Alan Liu
- */
-public class ByteToCharCp1147 extends ByteToCharCp297 {
- public ByteToCharCp1147() {}
-
- public String getCharacterEncoding() {
- return "Cp1147";
- }
-
- protected char getUnicode(int byteIndex) {
- // Change single code point with respect to parent.
- // Cast to byte to get sign extension to match byteIndex.
- return (byteIndex == (byte)0x9F) ? '\u20AC' : super.getUnicode(byteIndex);
- }
-}
-
-//eof
--- a/jdk/src/share/classes/sun/io/ByteToCharCp1148.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-/**
- * A table to convert Cp1148 to Unicode. This converter differs from
- * Cp500 is one code point, 0x9F, which changes from \u00A4 to \u20AC.
- * @author Alan Liu
- */
-public class ByteToCharCp1148 extends ByteToCharCp500 {
- public ByteToCharCp1148() {}
-
- public String getCharacterEncoding() {
- return "Cp1148";
- }
-
- protected char getUnicode(int byteIndex) {
- // Change single code point with respect to parent.
- // Cast to byte to get sign extension to match byteIndex.
- return (byteIndex == (byte)0x9F) ? '\u20AC' : super.getUnicode(byteIndex);
- }
-}
-
-//eof
--- a/jdk/src/share/classes/sun/io/ByteToCharCp1149.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-/**
- * A table to convert Cp1149 to Unicode. This converter differs from
- * Cp871 is one code point, 0x9F, which changes from \u00A4 to \u20AC.
- * @author Alan Liu
- */
-public class ByteToCharCp1149 extends ByteToCharCp871 {
- public ByteToCharCp1149() {}
-
- public String getCharacterEncoding() {
- return "Cp1149";
- }
-
- protected char getUnicode(int byteIndex) {
- // Change single code point with respect to parent.
- // Cast to byte to get sign extension to match byteIndex.
- return (byteIndex == (byte)0x9F) ? '\u20AC' : super.getUnicode(byteIndex);
- }
-}
-
-//eof
--- a/jdk/src/share/classes/sun/io/ByteToCharCp1250.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.MS1250;
-
-/**
- * A table to convert Cp1250 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp1250 extends ByteToCharSingleByte {
-
- private final static MS1250 nioCoder = new MS1250();
-
- public String getCharacterEncoding() {
- return "Cp1250";
- }
-
- public ByteToCharCp1250() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp1251.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.MS1251;
-
-/**
- * A table to convert Cp1251 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp1251 extends ByteToCharSingleByte {
-
- private final static MS1251 nioCoder = new MS1251();
-
- public String getCharacterEncoding() {
- return "Cp1251";
- }
-
- public ByteToCharCp1251() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp1252.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.MS1252;
-
-/**
- * A table to convert Cp1252 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp1252 extends ByteToCharSingleByte {
-
- private final static MS1252 nioCoder = new MS1252();
-
- public String getCharacterEncoding() {
- return "Cp1252";
- }
-
- public ByteToCharCp1252() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp1253.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.MS1253;
-
-/**
- * A table to convert Cp1253 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp1253 extends ByteToCharSingleByte {
-
- private final static MS1253 nioCoder = new MS1253();
-
- public String getCharacterEncoding() {
- return "Cp1253";
- }
-
- public ByteToCharCp1253() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp1254.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.MS1254;
-
-/**
- * A table to convert Cp1254 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp1254 extends ByteToCharSingleByte {
-
- private final static MS1254 nioCoder = new MS1254();
-
- public String getCharacterEncoding() {
- return "Cp1254";
- }
-
- public ByteToCharCp1254() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp1255.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.MS1255;
-
-/**
- * A table to convert Cp1255 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp1255 extends ByteToCharSingleByte {
-
- private final static MS1255 nioCoder = new MS1255();
-
- public String getCharacterEncoding() {
- return "Cp1255";
- }
-
- public ByteToCharCp1255() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp1256.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.MS1256;
-
-/**
- * A table to convert Cp1256 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp1256 extends ByteToCharSingleByte {
-
- private final static MS1256 nioCoder = new MS1256();
-
- public String getCharacterEncoding() {
- return "Cp1256";
- }
-
- public ByteToCharCp1256() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp1257.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.MS1257;
-
-/**
- * A table to convert Cp1257 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp1257 extends ByteToCharSingleByte {
-
- private final static MS1257 nioCoder = new MS1257();
-
- public String getCharacterEncoding() {
- return "Cp1257";
- }
-
- public ByteToCharCp1257() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp1258.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.MS1258;
-
-/**
- * A table to convert Cp1258 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp1258 extends ByteToCharSingleByte {
-
- private final static MS1258 nioCoder = new MS1258();
-
- public String getCharacterEncoding() {
- return "Cp1258";
- }
-
- public ByteToCharCp1258() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp1381.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class ByteToCharCp1381 extends ByteToCharDBCS_ASCII {
-
- // Return the character set id
- public String getCharacterEncoding() {
- return "Cp1381";
- }
-
- public ByteToCharCp1381() {
- super((DoubleByte.Decoder)new IBM1381().newDecoder());
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp1383.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class ByteToCharCp1383 extends ByteToCharEUC2 {
-
- // Return the character set id
- public String getCharacterEncoding() {
- return "Cp1383";
- }
-
- public ByteToCharCp1383() {
- super((DoubleByte.Decoder)new IBM1383().newDecoder());
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp273.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM273;
-
-/**
- * A table to convert to Cp273 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp273 extends ByteToCharSingleByte {
-
- private final static IBM273 nioCoder = new IBM273();
-
- public String getCharacterEncoding() {
- return "Cp273";
- }
-
- public ByteToCharCp273() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp277.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM277;
-
-/**
- * A table to convert to Cp277 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp277 extends ByteToCharSingleByte {
-
- private final static IBM277 nioCoder = new IBM277();
-
- public String getCharacterEncoding() {
- return "Cp277";
- }
-
- public ByteToCharCp277() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp278.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM278;
-
-/**
- * A table to convert to Cp278 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp278 extends ByteToCharSingleByte {
-
- private final static IBM278 nioCoder = new IBM278();
-
- public String getCharacterEncoding() {
- return "Cp278";
- }
-
- public ByteToCharCp278() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp280.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM280;
-
-/**
- * A table to convert to Cp280 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp280 extends ByteToCharSingleByte {
-
- private final static IBM280 nioCoder = new IBM280();
-
- public String getCharacterEncoding() {
- return "Cp280";
- }
-
- public ByteToCharCp280() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp284.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM284;
-
-/**
- * A table to convert to Cp284 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp284 extends ByteToCharSingleByte {
-
- private final static IBM284 nioCoder = new IBM284();
-
- public String getCharacterEncoding() {
- return "Cp284";
- }
-
- public ByteToCharCp284() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp285.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM285;
-
-/**
- * A table to convert to Cp285 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp285 extends ByteToCharSingleByte {
-
- private final static IBM285 nioCoder = new IBM285();
-
- public String getCharacterEncoding() {
- return "Cp285";
- }
-
- public ByteToCharCp285() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp297.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM297;
-
-/**
- * A table to convert to Cp297 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp297 extends ByteToCharSingleByte {
-
- private final static IBM297 nioCoder = new IBM297();
-
- public String getCharacterEncoding() {
- return "Cp297";
- }
-
- public ByteToCharCp297() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp33722.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,191 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-import sun.nio.cs.ext.IBM33722;
-
-/**
-* @author Malcolm Ayres
-*/
-public class ByteToCharCp33722 extends ByteToCharConverter
-{
- private final int G0 = 0;
- private final int G1 = 1;
- private final int G2 = 2;
- private final int G3 = 3;
- private final int G4 = 4;
- private final int SS2 = 0x8E;
- private final int SS3 = 0x8F;
-
- private int firstByte, state;
- private String byteToCharTable;
- private String mappingTableG1;
- private String mappingTableG2;
- private String mappingTableG3;
-
- private final static IBM33722 nioCoder = new IBM33722();
-
- public ByteToCharCp33722() {
- super();
- state = G0;
- byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- mappingTableG1 = nioCoder.getDecoderMappingTableG1();
- mappingTableG2 = nioCoder.getDecoderMappingTableG2();
- mappingTableG3 = nioCoder.getDecoderMappingTableG3();
- }
-
- /**
- * Return the character set id
- */
- public String getCharacterEncoding()
- {
- return "Cp33722";
- }
-
- /**
- * flush out any residual data and reset the buffer state
- */
- public int flush(char[] output, int outStart, int outEnd)
- throws MalformedInputException
- {
- if (state != G0) {
- reset();
- badInputLength = 0;
- throw new MalformedInputException();
- }
-
- reset();
- return 0;
- }
-
- /**
- * Resets the converter.
- */
- public void reset() {
- state = G0;
- charOff = byteOff = 0;
- }
-
- /**
- * Character conversion
- */
- public int convert(byte[] input, int inOff, int inEnd,
- char[] output, int outOff, int outEnd)
- throws UnknownCharacterException, MalformedInputException,
- ConversionBufferFullException
- {
-
- int byte1;
- char outputChar = '\uFFFD';
-
- byteOff = inOff;
- charOff = outOff;
-
- while (byteOff < inEnd) {
-
- byte1 = input[byteOff];
- if (byte1 < 0)
- byte1 += 256;
-
- switch (state) {
- case G0:
- if (byte1 == SS2) // drop into G2 set
- state = G2;
- else if (byte1 == SS3) // drop into G3 set
- state = G3;
- else if ( byte1 <= 0x9f ) // valid single byte
- outputChar = byteToCharTable.charAt(byte1);
- else if (byte1 < 0xa1 || byte1 > 0xfe) { // valid G1 set 1st byte
- badInputLength = 1;
- throw new MalformedInputException();
- } else {
- firstByte = byte1; // save the 1st byte
- state = G1;
- }
- break;
-
- case G1:
- state = G0;
- if ( byte1 < 0xa1 || byte1 > 0xfe) { // valid second byte for G1
- badInputLength = 1;
- throw new MalformedInputException();
- }
- outputChar = mappingTableG1.charAt(((firstByte - 0xa1) * 94) + byte1 - 0xa1);
- break;
-
- case G2:
- state = G0; // valid first byte for G2
- if ( byte1 < 0xa1 || byte1 > 0xfe) {
- badInputLength = 1;
- throw new MalformedInputException();
- }
- outputChar = mappingTableG2.charAt(byte1 - 0xa1);
- break;
-
- case G3:
- if ( byte1 < 0xa1 || byte1 > 0xfe) { // valid first byte for G3
- state = G0;
- badInputLength = 1;
- throw new MalformedInputException();
- }
- firstByte = byte1;
- state = G4;
- break;
-
- case G4:
- state = G0; // valid second byte for G3
- if ( byte1 < 0xa1 || byte1 > 0xfe) {
- badInputLength = 1;
- throw new MalformedInputException();
- }
- outputChar = mappingTableG3.charAt(((firstByte - 0xa1) * 94) + byte1 - 0xa1);
- break;
-
- }
-
- if (state == G0) {
- if (outputChar == '\uFFFD') {
- if (subMode)
- outputChar = subChars[0];
- else {
- badInputLength = 1;
- throw new UnknownCharacterException();
- }
- }
-
- if (charOff >= outEnd)
- throw new ConversionBufferFullException();
-
- output[charOff++] = outputChar;
- }
-
- byteOff++;
-
- }
-
- return charOff - outOff;
-
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp420.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM420;
-
-/**
- * A table to convert to Cp420 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp420 extends ByteToCharSingleByte {
-
- private final static IBM420 nioCoder = new IBM420();
-
- public String getCharacterEncoding() {
- return "Cp420";
- }
-
- public ByteToCharCp420() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp424.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM424;
-
-/**
- * A table to convert to Cp424 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp424 extends ByteToCharSingleByte {
-
- private final static IBM424 nioCoder = new IBM424();
-
- public String getCharacterEncoding() {
- return "Cp424";
- }
-
- public ByteToCharCp424() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp437.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 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. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.IBM437;
-
-/**
- * A table to convert to Cp437 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp437 extends ByteToCharSingleByte {
-
- private final static IBM437 nioCoder = new IBM437();
-
- public String getCharacterEncoding() {
- return "Cp437";
- }
-
- public ByteToCharCp437() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp500.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM500;
-
-/**
- * A table to convert to Cp500 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp500 extends ByteToCharSingleByte {
-
- private final static IBM500 nioCoder = new IBM500();
-
- public String getCharacterEncoding() {
- return "Cp500";
- }
-
- public ByteToCharCp500() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp737.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 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. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.IBM737;
-
-/**
- * A table to convert to Cp737 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp737 extends ByteToCharSingleByte {
-
- private final static IBM737 nioCoder = new IBM737();
-
- public String getCharacterEncoding() {
- return "Cp737";
- }
-
- public ByteToCharCp737() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp775.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 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. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.IBM775;
-
-/**
- * A table to convert to Cp775 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp775 extends ByteToCharSingleByte {
-
- private final static IBM775 nioCoder = new IBM775();
-
- public String getCharacterEncoding() {
- return "Cp775";
- }
-
- public ByteToCharCp775() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp833.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM833;
-
-public class ByteToCharCp833 extends ByteToCharSingleByte {
-
- private final static IBM833 nioCoder = new IBM833();
-
- public String getCharacterEncoding() {
- return "Cp833";
- }
-
- public ByteToCharCp833() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
-
--- a/jdk/src/share/classes/sun/io/ByteToCharCp834.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class ByteToCharCp834 extends ByteToCharDBCS_ASCII {
-
- public String getCharacterEncoding() {
- return "Cp834";
- }
-
- public ByteToCharCp834() {
- super((DoubleByte.Decoder)new IBM834().newDecoder());
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp838.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM838;
-
-/**
- * A table to convert to Cp838 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp838 extends ByteToCharSingleByte {
-
- private final static IBM838 nioCoder = new IBM838();
-
- public String getCharacterEncoding() {
- return "Cp838";
- }
-
- public ByteToCharCp838() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp850.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 1996, 2002, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.IBM850;
-
-/**
- * A table to convert to Cp850 to Unicode
- *
- * @author ConverterGenerator tool
- * @version >= JDK1.1.6
- */
-
-public class ByteToCharCp850 extends ByteToCharSingleByte {
-
- public String getCharacterEncoding() {
- return "Cp850";
- }
-
- public ByteToCharCp850() {
- super.byteToCharTable = new IBM850().getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp852.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 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. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.IBM852;
-
-/**
- * A table to convert to Cp852 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp852 extends ByteToCharSingleByte {
-
- private final static IBM852 nioCoder = new IBM852();
-
- public String getCharacterEncoding() {
- return "Cp852";
- }
-
- public ByteToCharCp852() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp855.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 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. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.IBM855;
-
-/**
- * A table to convert to Cp855 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp855 extends ByteToCharSingleByte {
-
- private final static IBM855 nioCoder = new IBM855();
-
- public String getCharacterEncoding() {
- return "Cp855";
- }
-
- public ByteToCharCp855() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp856.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM856;
-
-/**
- * A table to convert to Cp856 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp856 extends ByteToCharSingleByte {
-
- private final static IBM856 nioCoder = new IBM856();
-
- public String getCharacterEncoding() {
- return "Cp856";
- }
-
- public ByteToCharCp856() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp857.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 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. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.IBM857;
-
-/**
- * A table to convert to Cp857 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp857 extends ByteToCharSingleByte {
-
- private final static IBM857 nioCoder = new IBM857();
-
- public String getCharacterEncoding() {
- return "Cp857";
- }
-
- public ByteToCharCp857() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp858.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-/**
- * A table to convert Cp858 to Unicode. This converter differs from
- * Cp850 is one code point, 0xD5, which changes from \u0131 to \u20AC.
- * @author Alan Liu
- */
-public class ByteToCharCp858 extends ByteToCharCp850 {
- public ByteToCharCp858() {}
-
- public String getCharacterEncoding() {
- return "Cp858";
- }
-
- protected char getUnicode(int byteIndex) {
- // Change single code point with respect to parent.
- // Cast to byte to get sign extension to match byteIndex.
- return (byteIndex == (byte)0xD5) ? '\u20AC' : super.getUnicode(byteIndex);
- }
-}
-
-//eof
--- a/jdk/src/share/classes/sun/io/ByteToCharCp860.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM860;
-
-/**
- * A table to convert to Cp860 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp860 extends ByteToCharSingleByte {
-
- private final static IBM860 nioCoder = new IBM860();
-
- public String getCharacterEncoding() {
- return "Cp860";
- }
-
- public ByteToCharCp860() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp861.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM861;
-
-/**
- * A table to convert to Cp861 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp861 extends ByteToCharSingleByte {
-
- private final static IBM861 nioCoder = new IBM861();
-
- public String getCharacterEncoding() {
- return "Cp861";
- }
-
- public ByteToCharCp861() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp862.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 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. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.IBM862;
-
-/**
- * A table to convert to Cp862 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp862 extends ByteToCharSingleByte {
-
- private final static IBM862 nioCoder = new IBM862();
-
- public String getCharacterEncoding() {
- return "Cp862";
- }
-
- public ByteToCharCp862() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp863.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM863;
-
-/**
- * A table to convert to Cp863 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp863 extends ByteToCharSingleByte {
-
- private final static IBM863 nioCoder = new IBM863();
-
- public String getCharacterEncoding() {
- return "Cp863";
- }
-
- public ByteToCharCp863() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp864.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM864;
-
-/**
- * A table to convert to Cp864 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp864 extends ByteToCharSingleByte {
-
- private final static IBM864 nioCoder = new IBM864();
-
- public String getCharacterEncoding() {
- return "Cp864";
- }
-
- public ByteToCharCp864() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp865.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM865;
-
-/**
- * A table to convert to Cp865 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp865 extends ByteToCharSingleByte {
-
- private final static IBM865 nioCoder = new IBM865();
-
- public String getCharacterEncoding() {
- return "Cp865";
- }
-
- public ByteToCharCp865() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp866.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 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. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.IBM866;
-
-/**
- * A table to convert to Cp866 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp866 extends ByteToCharSingleByte {
-
- private final static IBM866 nioCoder = new IBM866();
-
- public String getCharacterEncoding() {
- return "Cp866";
- }
-
- public ByteToCharCp866() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp868.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM868;
-
-/**
- * A table to convert to Cp868 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp868 extends ByteToCharSingleByte {
-
- private final static IBM868 nioCoder = new IBM868();
-
- public String getCharacterEncoding() {
- return "Cp868";
- }
-
- public ByteToCharCp868() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp869.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM869;
-
-/**
- * A table to convert to Cp869 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp869 extends ByteToCharSingleByte {
-
- private final static IBM869 nioCoder = new IBM869();
-
- public String getCharacterEncoding() {
- return "Cp869";
- }
-
- public ByteToCharCp869() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp870.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM870;
-
-/**
- * A table to convert to Cp870 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp870 extends ByteToCharSingleByte {
-
- private final static IBM870 nioCoder = new IBM870();
-
- public String getCharacterEncoding() {
- return "Cp870";
- }
-
- public ByteToCharCp870() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp871.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM871;
-
-/**
- * A table to convert to Cp871 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp871 extends ByteToCharSingleByte {
-
- private final static IBM871 nioCoder = new IBM871();
-
- public String getCharacterEncoding() {
- return "Cp871";
- }
-
- public ByteToCharCp871() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp874.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 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. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.IBM874;
-
-/**
- * A table to convert to Cp874 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp874 extends ByteToCharSingleByte {
-
- private final static IBM874 nioCoder = new IBM874();
-
- public String getCharacterEncoding() {
- return "Cp874";
- }
-
- public ByteToCharCp874() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp875.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM875;
-
-/**
- * A table to convert to Cp875 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp875 extends ByteToCharSingleByte {
-
- private final static IBM875 nioCoder = new IBM875();
-
- public String getCharacterEncoding() {
- return "Cp875";
- }
-
- public ByteToCharCp875() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp918.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM918;
-
-/**
- * A table to convert to Cp918 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp918 extends ByteToCharSingleByte {
-
- private final static IBM918 nioCoder = new IBM918();
-
- public String getCharacterEncoding() {
- return "Cp918";
- }
-
- public ByteToCharCp918() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp921.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM921;
-
-/**
- * A table to convert to Cp921 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp921 extends ByteToCharSingleByte {
-
- private final static IBM921 nioCoder = new IBM921();
-
- public String getCharacterEncoding() {
- return "Cp921";
- }
-
- public ByteToCharCp921() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp922.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM922;
-
-/**
- * A table to convert to Cp922 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharCp922 extends ByteToCharSingleByte {
-
- private final static IBM922 nioCoder = new IBM922();
-
- public String getCharacterEncoding() {
- return "Cp922";
- }
-
- public ByteToCharCp922() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp930.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class ByteToCharCp930 extends ByteToCharDBCS_EBCDIC {
-
- // Return the character set id
- public String getCharacterEncoding() {
- return "Cp930";
- }
-
- public ByteToCharCp930() {
- super((DoubleByte.Decoder)new IBM930().newDecoder());
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp933.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class ByteToCharCp933 extends ByteToCharDBCS_EBCDIC {
-
- // Return the character set id
- public String getCharacterEncoding() {
- return "Cp933";
- }
-
- public ByteToCharCp933() {
- super((DoubleByte.Decoder)new IBM933().newDecoder());
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp935.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class ByteToCharCp935 extends ByteToCharDBCS_EBCDIC {
-
- // Return the character set id
- public String getCharacterEncoding() {
- return "Cp935";
- }
-
- public ByteToCharCp935() {
- super((DoubleByte.Decoder)new IBM935().newDecoder());
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp937.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class ByteToCharCp937 extends ByteToCharDBCS_EBCDIC {
-
- // Return the character set id
- public String getCharacterEncoding() {
- return "Cp937";
- }
-
- public ByteToCharCp937() {
- super((DoubleByte.Decoder)new IBM937().newDecoder());
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp939.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class ByteToCharCp939 extends ByteToCharDBCS_EBCDIC {
-
- // Return the character set id
- public String getCharacterEncoding() {
- return "Cp939";
- }
-
- public ByteToCharCp939() {
- super((DoubleByte.Decoder)new IBM939().newDecoder());
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp942.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class ByteToCharCp942 extends ByteToCharDBCS_ASCII {
-
- // Return the character set id
- public String getCharacterEncoding() {
- return "Cp942";
- }
-
- public ByteToCharCp942() {
- super((DoubleByte.Decoder)new IBM942().newDecoder());
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp942C.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class ByteToCharCp942C extends ByteToCharDBCS_ASCII {
-
- // Return the character set id
- public String getCharacterEncoding() {
- return "Cp942C";
- }
-
- public ByteToCharCp942C() {
- super((DoubleByte.Decoder)new IBM942C().newDecoder());
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp943.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class ByteToCharCp943 extends ByteToCharDBCS_ASCII {
-
- // Return the character set id
- public String getCharacterEncoding() {
- return "Cp943";
- }
-
- public ByteToCharCp943() {
- super((DoubleByte.Decoder)new IBM943().newDecoder());
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp943C.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class ByteToCharCp943C extends ByteToCharDBCS_ASCII {
-
- // Return the character set id
- public String getCharacterEncoding() {
- return "Cp943C";
- }
-
- public ByteToCharCp943C() {
- super((DoubleByte.Decoder)new IBM943C().newDecoder());
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp948.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class ByteToCharCp948 extends ByteToCharDBCS_ASCII {
-
- // Return the character set id
- public String getCharacterEncoding() {
- return "Cp948";
- }
-
- public ByteToCharCp948() {
- super((DoubleByte.Decoder)new IBM948().newDecoder());
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp949.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class ByteToCharCp949 extends ByteToCharDBCS_ASCII {
-
- // Return the character set id
- public String getCharacterEncoding() {
- return "Cp949";
- }
-
- public ByteToCharCp949() {
- super((DoubleByte.Decoder)new IBM949().newDecoder());
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp949C.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class ByteToCharCp949C extends ByteToCharDBCS_ASCII {
-
- // Return the character set id
- public String getCharacterEncoding() {
- return "Cp949C";
- }
-
- public ByteToCharCp949C() {
- super((DoubleByte.Decoder)new IBM949C().newDecoder());
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp950.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class ByteToCharCp950 extends ByteToCharDBCS_ASCII {
-
- // Return the character set id
- public String getCharacterEncoding() {
- return "Cp950";
- }
-
- public ByteToCharCp950() {
- super((DoubleByte.Decoder)new IBM950().newDecoder());
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp964.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,207 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-import sun.nio.cs.ext.IBM964;
-
-/**
-* @author Malcolm Ayres
-*/
-public class ByteToCharCp964 extends ByteToCharConverter
-{
- private final static IBM964 nioCoder = new IBM964();
-
- private final int G0 = 0;
- private final int G1 = 1;
- private final int G2 = 2;
- private final int G3 = 3;
- private final int G4 = 4;
- private final int SS2 = 0x8E;
- private final int SS3 = 0x8F;
-
- private int firstByte, state;
-
- private String byteToCharTable;
- private String mappingTableG1;
- private String mappingTableG2;
- private String mappingTableG2a2;
- private String mappingTableG2ac;
- private String mappingTableG2ad;
-
-
- public ByteToCharCp964() {
- super();
- state = G0;
- byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- mappingTableG1 = nioCoder.getDecoderMappingTableG1();
- mappingTableG2a2 = nioCoder.getDecoderMappingTableG2a2();
- mappingTableG2ac = nioCoder.getDecoderMappingTableG2ac();
- mappingTableG2ad = nioCoder.getDecoderMappingTableG2ad();
- }
-
- /**
- * Return the character set id
- */
- public String getCharacterEncoding()
- {
- return "Cp964";
- }
-
- /**
- * flush out any residual data and reset the buffer state
- */
- public int flush(char[] output, int outStart, int outEnd)
- throws MalformedInputException
- {
- if (state != G0) {
- reset();
- badInputLength = 0;
- throw new MalformedInputException();
- }
-
- reset();
- return 0;
- }
-
- /**
- * Resets the converter.
- */
- public void reset() {
- state = G0;
- charOff = byteOff = 0;
- }
-
- /**
- * Character conversion
- */
- public int convert(byte[] input, int inOff, int inEnd,
- char[] output, int outOff, int outEnd)
- throws UnknownCharacterException, MalformedInputException,
- ConversionBufferFullException
- {
-
- int byte1;
- char outputChar = '\uFFFD';
-
- byteOff = inOff;
- charOff = outOff;
-
- while (byteOff < inEnd) {
-
- byte1 = input[byteOff];
- if (byte1 < 0)
- byte1 += 256;
-
- switch (state) {
- case G0:
- if (byte1 == SS2)
- state = G2;
- else if (byte1 == SS3) {
- badInputLength = 1;
- throw new MalformedInputException();
- }
- else if ( byte1 <= 0x9f ) // valid single byte
- outputChar = byteToCharTable.charAt(byte1);
- else if (byte1 < 0xa1 || byte1 > 0xfe) {
- badInputLength = 1;
- throw new MalformedInputException();
- } else { // valid 1st byte for G1
- firstByte = byte1;
- state = G1;
- }
- break;
-
- case G1:
- state = G0;
- if ( byte1 < 0xa1 || byte1 > 0xfe) { // valid second byte for G1
- badInputLength = 1;
- throw new MalformedInputException();
- }
- outputChar = mappingTableG1.charAt(((firstByte - 0xa1) * 94) + byte1 - 0xa1);
- break;
-
- case G2:
- // set the correct mapping table for supported G2 sets
- if ( byte1 == 0xa2)
- mappingTableG2 = mappingTableG2a2;
- else
- if ( byte1 == 0xac)
- mappingTableG2 = mappingTableG2ac;
- else
- if ( byte1 == 0xad)
- mappingTableG2 = mappingTableG2ad;
- else {
- state = G0;
- badInputLength = 1;
- throw new MalformedInputException();
- }
- state = G3;
- break;
-
- case G3:
- if ( byte1 < 0xa1 || byte1 > 0xfe) { // valid 1st byte for G2 set
- state = G0;
- badInputLength = 1;
- throw new MalformedInputException();
- }
- firstByte = byte1;
- state = G4;
- break;
-
- case G4:
- state = G0;
- if ( byte1 < 0xa1 || byte1 > 0xfe) { // valid 2nd byte for G2 set
- badInputLength = 1;
- throw new MalformedInputException();
- }
- outputChar = mappingTableG2.charAt(((firstByte - 0xa1) * 94) + byte1 - 0xa1);
- break;
-
- }
-
- if (state == G0) {
- if (outputChar == '\uFFFD') {
- if (subMode)
- outputChar = subChars[0];
- else {
- badInputLength = 1;
- throw new UnknownCharacterException();
- }
- }
-
- if (charOff >= outEnd)
- throw new ConversionBufferFullException();
-
- output[charOff++] = outputChar;
- }
-
- byteOff++;
-
- }
-
- return charOff - outOff;
-
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharCp970.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class ByteToCharCp970 extends ByteToCharEUC2 {
-
- // Return the character set id
- public String getCharacterEncoding() {
- return "Cp970";
- }
-
- public ByteToCharCp970() {
- super((DoubleByte.Decoder)new IBM970().newDecoder());
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharDBCS_ASCII.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,133 +0,0 @@
-/*
- * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-import sun.nio.cs.ext.DoubleByte;
-import static sun.nio.cs.CharsetMapping.*;
-
-public abstract class ByteToCharDBCS_ASCII extends ByteToCharConverter
-{
- private boolean savedBytePresent;
- private int savedByte;
-
- private DoubleByte.Decoder dec;
-
- public ByteToCharDBCS_ASCII(DoubleByte.Decoder dec) {
- super();
- savedBytePresent = false;
- this.dec = dec;
- }
-
- char decodeSingle(int b) {
- return dec.decodeSingle(b);
- }
-
- char decodeDouble(int b1, int b2) {
- return dec.decodeDouble(b1, b2);
- }
-
- public int flush(char [] output, int outStart, int outEnd)
- throws MalformedInputException
- {
-
- if (savedBytePresent) {
- reset();
- badInputLength = 0;
- throw new MalformedInputException();
- }
-
- reset();
- return 0;
- }
-
- /**
- * Character conversion
- */
- public int convert(byte[] input, int inOff, int inEnd,
- char[] output, int outOff, int outEnd)
- throws UnknownCharacterException, MalformedInputException,
- ConversionBufferFullException
- {
- int inputSize;
- char outputChar = UNMAPPABLE_DECODING;
-
- charOff = outOff;
- byteOff = inOff;
-
- while(byteOff < inEnd)
- {
- int byte1;
-
- if (!savedBytePresent) {
- byte1 = input[byteOff] & 0xff;
- inputSize = 1;
- } else {
- byte1 = savedByte;
- savedBytePresent = false;
- inputSize = 0;
- }
-
- outputChar = decodeSingle(byte1);
- if (outputChar == UNMAPPABLE_DECODING) {
-
- if (byteOff + inputSize >= inEnd) {
- savedByte = byte1;
- savedBytePresent = true;
- byteOff += inputSize;
- break;
- }
-
- outputChar = decodeDouble(byte1, input[byteOff+inputSize] & 0xff);
- inputSize++;
- }
-
- if (outputChar == UNMAPPABLE_DECODING) {
- if (subMode)
- outputChar = subChars[0];
- else {
- badInputLength = inputSize;
- throw new UnknownCharacterException();
- }
- }
-
- if (charOff >= outEnd)
- throw new ConversionBufferFullException();
-
- output[charOff++] = outputChar;
- byteOff += inputSize;
-
- }
-
- return charOff - outOff;
- }
-
- /**
- * Resets the converter.
- */
- public void reset() {
- charOff = byteOff = 0;
- savedBytePresent = false;
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharDBCS_EBCDIC.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,196 +0,0 @@
-/*
- * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-import sun.nio.cs.ext.DoubleByte;
-import static sun.nio.cs.CharsetMapping.*;
-
-public abstract class ByteToCharDBCS_EBCDIC extends ByteToCharConverter
-{
-
- private static final int SBCS = 0;
- private static final int DBCS = 1;
-
- private static final int SO = 0x0e;
- private static final int SI = 0x0f;
-
- private int currentState;
- private boolean savedBytePresent;
- private int savedByte;
-
- private DoubleByte.Decoder dec;
-
- public ByteToCharDBCS_EBCDIC(DoubleByte.Decoder dec) {
- super();
- currentState = SBCS;
- savedBytePresent = false;
- this.dec = dec;
- }
-
- char decodeSingle(int b) {
- return dec.decodeSingle(b);
- }
-
- char decodeDouble(int b1, int b2) {
- return dec.decodeDouble(b1, b2);
- }
-
- public int flush(char [] output, int outStart, int outEnd)
- throws MalformedInputException
- {
-
- if (savedBytePresent) {
- reset();
- badInputLength = 0;
- throw new MalformedInputException();
- }
-
- reset();
- return 0;
- }
-
- /**
- * Character conversion
- */
- public int convert(byte[] input, int inOff, int inEnd,
- char[] output, int outOff, int outEnd)
- throws UnknownCharacterException, MalformedInputException,
- ConversionBufferFullException
- {
- int inputSize;
- char outputChar = UNMAPPABLE_DECODING;
-
- charOff = outOff;
- byteOff = inOff;
-
- while(byteOff < inEnd) {
- int byte1, byte2;
-
- if (!savedBytePresent) {
- byte1 = input[byteOff] & 0xff;
- inputSize = 1;
- } else {
- byte1 = savedByte;
- savedBytePresent = false;
- inputSize = 0;
- }
-
- if (byte1 == SO) {
-
- // For SO characters - simply validate the state and if OK
- // update the state and go to the next byte
-
- if (currentState != SBCS) {
- badInputLength = 1;
- throw new MalformedInputException();
- } else {
- currentState = DBCS;
- byteOff += inputSize;
- }
- }
-
- else
- if (byte1 == SI) {
- // For SI characters - simply validate the state and if OK
- // update the state and go to the next byte
-
- if (currentState != DBCS) {
- badInputLength = 1;
- throw new MalformedInputException();
- } else {
- currentState = SBCS;
- byteOff+= inputSize;
- }
- } else {
-
- // Process the real data characters
-
- if (currentState == SBCS) {
- outputChar = decodeSingle(byte1);
- } else {
-
- // for a DBCS character - architecture dictates the
- // valid range of 1st bytes
-
- if (byte1 < 0x40 || byte1 > 0xfe) {
- badInputLength = 1;
- throw new MalformedInputException();
- }
-
- if (byteOff + inputSize >= inEnd) {
- // We have been split in the middle if a character
- // save the first byte for next time around
-
- savedByte = byte1;
- savedBytePresent = true;
- byteOff += inputSize;
- break;
- }
-
- byte2 = input[byteOff+inputSize] & 0xff;
- inputSize++;
-
- // validate the pair of bytes meet the architecture
-
- if ((byte1 != 0x40 || byte2 != 0x40) &&
- (byte2 < 0x41 || byte2 > 0xfe)) {
- badInputLength = 2;
- throw new MalformedInputException();
- }
-
- outputChar = decodeDouble(byte1, byte2);
- }
-
- if (outputChar == UNMAPPABLE_DECODING) {
- if (subMode)
- outputChar = subChars[0];
- else {
- badInputLength = inputSize;
- throw new UnknownCharacterException();
- }
- }
-
- if (charOff >= outEnd)
- throw new ConversionBufferFullException();
-
- output[charOff++] = outputChar;
- byteOff += inputSize;
- }
-
- }
-
- return charOff - outOff;
- }
-
-
- /**
- * Resets the converter.
- */
- public void reset() {
- charOff = byteOff = 0;
- currentState = SBCS;
- savedBytePresent = false;
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharDoubleByte.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,191 +0,0 @@
-/*
- * Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-/**
- * @author Limin Shi
- * Sean Jiang
- */
-
-public abstract class ByteToCharDoubleByte extends ByteToCharConverter {
- protected byte savedByte;
-
- /*
- * 1st level index, provided by subclass
- */
- protected short index1[];
-
- /*
- * 2nd level index, provided by subclass
- * every string has 0x10*(end-start+1) characters.
- */
- protected String index2[];
-
- protected int start;
- protected int end;
-
- /*
- * Size of bad input that caused conversion to stop
- */
- protected int badInputLength;
-
- public ByteToCharDoubleByte() {
- super();
- savedByte = 0;
- }
-
-
- public short[] getIndex1() {
- return(index1);
- }
-
- public String[] getIndex2() {
- return(index2);
- }
-
- public int flush(char[] output, int outStart, int outEnd)
- throws MalformedInputException
- {
- if (savedByte != 0) {
- reset();
- badInputLength = 0;
- throw new MalformedInputException();
- }
- reset();
- return 0;
- }
-
- /**
- * Converts sequences of bytes to characters.
- * Conversions that result in Exceptions can be restarted by calling
- * convert again, with appropriately modified parameters.
- * @return the characters written to output.
- * @param input byte array containing text in Double/single Byte
- * @param inStart offset in input array
- * @param inEnd offset of last byte to be converted
- * @param output character array to receive conversion result
- * @param outStart starting offset
- * @param outEnd offset of last byte to be written to
- * @throw UnsupportedCharacterException for any bytes
- * that cannot be converted to the external character set.
- */
- public int convert(byte[] input, int inOff, int inEnd,
- char[] output, int outOff, int outEnd)
- throws UnknownCharacterException, MalformedInputException,
- ConversionBufferFullException
- {
- char outputChar = REPLACE_CHAR;
- int inputSize = 0; // Size of input
-
- // Record beginning offsets
- charOff = outOff;
- byteOff = inOff;
-
- // Loop until we hit the end of the input
- while (byteOff < inEnd) {
- int byte1, byte2;
-
- if (savedByte == 0) {
- byte1 = input[byteOff];
- inputSize = 1;
- } else {
- byte1 = savedByte;
- savedByte = 0;
- inputSize = 0;
- }
-
- outputChar = convSingleByte(byte1);
-
- if (outputChar == REPLACE_CHAR) { // DoubleByte char
- if (byteOff + inputSize >= inEnd) {
- // split in the middle of a character
- // save the first byte for next time around
- savedByte = (byte) byte1;
- byteOff += inputSize;
- break;
- }
-
- byte1 &= 0xff;
- byte2 = input[byteOff + inputSize] & 0xff;
-
- inputSize++;
- outputChar = getUnicode(byte1, byte2);
- }
-
- if (outputChar == REPLACE_CHAR) {
- if (subMode)
- outputChar = subChars[0];
- else {
- badInputLength = inputSize;
- throw new UnknownCharacterException();
- }
- }
-
- if (charOff >= outEnd)
- throw new ConversionBufferFullException();
-
- output[charOff++] = outputChar;
- byteOff += inputSize;
- }
-
- return charOff - outOff;
- }
-
- /**
- * Resets the converter.
- * Call this method to reset the converter to its initial state
- */
- public void reset() {
- byteOff = charOff = 0;
- savedByte = 0;
- }
-
-
- /*
- * Can be changed by subclass
- */
- protected char convSingleByte(int b) {
- if (b >= 0)
- return (char) b;
- return REPLACE_CHAR;
- }
-
- /*
- * Can be changed by subclass
- */
- protected char getUnicode(int byte1, int byte2) {
- // Fix for bug 4117820 - similar fix for bug 4121358 put
- // into ByteToCharEUC_JP.getUnicode()
- if (((byte1 < 0) || (byte1 > index1.length))
- || ((byte2 < start) || (byte2 > end)))
- return REPLACE_CHAR;
-
- int n = (index1[byte1] & 0xf) * (end - start + 1) + (byte2 - start);
- return index2[index1[byte1] >> 4].charAt(n);
- }
-
- protected final static char REPLACE_CHAR = '\uFFFD';
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharEUC.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,150 +0,0 @@
-/*
- * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-/**
-* @author Malcolm Ayres
-*/
-public abstract class ByteToCharEUC extends ByteToCharConverter
-{
- private final int G0 = 0;
- private final int G1 = 1;
- private final int SS2 = 0x8E;
- private final int SS3 = 0x8F;
-
- private int firstByte, state;
-
- protected String mappingTableG1;
- protected String byteToCharTable;
-
-
- public ByteToCharEUC() {
- super();
- state = G0;
- }
-
- /**
- * flush out any residual data and reset the buffer state
- */
- public int flush(char[] output, int outStart, int outEnd)
- throws MalformedInputException
- {
- if (state != G0) {
- reset();
- badInputLength = 0;
- throw new MalformedInputException();
- }
-
- reset();
- return 0;
- }
-
- /**
- * Resets the converter.
- */
- public void reset() {
- state = G0;
- charOff = byteOff = 0;
- }
-
- /**
- * Character conversion
- */
- public int convert(byte[] input, int inOff, int inEnd,
- char[] output, int outOff, int outEnd)
- throws UnknownCharacterException, MalformedInputException,
- ConversionBufferFullException
- {
-
- int byte1;
- char outputChar = '\uFFFD';
-
- byteOff = inOff;
- charOff = outOff;
-
- while (byteOff < inEnd) {
-
- byte1 = input[byteOff];
- if (byte1 < 0)
- byte1 += 256;
-
- switch (state) {
- case G0:
- if (byte1 == SS2 || // no general support
- byte1 == SS3 ) { // for g2 or g3
- badInputLength = 1;
- throw new MalformedInputException();
- }
-
- if ( byte1 <= 0x9f ) // < 0x9f has its own table
- outputChar = byteToCharTable.charAt(byte1);
- else
- if (byte1 < 0xa1 || byte1 > 0xfe) { // byte within range?
- badInputLength = 1;
- throw new MalformedInputException();
- } else { // G1 set first byte
- firstByte = byte1;
- state = G1;
- }
- break;
-
- case G1:
-
- state = G0;
- if ( byte1 < 0xa1 || byte1 > 0xfe) { // valid G1 set second byte
- badInputLength = 1;
- throw new MalformedInputException();
- }
-
- outputChar = mappingTableG1.charAt(((firstByte - 0xa1) * 94) + byte1 - 0xa1);
- break;
-
- }
-
- if (state == G0) {
- if (outputChar == '\uFFFD') {
- if (subMode)
- outputChar = subChars[0];
- else {
- badInputLength = 1;
- throw new UnknownCharacterException();
- }
- }
-
- if (charOff >= outEnd)
- throw new ConversionBufferFullException();
-
- output[charOff++] = outputChar;
- }
-
- byteOff++;
-
- }
-
- return charOff - outOff;
-
- }
-
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharEUC2.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-import sun.nio.cs.ext.DoubleByte;
-import static sun.nio.cs.CharsetMapping.*;
-
-public abstract class ByteToCharEUC2 extends ByteToCharConverter
-{
- private final int G0 = 0;
- private final int G1 = 1;
- private final int SS2 = 0x8E;
- private final int SS3 = 0x8F;
-
- private int firstByte, state;
-
- private DoubleByte.Decoder dec;
-
- public ByteToCharEUC2(DoubleByte.Decoder dec) {
- super();
- state = G0;
- this.dec = dec;
- }
-
- char decodeSingle(int b) {
- return dec.decodeSingle(b);
- }
-
- char decodeDouble(int b1, int b2) {
- return dec.decodeDouble(b1, b2);
- }
-
- /**
- * flush out any residual data and reset the buffer state
- */
- public int flush(char[] output, int outStart, int outEnd)
- throws MalformedInputException
- {
- if (state != G0) {
- reset();
- badInputLength = 0;
- throw new MalformedInputException();
- }
-
- reset();
- return 0;
- }
-
- /**
- * Resets the converter.
- */
- public void reset() {
- state = G0;
- charOff = byteOff = 0;
- }
-
- /**
- * Character conversion
- */
- public int convert(byte[] input, int inOff, int inEnd,
- char[] output, int outOff, int outEnd)
- throws UnknownCharacterException, MalformedInputException,
- ConversionBufferFullException
- {
- int byte1;
- char outputChar = UNMAPPABLE_DECODING;
- byteOff = inOff;
- charOff = outOff;
-
- while (byteOff < inEnd) {
- byte1 = input[byteOff] & 0xff;
- switch (state) {
- case G0:
- if (byte1 == SS2 || // no general support
- byte1 == SS3 ) { // for g2 or g3
- badInputLength = 1;
- throw new MalformedInputException();
- }
- if ( byte1 <= 0x9f ) // < 0x9f has its own table
- outputChar = decodeSingle(byte1);
- else
- if (byte1 < 0xa1 || byte1 > 0xfe) { // byte within range?
- badInputLength = 1;
- throw new MalformedInputException();
- } else { // G1 set first byte
- firstByte = byte1;
- state = G1;
- }
- break;
- case G1:
- state = G0;
- if ( byte1 < 0xa1 || byte1 > 0xfe) { // valid G1 set second byte
- badInputLength = 1;
- throw new MalformedInputException();
- }
- outputChar = decodeDouble(firstByte, byte1);
- break;
- }
- if (state == G0) {
- if (outputChar == UNMAPPABLE_DECODING) {
- if (subMode)
- outputChar = subChars[0];
- else {
- badInputLength = 1;
- throw new UnknownCharacterException();
- }
- }
- if (charOff >= outEnd)
- throw new ConversionBufferFullException();
- output[charOff++] = outputChar;
- }
- byteOff++;
- }
- return charOff - outOff;
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharEUC_CN.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class ByteToCharEUC_CN extends ByteToCharDBCS_ASCII {
-
- private static DoubleByte.Decoder dec =
- (DoubleByte.Decoder)new EUC_CN().newDecoder();
-
- public String getCharacterEncoding() {
- return "EUC_CN";
- }
-
- public ByteToCharEUC_CN() {
- super(dec);
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharEUC_JP.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,192 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-/**
- * @author Limin Shi
- */
-
-public class ByteToCharEUC_JP extends ByteToCharJIS0208 {
- private byte savedSecond = 0;
-
- ByteToCharJIS0201 bcJIS0201 = new ByteToCharJIS0201();
- ByteToCharJIS0212 bcJIS0212 = new ByteToCharJIS0212();
-
- public ByteToCharEUC_JP() {
- super();
- start = 0xA1;
- end = 0xFE;
- savedSecond = 0;
- }
-
- public int flush(char[] output, int outStart, int outEnd)
- throws MalformedInputException
- {
- if (savedSecond != 0) {
- reset();
- throw new MalformedInputException();
- }
- reset();
- return 0;
- }
-
- /**
- * Resets the converter.
- * Call this method to reset the converter to its initial state
- */
- public void reset() {
- super.reset();
- savedSecond = 0;
- }
-
- public String getCharacterEncoding() {
- return "EUC_JP";
- }
-
- protected char convSingleByte(int b) {
- if (b < 0 || b > 0x7F)
- return REPLACE_CHAR;
- return bcJIS0201.getUnicode(b);
- }
-
- protected char getUnicode(int byte1, int byte2) {
- if (byte1 == 0x8E) {
- return bcJIS0201.getUnicode(byte2 - 256);
- }
- // Fix for bug 4121358 - similar fix for bug 4117820 put
- // into ByteToCharDoubleByte.getUnicode()
- if (((byte1 < 0) || (byte1 > index1.length))
- || ((byte2 < start) || (byte2 > end)))
- return REPLACE_CHAR;
-
- int n = (index1[byte1 - 0x80] & 0xf) * (end - start + 1)
- + (byte2 - start);
- return index2[index1[byte1 - 0x80] >> 4].charAt(n);
- }
-
- protected char decode0212(int byte1, int byte2) {
- return bcJIS0212.getUnicode(byte1, byte2);
- }
-
- /**
- * Converts sequences of bytes to characters.
- * Conversions that result in Exceptions can be restarted by calling
- * convert again, with appropriately modified parameters.
- * @return the characters written to output.
- * @param input byte array containing text in Double/single Byte
- * @param inStart offset in input array
- * @param inEnd offset of last byte to be converted
- * @param output character array to receive conversion result
- * @param outStart starting offset
- * @param outEnd offset of last byte to be written to
- * @throw UnsupportedCharacterException for any bytes
- * that cannot be converted to the external character set.
- */
- public int convert(byte[] input, int inOff, int inEnd,
- char[] output, int outOff, int outEnd)
- throws UnknownCharacterException,
- ConversionBufferFullException
- {
- char outputChar = REPLACE_CHAR;
- int inputSize = 0; // Size of input
-
- // Record beginning offsets
- charOff = outOff;
- byteOff = inOff;
-
- // Loop until we hit the end of the input
- while (byteOff < inEnd) {
- int byte1, byte2;
-
- if (savedByte == 0) {
- byte1 = input[byteOff];
- inputSize = 1;
- } else {
- byte1 = savedByte;
- savedByte = 0;
- inputSize = 0;
- }
-
- outputChar = convSingleByte(byte1);
-
- if (outputChar == REPLACE_CHAR) { // Multibyte char
- if ((byte1 & 0xff) == 0x8F) { // JIS0212
- if (byteOff + inputSize + 1 >= inEnd) {
- // split in the middle of a character
- // save the first 2 bytes for next time around
- savedByte = (byte) byte1;
- byteOff += inputSize;
- if (byteOff < inEnd) {
- savedSecond = input[byteOff];
- byteOff++;
- }
- break;
- }
- if (savedSecond != 0) {
- byte1 = savedSecond & 0xff;
- savedSecond = 0;
- } else {
- byte1 = input[byteOff + inputSize] & 0xff;
- inputSize++;
- }
- byte2 = input[byteOff + inputSize] & 0xff;
- inputSize++;
- outputChar = decode0212(byte1-0x80, byte2-0x80);
- } else { // JIS0208
- if (byteOff + inputSize >= inEnd) {
- // split in the middle of a character
- // save the first byte for next time around
- savedByte = (byte) byte1;
- byteOff += inputSize;
- break;
- }
- byte1 &= 0xff;
- byte2 = input[byteOff + inputSize] & 0xff;
- inputSize++;
- outputChar = getUnicode(byte1, byte2);
- }
- }
-
- if (outputChar == REPLACE_CHAR) {
- if (subMode)
- outputChar = subChars[0];
- else {
- badInputLength = inputSize;
- throw new UnknownCharacterException();
- }
- }
-
- if (charOff >= outEnd)
- throw new ConversionBufferFullException();
-
- output[charOff++] = outputChar;
- byteOff += inputSize;
- }
-
- return charOff - outOff;
- }
-
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharEUC_JP_LINUX.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,190 +0,0 @@
-/*
- * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-/**
- * Class for converting bytes to characters for the EUC-JP encoding in
- * linux. This converter supports the JIS0201 and the JIS0208 encoding and
- * omits support for the JIS212 encoding.
- *
- * @author Naveen Sanjeeva
- */
-
-public class ByteToCharEUC_JP_LINUX extends ByteToCharJIS0208 {
- private byte savedSecond = 0;
- ByteToCharJIS0201 bcJIS0201 = new ByteToCharJIS0201();
-
- public ByteToCharEUC_JP_LINUX() {
- super();
- start = 0xA1;
- end = 0xFE;
- savedSecond = 0;
- }
-
- public int flush(char[] output, int outStart, int outEnd)
- throws MalformedInputException
- {
- if (savedSecond != 0) {
- reset();
- throw new MalformedInputException();
- }
- reset();
- return 0;
- }
-
- /**
- * Resets the converter.
- * Call this method to reset the converter to its initial state
- */
- public void reset() {
- super.reset();
- savedSecond = 0;
- }
-
- public String getCharacterEncoding() {
- return "EUC_JP_LINUX";
- }
-
- protected char convSingleByte(int b) {
- if (b < 0 || b > 0x7F)
- return REPLACE_CHAR;
- return bcJIS0201.getUnicode(b);
- }
-
- protected char getUnicode(int byte1, int byte2) {
- if (byte1 == 0x8E) {
- return bcJIS0201.getUnicode(byte2 - 256);
- }
- // Fix for bug 4121358 - similar fix for bug 4117820 put
- // into ByteToCharDoubleByte.getUnicode()
- if (((byte1 < 0) || (byte1 > index1.length))
- || ((byte2 < start) || (byte2 > end)))
- return REPLACE_CHAR;
-
- int n = (index1[byte1 - 0x80] & 0xf) * (end - start + 1)
- + (byte2 - start);
- return index2[index1[byte1 - 0x80] >> 4].charAt(n);
- }
-
- /**
- * Converts sequences of bytes to characters.
- * Conversions that result in Exceptions can be restarted by calling
- * convert again, with appropriately modified parameters.
- * @return the characters written to output.
- * @param input byte array containing text in Double/single Byte
- * @param inStart offset in input array
- * @param inEnd offset of last byte to be converted
- * @param output character array to receive conversion result
- * @param outStart starting offset
- * @param outEnd offset of last byte to be written to
- * @throw UnsupportedCharacterException for any bytes
- * that cannot be converted to the external character set.
- */
- public int convert(byte[] input, int inOff, int inEnd,
- char[] output, int outOff, int outEnd)
- throws UnknownCharacterException,
- ConversionBufferFullException
- {
- char outputChar = REPLACE_CHAR;
- int inputSize = 0; // Size of input
-
- // Record beginning offsets
- charOff = outOff;
- byteOff = inOff;
-
- // Loop until we hit the end of the input
- while (byteOff < inEnd) {
- int byte1, byte2;
-
- if (savedByte == 0) {
- byte1 = input[byteOff];
- inputSize = 1;
- } else {
- byte1 = savedByte;
- savedByte = 0;
- inputSize = 0;
- }
-
- outputChar = convSingleByte(byte1);
-
- if (outputChar == REPLACE_CHAR) { // Multibyte char
- if ((byte1 & 0xff) != 0x8F) { // JIS0208
- if (byteOff + inputSize >= inEnd) {
- // split in the middle of a character
- // save the first byte for next time around
- savedByte = (byte) byte1;
- byteOff += inputSize;
- break;
- }
- byte1 &= 0xff;
- byte2 = input[byteOff + inputSize] & 0xff;
- inputSize++;
- outputChar = getUnicode(byte1, byte2);
- } else if ((byte1 & 0xff) == 0x8F) { // JIS0212
- // Handling of 3-byte sequences for this converter involves
- // just ignoring the relevant bytes and returning a
- // suitable substitute char if one exists.
- if (byteOff + inputSize + 1 >= inEnd) {
- // split in the middle of a character
- // save the first 2 bytes for next time around
- savedByte = (byte) byte1;
- byteOff += inputSize;
- if (byteOff < inEnd) {
- savedSecond = input[byteOff];
- byteOff++;
- }
- break;
- }
-
- // Skip over the saved bytes if any
- if (savedSecond != 0) {
- savedSecond = 0;
- } else {
- inputSize++;
- }
- inputSize++;
- }
- }
-
- if (outputChar == REPLACE_CHAR) {
- if (subMode)
- outputChar = subChars[0];
- else {
- badInputLength = inputSize;
- throw new UnknownCharacterException();
- }
- }
-
- if (charOff >= outEnd)
- throw new ConversionBufferFullException();
-
- output[charOff++] = outputChar;
- byteOff += inputSize;
- }
-
- return charOff - outOff;
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharEUC_JP_Solaris.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,209 +0,0 @@
-/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.JIS_X_0208_Solaris_Decoder;
-import sun.nio.cs.ext.JIS_X_0212_Solaris_Decoder;
-/**
- *
- * @author Limin Shi
- * @author Ian Little
- *
- * EUC_JP variant converter for Solaris with vendor defined chars
- * added (4765370)
- */
-
-
-public class ByteToCharEUC_JP_Solaris extends ByteToCharEUC_JP {
- private byte savedSecond = 0;
-
- ByteToCharJIS0201 bcJIS0201 = new ByteToCharJIS0201();
- ByteToCharJIS0212_Solaris bcJIS0212 = new ByteToCharJIS0212_Solaris();
-
- short[] j0208Index1 = JIS_X_0208_Solaris_Decoder.getIndex1();
- String[] j0208Index2 = JIS_X_0208_Solaris_Decoder.getIndex2();
- ByteToCharJIS0212_Solaris j0212Decoder = new ByteToCharJIS0212_Solaris();
-
- public ByteToCharEUC_JP_Solaris() {
- super();
- start = 0xA1;
- end = 0xFE;
- savedSecond = 0;
- }
-
- public int flush(char[] output, int outStart, int outEnd)
- throws MalformedInputException
- {
- if (savedSecond != 0) {
- reset();
- throw new MalformedInputException();
- }
- reset();
- return 0;
- }
-
- /**
- * Resets the converter.
- * Call this method to reset the converter to its initial state
- */
- public void reset() {
- super.reset();
- savedSecond = 0;
- }
-
- public String getCharacterEncoding() {
- return "eucJP-open";
- }
-
- protected char convSingleByte(int b) {
- if (b < 0 || b > 0x7F)
- return REPLACE_CHAR;
- return bcJIS0201.getUnicode(b);
- }
-
- protected char getUnicode(int byte1, int byte2) {
- if (byte1 == 0x8E) {
- return bcJIS0201.getUnicode(byte2 - 256);
- }
- // Fix for bug 4121358 - similar fix for bug 4117820 put
- // into ByteToCharDoubleByte.getUnicode()
- if (((byte1 < 0) || (byte1 > j0208Index1.length))
- || ((byte2 < start) || (byte2 > end)))
- return REPLACE_CHAR;
-
- char result = super.getUnicode(byte1, byte2);
- if (result != '\uFFFD') {
- return result;
- } else {
- int n = (j0208Index1[byte1 - 0x80] & 0xf) * (end - start + 1)
- + (byte2 - start);
- return j0208Index2[j0208Index1[byte1 - 0x80] >> 4].charAt(n);
- }
- }
-
- protected char decode0212(int byte1, int byte2) {
- return j0212Decoder.getUnicode(byte1, byte2);
- }
-
- /**
- * Converts sequences of bytes to characters.
- * Conversions that result in Exceptions can be restarted by calling
- * convert again, with appropriately modified parameters.
- * @return the characters written to output.
- * @param input byte array containing text in Double/single Byte
- * @param inStart offset in input array
- * @param inEnd offset of last byte to be converted
- * @param output character array to receive conversion result
- * @param outStart starting offset
- * @param outEnd offset of last byte to be written to
- * @throw UnsupportedCharacterException for any bytes
- * that cannot be converted to the external character set.
- */
- public int convert(byte[] input, int inOff, int inEnd,
- char[] output, int outOff, int outEnd)
- throws UnknownCharacterException,
- ConversionBufferFullException
- {
- char outputChar = REPLACE_CHAR;
- int inputSize = 0; // Size of input
-
- // Record beginning offsets
- charOff = outOff;
- byteOff = inOff;
-
- // Loop until we hit the end of the input
- while (byteOff < inEnd) {
- int byte1, byte2;
-
- if (savedByte == 0) {
- byte1 = input[byteOff];
- inputSize = 1;
- } else {
- byte1 = savedByte;
- savedByte = 0;
- inputSize = 0;
- }
-
- outputChar = convSingleByte(byte1);
-
- if (outputChar == REPLACE_CHAR) { // Multibyte char
- if ((byte1 & 0xff) == 0x8F) { // JIS0212
- if (byteOff + inputSize + 1 >= inEnd) {
- // split in the middle of a character
- // save the first 2 bytes for next time around
- savedByte = (byte) byte1;
- byteOff += inputSize;
- if (byteOff < inEnd) {
- savedSecond = input[byteOff];
- byteOff++;
- }
- break;
- }
- if (savedSecond != 0) {
- byte1 = savedSecond & 0xff;
- savedSecond = 0;
- } else {
- byte1 = input[byteOff + inputSize] & 0xff;
- inputSize++;
- }
- byte2 = input[byteOff + inputSize] & 0xff;
- inputSize++;
- outputChar = bcJIS0212.getUnicode(byte1-0x80, byte2-0x80);
- } else { // JIS0208
- if (byteOff + inputSize >= inEnd) {
- // split in the middle of a character
- // save the first byte for next time around
- savedByte = (byte) byte1;
- byteOff += inputSize;
- break;
- }
- byte1 &= 0xff;
- byte2 = input[byteOff + inputSize] & 0xff;
- inputSize++;
- outputChar = getUnicode(byte1, byte2);
- }
- }
-
- if (outputChar == REPLACE_CHAR) {
- if (subMode)
- outputChar = subChars[0];
- else {
- badInputLength = inputSize;
- throw new UnknownCharacterException();
- }
- }
-
- if (charOff >= outEnd)
- throw new ConversionBufferFullException();
-
- output[charOff++] = outputChar;
- byteOff += inputSize;
- }
-
- return charOff - outOff;
- }
-
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharEUC_KR.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class ByteToCharEUC_KR extends ByteToCharDBCS_ASCII {
-
- private static DoubleByte.Decoder dec =
- (DoubleByte.Decoder)new EUC_KR().newDecoder();
-
- public String getCharacterEncoding() {
- return "EUC_KR";
- }
-
- public ByteToCharEUC_KR() {
- super(dec);
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharEUC_TW.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,176 +0,0 @@
-/*
- * Copyright (c) 1996, 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.EUC_TW;
-
-/*
- * @author Limin Shi
- */
-public class ByteToCharEUC_TW extends ByteToCharConverter
-{
- private final byte G0 = 0;
- private final byte G1 = 1;
- private final byte G2 = 2;
- private final byte G3 = 3;
- private final byte G4 = 4;
- private final byte MSB = (byte) 0x80;
- private final byte SS2 = (byte) 0x8E;
-
- private byte firstByte = 0, state = G0;
- private int cnsPlane = 0;
-
- private EUC_TW.Decoder dec = (EUC_TW.Decoder)(new EUC_TW().newDecoder());
-
- public ByteToCharEUC_TW() {
- }
-
- public int flush(char[] output, int outStart, int outEnd)
- throws MalformedInputException
- {
- if (state != G0) {
- state = G0;
- firstByte = 0;
- badInputLength = 0;
- throw new MalformedInputException();
- }
- reset();
- return 0;
- }
-
- public void reset() {
- dec.reset();
- state = G0;
- firstByte = 0;
- byteOff = charOff = 0;
- }
-
- /**
- * Character conversion
- */
- public int convert(byte[] input, int inOff, int inEnd,
- char[] output, int outOff, int outEnd)
- throws UnknownCharacterException, MalformedInputException,
- ConversionBufferFullException
- {
- int inputSize = 0;
- char[] c1 = new char[1];
-
- byteOff = inOff;
- charOff = outOff;
-
- cnsPlane = 3;
- while (byteOff < inEnd) {
- if (charOff >= outEnd)
- throw new ConversionBufferFullException();
- char[] outputChar = null;
- switch (state) {
- case G0:
- if ( (input[byteOff] & MSB) == 0) { // ASCII
- outputChar = c1;
- outputChar[0] = (char) input[byteOff];
- } else if (input[byteOff] == SS2) { // Codeset 2
- state = G2;
- } else { // Codeset 1
- firstByte = input[byteOff];
- state = G1;
- }
- break;
- case G1:
- inputSize = 2;
- if ( (input[byteOff] & MSB) != 0) { // 2nd byte
- cnsPlane = 0;
- outputChar = dec.toUnicode(firstByte & 0xff,
- input[byteOff] & 0xff,
- cnsPlane);
- } else { // Error
- badInputLength = 1;
- throw new MalformedInputException();
- }
- firstByte = 0;
- state = G0;
- break;
- case G2:
- cnsPlane = (input[byteOff] & (byte)0x0f);
- // Adjust String array index for plan 15
- cnsPlane = (cnsPlane == 15)? 8 : cnsPlane;
-
- if (cnsPlane < 15) {
- state = G3;
- } else {
- badInputLength = 2;
- throw new MalformedInputException();
- }
-
- break;
- case G3:
- if ( (input[byteOff] & MSB) != 0) { // 1st byte
- firstByte = input[byteOff];
- state = G4;
- } else { // Error
- state = G0;
- badInputLength = 2;
- throw new MalformedInputException();
- }
- break;
- case G4:
- if ( (input[byteOff] & MSB) != 0) { // 2nd byte
- outputChar = dec.toUnicode(firstByte & 0xff,
- input[byteOff] & 0xff,
- cnsPlane - 1);
- } else { // Error
- badInputLength = 3;
- throw new MalformedInputException();
- }
- firstByte = 0;
- state = G0;
- break;
- }
- byteOff++;
- if (state == G0) {
- if (outputChar == null) {
- if (subMode) { // substitution enabled
- outputChar = c1;
- outputChar[0] = subChars[0];
- } else {
- badInputLength = inputSize;
- throw new UnknownCharacterException();
- }
- }
- output[charOff++] = outputChar[0];
- }
- }
- return charOff - outOff;
- }
-
-
- /**
- * Return the character set ID
- */
- public String getCharacterEncoding() {
- return "EUC_TW";
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharGB18030.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,300 +0,0 @@
-/*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.GB18030;
-
-public class ByteToCharGB18030 extends ByteToCharGB18030DB {
-
- private static final int GB18030_SINGLE_BYTE = 1;
- private static final int GB18030_DOUBLE_BYTE = 2;
- private static final int GB18030_FOUR_BYTE = 3;
- private static short[] decoderIndex1;
- private static String[] decoderIndex2;
-
- private int currentState;
- private int savedSize;
- private byte[] savedBytes;
-
- public ByteToCharGB18030() {
- super();
- GB18030 nioCoder = new GB18030();
- savedBytes = new byte[3];
- currentState = GB18030_DOUBLE_BYTE;
- decoderIndex1 = nioCoder.getDecoderIndex1();
- decoderIndex2 = nioCoder.getDecoderIndex2();
- savedSize = 0;
- }
-
- public short[] getOuter() {
- return(index1);
- }
-
- public String[] getInner() {
- return(index2);
- }
-
- public short[] getDBIndex1() {
- return(super.index1);
- }
-
- public String[] getDBIndex2() {
- return(super.index2);
- }
-
- public int flush(char [] output, int outStart, int outEnd)
- throws MalformedInputException
- {
- if (savedSize != 0) {
- savedSize = 0;
- currentState = GB18030_DOUBLE_BYTE;
- badInputLength = 0;
- throw new MalformedInputException();
- }
- byteOff = charOff = 0;
- return 0;
- }
-
-
- /**
- * Character conversion
- */
- public int convert(byte[] input, int inOff, int inEnd,
- char[] output, int outOff, int outEnd)
- throws UnknownCharacterException, MalformedInputException,
- ConversionBufferFullException
- {
- int inputSize = 0;
- char outputChar = '\uFFFD';
- // readOff keeps the actual buffer's pointer.
- // byteOff keeps original buffer's pointer.
- int readOff = byteOff = inOff;
-
- if (savedSize != 0) {
- // Filter illegal bytes when they are detected in saved
- // partial input from a previous conversion attempt.
- if (((savedBytes[0] & 0xFF) < 0x81 || savedBytes[0] > 0xFE) ||
- (savedSize > 1 &&
- (savedBytes[1] & 0xFF) < 0x30 ) ||
- (savedSize > 2 &&
- ((savedBytes[2] & 0xFF) < 0x81 ||
- (savedBytes[2] & 0xFF) > 0xFE ))) {
- badInputLength = 0;
- throw new MalformedInputException();
- }
-
- byte[] newBuf = new byte[inEnd - inOff + savedSize];
- for (int i = 0; i < savedSize; i++) {
- newBuf[i] = savedBytes[i];
- }
- System.arraycopy(input, inOff, newBuf, savedSize, inEnd - inOff);
- byteOff -= savedSize;
- input = newBuf;
- inOff = 0;
- inEnd = newBuf.length;
- savedSize = 0;
- }
-
- charOff = outOff;
- readOff = inOff;
-
- while(readOff < inEnd) {
- int byte1 = 0 , byte2 = 0, byte3 = 0, byte4 = 0;
-
- // Is there room in the output buffer for the result?
- if (charOff >= outEnd) {
- throw new ConversionBufferFullException();
- }
-
- // Get the input byte
- byte1 = input[readOff++] & 0xFF;
- inputSize = 1;
-
- if ((byte1 & (byte)0x80) == 0){ // US-ASCII range
- outputChar = (char)byte1;
- currentState = GB18030_SINGLE_BYTE;
- }
-
- else if (byte1 < 0x81 || byte1 > 0xfe) {
- if (subMode)
- outputChar = subChars[0];
- else {
- badInputLength = 1;
- throw new UnknownCharacterException();
- }
- }
- else {
- // Either 2 or 4 byte sequence follows
- // If an underrun is detected save for later
- // replay.
-
- if (readOff + inputSize > inEnd) {
- savedBytes[0]=(byte)byte1;
- savedSize = 1;
- break;
- }
-
- byte2 = input[readOff++] & 0xFF;
- inputSize = 2;
-
- if (byte2 < 0x30) {
- badInputLength = 1;
- throw new MalformedInputException();
- }
- else if (byte2 >= 0x30 && byte2 <= 0x39) {
- currentState = GB18030_FOUR_BYTE;
- inputSize = 4;
-
- if (readOff + 2 > inEnd) {
- if (readOff + 1 > inEnd) {
- savedBytes[0] = (byte)byte1;
- savedBytes[1] = (byte)byte2;
- savedSize = 2;
- }
- else {
- savedBytes[0] = (byte)byte1;
- savedBytes[1] = (byte)byte2;
- savedBytes[2] = input[readOff++];
- savedSize = 3;
- }
- break;
- }
- byte3 = input[readOff++] & 0xFF;
- if (byte3 < 0x81 || byte3 > 0xfe) {
- badInputLength = 3;
- throw new MalformedInputException();
- }
-
- byte4 = input[readOff++] & 0xFF;
-
- if (byte4 < 0x30 || byte4 > 0x39) {
- badInputLength = 4;
- throw new MalformedInputException();
- }
- }
- else if (byte2 == 0x7f || byte2 == 0xff ||
- (byte2 < 0x40 )) {
- badInputLength = 2;
- throw new MalformedInputException();
- }
- else
- currentState = GB18030_DOUBLE_BYTE;
- }
-
- switch (currentState){
- case GB18030_SINGLE_BYTE:
- output[charOff++] = (char)(byte1);
- break;
- case GB18030_DOUBLE_BYTE:
- output[charOff++] = super.getUnicode(byte1, byte2);
- break;
- case GB18030_FOUR_BYTE:
- int offset = (((byte1 - 0x81) * 10 +
- (byte2 - 0x30)) * 126 +
- byte3 - 0x81) * 10 + byte4 - 0x30;
- int hiByte = (offset >>8) & 0xFF;
- int lowByte = (offset & 0xFF);
-
- // Mixture of table lookups and algorithmic calculation
- // of character values.
-
- // BMP Ranges
-
- if (offset <= 0x4A62)
- output[charOff++] = getChar(offset);
- else if (offset > 0x4A62 && offset <= 0x82BC)
- output[charOff++] = (char) (offset + 0x5543);
- else if (offset >= 0x82BD && offset <= 0x830D)
- output[charOff++] = getChar(offset);
- else if (offset >= 0x830D && offset <= 0x93A8)
- output[charOff++] = (char) (offset + 0x6557);
- else if (offset >= 0x93A9 && offset <= 0x99FB)
- output[charOff++] = getChar(offset);
- // Supplemental UCS planes handled via surrogates
- else if (offset >= 0x2E248 && offset < 0x12E248) {
- if (offset >= 0x12E248) {
- if (subMode)
- return subChars[0];
- else {
- badInputLength = 4;
- throw new UnknownCharacterException();
- }
- }
-
- if (charOff +2 > outEnd) {
- throw new ConversionBufferFullException();
- }
- offset -= 0x1e248;
- char highSurr = (char) ((offset - 0x10000) / 0x400 + 0xD800);
- char lowSurr = (char) ((offset - 0x10000) % 0x400 + 0xDC00);
- output[charOff++] = highSurr;
- output[charOff++] = lowSurr;
- }
- else {
- badInputLength = 4;
- throw new MalformedInputException();
- }
- break;
- }
- byteOff += inputSize;
- }
-
- byteOff += savedSize;
- return charOff - outOff;
- }
-
- public void reset() {
- byteOff = charOff = 0;
- currentState = GB18030_DOUBLE_BYTE;
- savedSize = 0;
- }
-
- public String getCharacterEncoding() {
- return "GB18030";
- }
-
- private char getChar(int offset) throws UnknownCharacterException {
- int byte1 = (offset >>8) & 0xFF;
- int byte2 = (offset & 0xFF);
- int start = 0, end = 0xFF;
-
- if (((byte1 < 0) || (byte1 > getOuter().length))
- || ((byte2 < start) || (byte2 > end))) {
- if (subMode)
- return subChars[0];
- else {
- badInputLength = 1;
- throw new UnknownCharacterException();
- }
- }
-
- int n = (decoderIndex1[byte1] & 0xf) * (end - start + 1) + (byte2 - start);
- return decoderIndex2[decoderIndex1[byte1] >> 4].charAt(n);
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharGB18030DB.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.GB18030;
-
-
-/**
- * Tables and data to convert the two-byte portion of GB18030 to Unicode
- * The class is package level accessibility as it is just used for the
- * convenience of the main GB18030 converter.
- *
- * @author ConverterGenerator tool
- */
-
-abstract class ByteToCharGB18030DB extends ByteToCharDoubleByte {
-
- public String getCharacterEncoding() {
- return "ByteToCharGB18030DB";
- }
-
- public ByteToCharGB18030DB() {
- GB18030 nioCoder = new GB18030();
- super.index1 = nioCoder.getSubDecoderIndex1();
- super.index2 = nioCoder.getSubDecoderIndex2();
- start = 0x40;
- end = 0xFE;
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharGBK.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class ByteToCharGBK extends ByteToCharDBCS_ASCII {
-
- private static DoubleByte.Decoder dec =
- (DoubleByte.Decoder)new GBK().newDecoder();
-
- public String getCharacterEncoding() {
- return "GBK";
- }
-
- public ByteToCharGBK() {
- super(dec);
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharISCII91.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,233 +0,0 @@
-/*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.ISCII91;
-
-/*
- * Copyright (c) 1998 International Business Machines.
- * All Rights Reserved.
- *
- * Author : Sunanda Bera, C. Thirumalesh
- * Last Modified : 23,November,1998
- *
- * Purpose : Defines class ByteToCharISCII91.
- *
- *
- * Revision History
- * ======== =======
- *
- * Date By Description
- * ---- -- -----------
- *
- *
- */
-
-/**
- * Converter class. Converts between Unicode encoding and ISCII91 encoding.
- * ISCII91 is the character encoding as defined in Indian Standard document
- * IS 13194:1991 ( Indian Script Code for Information Interchange ).
- *
- * @see sun.io.ByteToCharConverter
- */
-public class ByteToCharISCII91 extends ByteToCharConverter {
-
- private static final char[] directMapTable = ISCII91.getDirectMapTable();
-
- private static final char NUKTA_CHAR = '\u093c';
- private static final char HALANT_CHAR = '\u094d';
- private static final char ZWNJ_CHAR = '\u200c';
- private static final char ZWJ_CHAR = '\u200d';
- private static final char INVALID_CHAR = '\uffff';
-
- private char contextChar = INVALID_CHAR;
- private boolean needFlushing = false;
-
-/**
- * Converts ISCII91 characters to Unicode.
- * @see sun.io.ByteToCharConverter#convert
- */
- public int convert(byte input[], int inStart, int inEnd,
- char output[], int outStart, int outEnd)
- throws ConversionBufferFullException, UnknownCharacterException {
- /*Rules:
- * 1)ATR,EXT,following character to be replaced with '\ufffd'
- * 2)Halant + Halant => '\u094d' (Virama) + '\u200c'(ZWNJ)
- * 3)Halant + Nukta => '\u094d' (Virama) + '\u200d'(ZWJ)
- */
- charOff = outStart;
- byteOff = inStart;
- while (byteOff < inEnd) {
- if (charOff >= outEnd) {
- throw new ConversionBufferFullException();
- }
- int index = input[byteOff++];
- index = ( index < 0 )? ( index + 255 ):index;
- char currentChar = directMapTable[index];
-
- // if the contextChar is either ATR || EXT set the output to '\ufffd'
- if(contextChar == '\ufffd') {
- output[charOff++] = '\ufffd';
- contextChar = INVALID_CHAR;
- needFlushing = false;
- continue;
- }
-
- switch(currentChar) {
- case '\u0901':
- case '\u0907':
- case '\u0908':
- case '\u090b':
- case '\u093f':
- case '\u0940':
- case '\u0943':
- case '\u0964':
- if(needFlushing) {
- output[charOff++] = contextChar;
- contextChar = currentChar;
- continue;
- }
- contextChar = currentChar;
- needFlushing = true;
- continue;
- case NUKTA_CHAR:
- switch(contextChar) {
- case '\u0901':
- output[charOff] = '\u0950';
- break;
- case '\u0907':
- output[charOff] = '\u090c';
- break;
- case '\u0908':
- output[charOff] = '\u0961';
- break;
- case '\u090b':
- output[charOff] = '\u0960';
- break;
- case '\u093f':
- output[charOff] = '\u0962';
- break;
- case '\u0940':
- output[charOff] = '\u0963';
- break;
- case '\u0943':
- output[charOff] = '\u0944';
- break;
- case '\u0964':
- output[charOff] = '\u093d';
- break;
- case HALANT_CHAR:
- if(needFlushing) {
- output[charOff++] = contextChar;
- contextChar = currentChar;
- continue;
- }
- output[charOff] = ZWJ_CHAR;
- break;
- default:
- if(needFlushing) {
- output[charOff++] = contextChar;
- contextChar = currentChar;
- continue;
- }
- output[charOff] = NUKTA_CHAR;
- }
- break;
- case HALANT_CHAR:
- if(needFlushing) {
- output[charOff++] = contextChar;
- contextChar = currentChar;
- continue;
- }
- if(contextChar == HALANT_CHAR) {
- output[charOff] = ZWNJ_CHAR;
- break;
- }
- output[charOff] = HALANT_CHAR;
- break;
- case INVALID_CHAR:
- if(needFlushing) {
- output[charOff++] = contextChar;
- contextChar = currentChar;
- continue;
- }
- if(subMode) {
- output[charOff] = subChars[0];
- break;
- } else {
- contextChar = INVALID_CHAR;
- throw new UnknownCharacterException();
- }
- default:
- if(needFlushing) {
- output[charOff++] = contextChar;
- contextChar = currentChar;
- continue;
- }
- output[charOff] = currentChar;
- break;
- }//end switch
-
- contextChar = currentChar;
- needFlushing = false;
- charOff++;
- }//end while
- return charOff - outStart;
- } //convert()
-
-/**
- * @see sun.io.ByteToCharConverter#flush
- */
- public int flush( char[] output, int outStart, int outEnd )
- throws MalformedInputException, ConversionBufferFullException
- {
- int charsWritten = 0;
- //if the last char was not flushed, flush it!
- if(needFlushing) {
- output[outStart] = contextChar;
- charsWritten = 1;
- }
- contextChar = INVALID_CHAR;
- needFlushing = false;
- byteOff = charOff = 0;
- return charsWritten;
- }//flush()
-/**
- * Returns the character set id for the conversion.
- */
- public String getCharacterEncoding()
- {
- return "ISCII91";
- }//getCharacterEncoding()
-/**
- * @see sun.io.ByteToCharConverter#reset
- */
- public void reset()
- {
- byteOff = charOff = 0;
- }//reset()
-
-}//end of class definition
--- a/jdk/src/share/classes/sun/io/ByteToCharISO2022.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,276 +0,0 @@
-/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-/**
- * An algorithmic conversion from ISO 2022 to Unicode
- *
- * @author Tom Zhou
- */
-public abstract class ByteToCharISO2022 extends ByteToCharConverter
-{
- // Value to be filled by subclass
- protected String SODesignator[];
- protected String SS2Designator[] = null;
- protected String SS3Designator[] = null;
-
- protected ByteToCharConverter SOConverter[];
- protected ByteToCharConverter SS2Converter[] = null;
- protected ByteToCharConverter SS3Converter[] = null;
-
- private static final byte ISO_ESC = 0x1b;
- private static final byte ISO_SI = 0x0f;
- private static final byte ISO_SO = 0x0e;
- private static final byte ISO_SS2_7 = 0x4e;
- private static final byte ISO_SS3_7 = 0x4f;
- private static final byte MSB = (byte)0x80;
- private static final char REPLACE_CHAR = '\uFFFD';
- private static final byte maximumDesignatorLength = 3;
-
- private static final byte SOFlag = 0;
- private static final byte SS2Flag = 1;
- private static final byte SS3Flag = 2;
- private static final byte G0 = 0;
- private static final byte G1 = 1;
-
- private ByteToCharConverter tmpConverter[];
-
- private int curSODes, curSS2Des, curSS3Des;
- private boolean shiftout;
-
- private byte remainByte[] = new byte[10];
- private int remainIndex = -1;
- private byte state, firstByte;
-
- public void reset()
- {
- int i = 0;
-
- shiftout = false;
- state = G0;
- firstByte = 0;
-
- curSODes = 0;
- curSS2Des = 0;
- curSS3Des = 0;
-
- charOff = byteOff = 0;
- remainIndex = -1;
-
- for(i = 0; i < remainByte.length; i++)
- remainByte[i] = 0;
- }
-
- public int flush(char[] output, int outStart, int outEnd)
- throws MalformedInputException
- {
- int i;
- if (state != G0) {
- badInputLength = 0;
- throw new MalformedInputException();
- }
- reset();
- return 0;
- }
-
- private byte[] savetyGetSrc(byte[] input, int inOff, int inEnd, int nbytes)
- {
- int i;
- byte tmp[];
-
- if(inOff <= (inEnd-nbytes+1))
- tmp = new byte[nbytes];
- else
- tmp = new byte[inEnd-inOff];
-
- for(i = 0; i < tmp.length; i++)
- tmp[i] = input[inOff+i];
- return tmp;
- }
-
- private char getUnicode(byte byte1, byte byte2, byte shiftFlag)
- {
- byte1 |= MSB;
- byte2 |= MSB;
-
- byte[] tmpByte = {byte1,byte2};
- char[] tmpChar = new char[1];
- int i = 0,
- tmpIndex = 0;
-
- switch(shiftFlag) {
- case SOFlag:
- tmpIndex = curSODes;
- tmpConverter = SOConverter;
- break;
- case SS2Flag:
- tmpIndex = curSS2Des;
- tmpConverter = SS2Converter;
- break;
- case SS3Flag:
- tmpIndex = curSS3Des;
- tmpConverter = SS3Converter;
- break;
- }
-
- for(i = 0; i < tmpConverter.length; i++) {
- if(tmpIndex == i) {
- try {
- tmpConverter[i].convert(tmpByte, 0, 2, tmpChar, 0, 1);
- } catch (Exception e) {}
- return tmpChar[0];
- }
- }
- return REPLACE_CHAR;
- }
-
- public final int convert(byte[] input, int inOff, int inEnd,
- char[] output, int outOff, int outEnd)
- throws ConversionBufferFullException,
- MalformedInputException
- {
- int i;
- int DesignatorLength = 0;
- charOff = outOff;
- byteOff = inOff;
-
- // Loop until we hit the end of the input
- while (byteOff < inEnd) {
- // If we don't have room for the output, throw an exception
- if (charOff >= outEnd)
- throw new ConversionBufferFullException();
- if(remainIndex < 0) {
- remainByte[0] = input[byteOff];
- remainIndex = 0;
- byteOff++;
- }
- switch (remainByte[0]) {
- case ISO_SO:
- shiftout = true;
- if(remainIndex > 0)
- System.arraycopy(remainByte, 1, remainByte, 0, remainIndex);
- remainIndex--;
- break;
- case ISO_SI:
- shiftout = false;
- if(remainIndex > 0)
- System.arraycopy(remainByte, 1, remainByte, 0, remainIndex);
- remainIndex--;
- break;
- case ISO_ESC:
- byte tmp[] = savetyGetSrc(input, byteOff, inEnd,
- (maximumDesignatorLength-remainIndex));
- System.arraycopy(tmp, 0, remainByte, remainIndex+1, tmp.length);
- remainIndex += tmp.length;
- byteOff += tmp.length;
- if(tmp.length<(maximumDesignatorLength-remainIndex))
- break;
- String tmpString = new String(remainByte, 1, remainIndex);
- for (i = 0; i < SODesignator.length; i++) {
- if(tmpString.indexOf(SODesignator[i]) == 0) {
- curSODes = i;
- DesignatorLength = SODesignator[i].length();
- break;
- }
- }
-
- if (DesignatorLength == 0 ) { // Designator not recognized
- badInputLength = tmp.length;
- throw new MalformedInputException();
- }
-
- if (i == SODesignator.length) {
- for (i = 0; i < SS2Designator.length; i++) {
- if(tmpString.indexOf(SS2Designator[i]) == 0) {
- curSS2Des = i;
- DesignatorLength = SS2Designator[i].length();
- break;
- }
- }
- if(i == SS2Designator.length) {
- for(i = 0; i < SS3Designator.length; i++) {
- if (tmpString.indexOf(SS3Designator[i]) == 0) {
- curSS3Des = i;
- DesignatorLength = SS3Designator[i].length();
- break;
- }
- }
- if (i == SS3Designator.length) {
- switch(remainByte[1]) {
- case ISO_SS2_7:
- output[charOff] = getUnicode(remainByte[2],
- remainByte[3],
- SS2Flag);
- charOff++;
- DesignatorLength = 3;
- break;
- case ISO_SS3_7:
- output[charOff] = getUnicode(remainByte[2],
- remainByte[3],
- SS3Flag);
- charOff++;
- DesignatorLength = 3;
- break;
- default:
- DesignatorLength = 0;
- }
- }
- }
- }
- if (remainIndex > DesignatorLength) {
- for(i = 0; i < remainIndex-DesignatorLength; i++)
- remainByte[i] = remainByte[DesignatorLength+1+i];
- remainIndex = i-1;
- } else {
- remainIndex = -1;
- }
- break;
- default:
- if (!shiftout) {
- output[charOff] = (char)remainByte[0];
- charOff++;
- } else {
- switch (state) {
- case G0:
- firstByte = remainByte[0];
- state = G1;
- break;
- case G1:
- output[charOff] = getUnicode(firstByte, remainByte[0],
- SOFlag);
- charOff++;
- state = G0;
- break;
- }
- }
- if (remainIndex > 0)
- System.arraycopy(remainByte, 1, remainByte, 0, remainIndex);
- remainIndex--;
- }
- }
- return charOff - outOff;
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharISO2022CN.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,300 +0,0 @@
-/*
- * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-/**
- * @author Tom Zhou
- */
-public class ByteToCharISO2022CN extends ByteToCharConverter
-{
- private String SODesignator[];
- private String SS2Designator[] = null;
- private String SS3Designator[] = null;
- private ByteToCharConverter SOConverter[];
- private ByteToCharConverter SS2Converter[] = null;
- private ByteToCharConverter SS3Converter[] = null;
-
- private static final byte ISO_ESC = 0x1b;
- private static final byte ISO_SI = 0x0f;
- private static final byte ISO_SO = 0x0e;
- private static final byte ISO_SS2_7 = 0x4e;
- private static final byte ISO_SS3_7 = 0x4f;
- private static final byte MSB = (byte)0x80;
- private static final char REPLACE_CHAR = '\uFFFD';
- private static final byte maximumDesignatorLength = 3;
-
- private static final byte SOFlag = 0;
- private static final byte SS2Flag = 1;
- private static final byte SS3Flag = 2;
- private static final byte G0 = 0;
- private static final byte G1 = 1;
-
- private ByteToCharConverter tmpConverter[];
-
- private int curSODes, curSS2Des, curSS3Des;
- private boolean shiftout;
-
- private byte remainByte[] = new byte[10];
- private int remainIndex = -1;
- private byte state, firstByte;
-
- public void reset()
- {
- int i = 0;
-
- shiftout = false;
- state = G0;
- firstByte = 0;
-
- curSODes = 0;
- curSS2Des = 0;
- curSS3Des = 0;
-
- charOff = byteOff = 0;
- remainIndex = -1;
-
- for(i = 0; i < remainByte.length; i++)
- remainByte[i] = 0;
- }
-
- public int flush(char[] output, int outStart, int outEnd)
- throws MalformedInputException
- {
- int i;
- if (state != G0) {
- badInputLength = 0;
- throw new MalformedInputException();
- }
- reset();
- return 0;
- }
-
- private byte[] savetyGetSrc(byte[] input, int inOff, int inEnd, int nbytes)
- {
- int i;
- byte tmp[];
-
- if(inOff <= (inEnd-nbytes+1))
- tmp = new byte[nbytes];
- else
- tmp = new byte[inEnd-inOff];
-
- for(i = 0; i < tmp.length; i++)
- tmp[i] = input[inOff+i];
- return tmp;
- }
-
- private char getUnicode(byte byte1, byte byte2, byte shiftFlag)
- {
- byte1 |= MSB;
- byte2 |= MSB;
- char[] tmpChar = new char[1];
-
- switch(shiftFlag) {
- case SOFlag:
- try {
- byte[] tmpByte = {byte1,byte2};
- SOConverter[curSODes].convert(tmpByte, 0, 2, tmpChar, 0, 1);
- }
- catch (Exception e) {}
- break;
- case SS2Flag:
- try {
- byte[] tmpByte = {(byte)0x8e, (byte)0xa2, byte1, byte2};
- SS2Converter[curSS2Des].convert(tmpByte, 0, 4, tmpChar, 0, 1);
- }
- catch (Exception e){}
- break;
- case SS3Flag:
- try {
- byte[] tmpByte = {(byte)0x8e, (byte)0xa3, byte1,byte2};
- SS3Converter[curSS3Des].convert(tmpByte, 0, 4, tmpChar, 0, 1);
- }
- catch (Exception e){}
- break;
- default:
- tmpChar[0] = REPLACE_CHAR;
- }
- return tmpChar[0];
- }
-
- public final int convert(byte[] input, int inOff, int inEnd,
- char[] output, int outOff, int outEnd)
- throws ConversionBufferFullException,
- MalformedInputException
- {
- int i;
- int DesignatorLength = 0;
- charOff = outOff;
- byteOff = inOff;
-
- // Loop until we hit the end of the input
- while (byteOff < inEnd) {
- // If we don't have room for the output, throw an exception
- if (charOff >= outEnd)
- throw new ConversionBufferFullException();
- if(remainIndex < 0) {
- remainByte[0] = input[byteOff];
- remainIndex = 0;
- byteOff++;
- }
- switch (remainByte[0]) {
- case ISO_SO:
- shiftout = true;
- if(remainIndex > 0)
- System.arraycopy(remainByte, 1, remainByte, 0, remainIndex);
- remainIndex--;
- break;
- case ISO_SI:
- shiftout = false;
- if(remainIndex > 0)
- System.arraycopy(remainByte, 1, remainByte, 0, remainIndex);
- remainIndex--;
- break;
- case ISO_ESC:
- byte tmp[] = savetyGetSrc(input, byteOff, inEnd,
- (maximumDesignatorLength-remainIndex));
- System.arraycopy(tmp, 0, remainByte, remainIndex+1, tmp.length);
-
- remainIndex += tmp.length;
- byteOff += tmp.length;
- if(tmp.length<(maximumDesignatorLength-remainIndex))
- break;
- String tmpString = new String(remainByte, 1, remainIndex);
- for (i = 0; i < SODesignator.length; i++) {
- if(tmpString.indexOf(SODesignator[i]) == 0) {
- curSODes = i;
- DesignatorLength = SODesignator[i].length();
- break;
- }
- }
-
- if (DesignatorLength == 0) { // designator not recognized
- badInputLength = tmp.length;
- throw new MalformedInputException();
- }
-
- if (i == SODesignator.length) {
- for (i = 0; i < SS2Designator.length; i++) {
- if(tmpString.indexOf(SS2Designator[i]) == 0) {
- curSS2Des = i;
- DesignatorLength = SS2Designator[i].length();
- break;
- }
- }
- if(i == SS2Designator.length) {
- for(i = 0; i < SS3Designator.length; i++) {
- if (tmpString.indexOf(SS3Designator[i]) == 0) {
- curSS3Des = i;
- DesignatorLength = SS3Designator[i].length();
- break;
- }
- }
- if (i == SS3Designator.length) {
- switch(remainByte[1]) {
- case ISO_SS2_7:
- output[charOff] = getUnicode(remainByte[2],
- remainByte[3],
- SS2Flag);
- charOff++;
- DesignatorLength = 3;
- break;
- case ISO_SS3_7:
- output[charOff] = getUnicode(remainByte[2],
- remainByte[3],
- SS3Flag);
- charOff++;
- DesignatorLength = 3;
- break;
- default:
- DesignatorLength = 0;
- }
- }
- }
- }
- if (remainIndex > DesignatorLength) {
- for(i = 0; i < remainIndex-DesignatorLength; i++)
- remainByte[i] = remainByte[DesignatorLength+1+i];
- remainIndex = i-1;
- } else {
- remainIndex = -1;
- }
- break;
- default:
- if (!shiftout) {
- output[charOff] = (char)remainByte[0];
- charOff++;
- } else {
- switch (state) {
- case G0:
- firstByte = remainByte[0];
- state = G1;
- break;
- case G1:
- output[charOff] = getUnicode(firstByte, remainByte[0],
- SOFlag);
- charOff++;
- state = G0;
- break;
- }
- }
- if (remainIndex > 0)
- System.arraycopy(remainByte, 1, remainByte, 0, remainIndex);
- remainIndex--;
- }
- }
- return charOff - outOff;
- }
-
- public ByteToCharISO2022CN()
- {
- SODesignator = new String[3];
- SODesignator[0] = "$A";
- SODesignator[1] = "$)A";
- SODesignator[2] = "$)G";
- SS2Designator = new String[1];
- SS2Designator[0] = "$*H";
- SS3Designator = new String[1];
- SS3Designator[0] = "$+I";
-
- SOConverter = new ByteToCharConverter[3];
- SS2Converter = new ByteToCharConverter[1];
- SS3Converter = new ByteToCharConverter[1];
-
- try {
- SOConverter[0] = SOConverter[1]
- = ByteToCharConverter.getConverter("GB2312");
- SOConverter[2] = SS2Converter[0] = SS3Converter[0]
- = ByteToCharConverter.getConverter("CNS11643");
- } catch (Exception e) {};
- }
-
- // Return the character set id
- public String getCharacterEncoding()
- {
- return "ISO2022CN";
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharISO2022JP.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,313 +0,0 @@
-/*
- * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-public class ByteToCharISO2022JP extends ByteToCharJIS0208 {
-
- private static final int ASCII = 0; // ESC ( B
- private static final int JISX0201_1976 = 1; // ESC ( J
- private static final int JISX0208_1978 = 2; // ESC $ @
- private static final int JISX0208_1983 = 3; // ESC $ B
- private static final int JISX0201_1976_KANA = 4; // ESC ( I
- private static final int SHIFTOUT = 5; // SO (0x0e)
-
- private int currentState;
- private int savedSize;
- private byte[] savedBytes;
-
- public ByteToCharISO2022JP() {
- super();
- savedBytes = new byte[2];
- currentState = ASCII;
- savedSize = 0;
- }
-
- public int flush(char [] output, int outStart, int outEnd)
- throws MalformedInputException
- {
- if (savedSize != 0) {
- savedSize = 0;
- currentState = ASCII;
- badInputLength = 0;
- throw new MalformedInputException();
- }
- byteOff = charOff = 0;
- return 0;
- }
-
-
- /**
- * Character conversion
- */
- public int convert(byte[] input, int inOff, int inEnd,
- char[] output, int outOff, int outEnd)
- throws UnknownCharacterException, MalformedInputException,
- ConversionBufferFullException
- {
- int previousState = ASCII;
- int inputSize = 0;
- char outputChar = '\uFFFD';
- // readOff keeps the actual buffer's pointer.
- // byteOff keeps original buffer's pointer.
- int readOff = byteOff = inOff;
-
- if (savedSize != 0) {
- if (savedBytes[0] == 0x1b) { // ESC
- if ((savedSize == 2 &&
- (savedBytes[1] == 0x28 &&
- input[0] != 'B' &&
- input[0] != 'J' &&
- input[0] != 'I') &&
- (savedBytes[1] == 0x24 &&
- input[0] != '@' &&
- input[0] != 'B')) ||
- ((savedSize == 1) &&
- (input[0] != 0x28 &&
- input[0] != 0x24))) {
- badInputLength = 0;
- throw new MalformedInputException();
- }
- if ((inEnd - inOff) == 1 && savedSize == 1 &&
- savedBytes[0] == 0x1b) {
- savedSize = 2;
- savedBytes[1] = input[0];
- byteOff++;
- return 0;
- }
- }
- byte[] newBuf = new byte[inEnd - inOff + savedSize];
- for (int i = 0; i < savedSize; i++) {
- newBuf[i] = savedBytes[i];
- }
- System.arraycopy(input, inOff, newBuf, savedSize, inEnd - inOff);
- byteOff -= savedSize;
- input = newBuf;
- inOff = 0;
- inEnd = newBuf.length;
- savedSize = 0;
- }
-
- charOff = outOff;
- readOff = inOff;
-
- while(readOff < inEnd) {
- int byte1, byte2, byte3;
- boolean noOutput = false;
-
- // Is there room in the output buffer for the result?
- if (charOff >= outEnd) {
- throw new ConversionBufferFullException();
- }
-
- // Get the input byte
- byte1 = input[readOff] & 0xFF;
- inputSize = 1;
-
- if ((byte1 & (byte)0x80) != 0){
- badInputLength = 1;
- throw new MalformedInputException();
- }
-
- // Is this a escape sequence?
- while (byte1 == 0x1b || byte1 == 0x0e || byte1 == 0x0f) {
- if (byte1 == 0x1b){ // ESC
- if (readOff + inputSize + 1 >= inEnd) {
- if (readOff + inputSize >= inEnd) {
- savedSize = 1;
- savedBytes[0] = (byte)byte1;
- } else {
- savedSize = 2;
- savedBytes[0] = (byte)byte1;
- savedBytes[1] = input[readOff + inputSize];
- inputSize++;
- }
- break;
- }
- byte2 = input[readOff + inputSize] & 0xFF;
- inputSize++;
- if ((byte2 & (byte)0x80) != 0){
- badInputLength = 2;
- throw new MalformedInputException();
- }
- if (byte2 == 0x28){
- byte3 = input[readOff + inputSize] & 0xFF;
- inputSize++;
- if (byte3 == 'B'){
- currentState = ASCII;
- } else if (byte3 == 'J'){
- currentState = JISX0201_1976;
- } else if (byte3 == 'I'){
- currentState = JISX0201_1976_KANA;
- } else {
- // illegal ESC sequence
- badInputLength = 3;
- throw new MalformedInputException();
- }
- } else if (byte2 == '$'){
- byte3 = input[readOff + inputSize] & 0xFF;
- inputSize++;
- if ((byte3 & (byte)0x80) != 0){
- badInputLength = 3;
- throw new MalformedInputException();
- }
- if (byte3 == '@'){
- currentState = JISX0208_1978;
- } else if (byte3 == 'B'){
- currentState = JISX0208_1983;
- } else {
- // illegal ESC sequence
- badInputLength = 3;
- throw new MalformedInputException();
- }
- } else {
- // illegal ESC sequence
- badInputLength = 2;
- throw new MalformedInputException();
- }
- if (readOff + inputSize >= inEnd) {
- noOutput = true;
- break;
- } else {
- byte1 = input[readOff + inputSize];
- inputSize++;
- }
- } else if (byte1 == 0x0e){ // shift out for one byte kana
- previousState = currentState;
- currentState = SHIFTOUT;
- if (readOff + inputSize >= inEnd) {
- noOutput = true;
- break;
- }
- byte1 = input[readOff + inputSize];
- inputSize++;
- if ((byte1 & (byte)0x80) != 0){
- badInputLength = 1;
- throw new MalformedInputException();
- }
- } else if (byte1 == 0x0f){ // shift in for previous mode
- currentState = previousState;
- if (readOff + inputSize >= inEnd) {
- noOutput = true;
- break;
- }
- byte1 = input[readOff + inputSize];
- inputSize++;
- if ((byte1 & (byte)0x80) != 0){
- badInputLength = 1;
- throw new MalformedInputException();
- }
- }
- }
- if (noOutput || savedSize != 0) {
- byteOff += inputSize;
- break;
- }
- noOutput = false;
- switch (currentState){
- case ASCII:
- outputChar = (char)(byte1 & 0xff);
- break;
- case JISX0201_1976:
- switch (byte1) {
- case 0x5c:
- outputChar = '\u00a5';
- break;
- case 0x7e:
- outputChar = '\u203e';
- break;
- default:
- outputChar = (char)byte1;
- break;
- }
- break;
- case JISX0208_1978:
- case JISX0208_1983:
- if (readOff + inputSize >= inEnd) {
- savedSize = 1;
- savedBytes[0] = (byte)byte1;
- break;
- }
- byte2 = input[readOff + inputSize] & 0xff;
- inputSize++;
- if ((byte2 & (byte)0x80) != 0){
- badInputLength = 1;
- throw new MalformedInputException();
- }
- // jisx0208Chars table convert FULLWIDTH_REVERSE_SOLIDUS
- // 0x2140 to REVERSE_SOLIDUS (BACKSLASH) 0x5c.
- // This behavior causes problem because
- // 0x5c is special escape character for java.
- if (byte1 == 0x21 && byte2 == 0x40) {
- outputChar = '\uFF3C';
- } else {
- try {
- outputChar = getUnicode(byte1, byte2);
- } catch (ArrayIndexOutOfBoundsException e) {
- outputChar = '\uFFFD';
- }
- }
- break;
- case JISX0201_1976_KANA:
- case SHIFTOUT:
- if (byte1 > 0x60) {
- badInputLength = 1;
- throw new MalformedInputException();
- }
- outputChar = (char)(byte1 + 0xff40);
- break;
- }
-
- if (savedSize != 0) {
- byteOff += inputSize;
- break;
- }
-
- if (outputChar == '\uFFFD') {
- if (subMode)
- outputChar = subChars[0];
- else {
- badInputLength = inputSize;
- throw new UnknownCharacterException();
- }
- }
- readOff += inputSize;
- byteOff += inputSize;
- output[charOff++] = outputChar;
- }
-
- return charOff - outOff;
- }
-
- public void reset() {
- byteOff = charOff = 0;
- currentState = ASCII;
- savedSize = 0;
- }
-
- public String getCharacterEncoding() {
- return "ISO2022JP";
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharISO2022KR.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-public class ByteToCharISO2022KR extends ByteToCharISO2022
-{
- public ByteToCharISO2022KR()
- {
- SODesignator = new String[1];
- SODesignator[0] = "$)C";
-
- SOConverter = new ByteToCharConverter[1];
-
- try {
- SOConverter[0] = ByteToCharConverter.getConverter("KSC5601");
- } catch (Exception e) {};
- }
-
- // Return the character set id
- public String getCharacterEncoding()
- {
- return "ISO2022KR";
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharISO8859_1.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 1996, 1997, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-/**
-* A algorithmic conversion from ISO 8859-1 to Unicode
-*
-* @author Lloyd Honomichl
-* @author Asmus Freytag
-*/
-public class ByteToCharISO8859_1 extends ByteToCharConverter {
-
- // Return the character set id
- public String getCharacterEncoding()
- {
- return "ISO8859_1";
- }
-
- public int flush(char[] output, int outStart, int outEnd) {
- // This converter will not buffer any data.
- byteOff = charOff = 0;
- return 0;
- }
-
- /**
- * Algorithmic character conversion
- */
- public int convert(byte[] input, int inOff, int inEnd,
- char[] output, int outOff, int outEnd)
-
- throws ConversionBufferFullException
- {
- int bound = inOff + (outEnd - outOff);
- if (bound >= inEnd) {
- bound = inEnd;
- }
- int bytesWritten = inEnd - inOff;
-
-
- // Loop until we hit the end of the input
- try {
- while(inOff < bound) {
- output[outOff++] = (char) (0xff & input[inOff++]);
- }
- } finally {
- charOff = outOff;
- byteOff = inOff;
- }
-
- // If we don't have room for the output, throw an exception
- if (bound < inEnd)
- throw new ConversionBufferFullException();
-
- // Return the length written to the output buffer
- return bytesWritten;
- }
-
- /*
- Reset after finding bad input
- */
- public void reset() {
- byteOff = charOff = 0;
- }
-
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharISO8859_13.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ISO_8859_13;
-
-/**
- * A table to convert ISO8859_13 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharISO8859_13 extends ByteToCharSingleByte {
-
- private final static ISO_8859_13 nioCoder = new ISO_8859_13();
-
- public String getCharacterEncoding() {
- return "ISO8859_13";
- }
-
- public ByteToCharISO8859_13() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharISO8859_15.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * (C) Copyright IBM Corp. 1998 - All Rights Reserved
- *
- */
-
-package sun.io;
-
-import sun.nio.cs.ISO_8859_15;
-
-/**
- * A table to convert ISO8859_15 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharISO8859_15 extends ByteToCharSingleByte {
-
- private final static ISO_8859_15 nioCoder = new ISO_8859_15();
-
- public String getCharacterEncoding() {
- return "ISO8859_15";
- }
-
- public ByteToCharISO8859_15() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharISO8859_2.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ISO_8859_2;
-
-/**
- * A table to convert ISO8859_2 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharISO8859_2 extends ByteToCharSingleByte {
-
- private final static ISO_8859_2 nioCoder = new ISO_8859_2();
-
- public String getCharacterEncoding() {
- return "ISO8859_2";
- }
-
- public ByteToCharISO8859_2() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharISO8859_3.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.ISO_8859_3;
-
-/**
- * A table to convert ISO8859_3 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharISO8859_3 extends ByteToCharSingleByte {
-
- private final static ISO_8859_3 nioCoder = new ISO_8859_3();
-
- public String getCharacterEncoding() {
- return "ISO8859_3";
- }
-
- public ByteToCharISO8859_3() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharISO8859_4.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ISO_8859_4;
-
-/**
- * A table to convert ISO8859_4 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharISO8859_4 extends ByteToCharSingleByte {
-
- private final static ISO_8859_4 nioCoder = new ISO_8859_4();
-
- public String getCharacterEncoding() {
- return "ISO8859_4";
- }
-
- public ByteToCharISO8859_4() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharISO8859_5.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ISO_8859_5;
-
-/**
- * A table to convert ISO8859_5 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharISO8859_5 extends ByteToCharSingleByte {
-
- private final static ISO_8859_5 nioCoder = new ISO_8859_5();
-
- public String getCharacterEncoding() {
- return "ISO8859_5";
- }
-
- public ByteToCharISO8859_5() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharISO8859_6.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.ISO_8859_6;
-
-/**
- * A table to convert ISO8859_6 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharISO8859_6 extends ByteToCharSingleByte {
-
- private final static ISO_8859_6 nioCoder = new ISO_8859_6();
-
- public String getCharacterEncoding() {
- return "ISO8859_6";
- }
-
- public ByteToCharISO8859_6() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharISO8859_7.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ISO_8859_7;
-
-
-/**
- * A table to convert ISO8859_7 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharISO8859_7 extends ByteToCharSingleByte {
-
- private final static ISO_8859_7 nioCoder = new ISO_8859_7();
-
- public String getCharacterEncoding() {
- return "ISO8859_7";
- }
-
- public ByteToCharISO8859_7() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharISO8859_8.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.ISO_8859_8;
-
-/**
- * A table to convert ISO8859_8 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharISO8859_8 extends ByteToCharSingleByte {
-
- private final static ISO_8859_8 nioCoder = new ISO_8859_8();
-
- public String getCharacterEncoding() {
- return "ISO8859_8";
- }
-
- public ByteToCharISO8859_8() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharISO8859_9.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ISO_8859_9;
-
-/**
- * A table to convert ISO8859_9 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharISO8859_9 extends ByteToCharSingleByte {
-
- private final static ISO_8859_9 nioCoder = new ISO_8859_9();
-
- public String getCharacterEncoding() {
- return "ISO8859_9";
- }
-
- public ByteToCharISO8859_9() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharJIS0201.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-/**
- * A table to convert JIS0201 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-class ByteToCharJIS0201 extends ByteToCharSingleByte {
-
- public String getCharacterEncoding() {
- return "JIS0201";
- }
-
- public ByteToCharJIS0201() {
- super.byteToCharTable = byteToCharTable;
- }
-
- private final static String byteToCharTable =
-
- "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD" + // 0x80 - 0x87
- "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD" + // 0x88 - 0x8F
- "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD" + // 0x90 - 0x97
- "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD" + // 0x98 - 0x9F
- "\uFFFD\uFF61\uFF62\uFF63\uFF64\uFF65\uFF66\uFF67" + // 0xA0 - 0xA7
- "\uFF68\uFF69\uFF6A\uFF6B\uFF6C\uFF6D\uFF6E\uFF6F" + // 0xA8 - 0xAF
- "\uFF70\uFF71\uFF72\uFF73\uFF74\uFF75\uFF76\uFF77" + // 0xB0 - 0xB7
- "\uFF78\uFF79\uFF7A\uFF7B\uFF7C\uFF7D\uFF7E\uFF7F" + // 0xB8 - 0xBF
- "\uFF80\uFF81\uFF82\uFF83\uFF84\uFF85\uFF86\uFF87" + // 0xC0 - 0xC7
- "\uFF88\uFF89\uFF8A\uFF8B\uFF8C\uFF8D\uFF8E\uFF8F" + // 0xC8 - 0xCF
- "\uFF90\uFF91\uFF92\uFF93\uFF94\uFF95\uFF96\uFF97" + // 0xD0 - 0xD7
- "\uFF98\uFF99\uFF9A\uFF9B\uFF9C\uFF9D\uFF9E\uFF9F" + // 0xD8 - 0xDF
- "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD" + // 0xE0 - 0xE7
- "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD" + // 0xE8 - 0xEF
- "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD" + // 0xF0 - 0xF7
- "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD" + // 0xF8 - 0xFF
- "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007" + // 0x00 - 0x07
- "\b\t\n\u000B\f\r\u000E\u000F" + // 0x08 - 0x0F
- "\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017" + // 0x10 - 0x17
- "\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F" + // 0x18 - 0x1F
- "\u0020\u0021\"\u0023\u0024\u0025\u0026\'" + // 0x20 - 0x27
- "\u0028\u0029\u002A\u002B\u002C\u002D\u002E\u002F" + // 0x28 - 0x2F
- "\u0030\u0031\u0032\u0033\u0034\u0035\u0036\u0037" + // 0x30 - 0x37
- "\u0038\u0039\u003A\u003B\u003C\u003D\u003E\u003F" + // 0x38 - 0x3F
- "\u0040\u0041\u0042\u0043\u0044\u0045\u0046\u0047" + // 0x40 - 0x47
- "\u0048\u0049\u004A\u004B\u004C\u004D\u004E\u004F" + // 0x48 - 0x4F
- "\u0050\u0051\u0052\u0053\u0054\u0055\u0056\u0057" + // 0x50 - 0x57
- "\u0058\u0059\u005A\u005B\\\u005D\u005E\u005F" + // 0x58 - 0x5F
- "\u0060\u0061\u0062\u0063\u0064\u0065\u0066\u0067" + // 0x60 - 0x67
- "\u0068\u0069\u006A\u006B\u006C\u006D\u006E\u006F" + // 0x68 - 0x6F
- "\u0070\u0071\u0072\u0073\u0074\u0075\u0076\u0077" + // 0x70 - 0x77
- "\u0078\u0079\u007A\u007B\u007C\u007D\u007E\u007F"; // 0x78 - 0x7F
-
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharJIS0208.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-/**
- * Tables and data to convert JIS0208 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-import sun.nio.cs.ext.JIS_X_0208_Decoder;
-
-public class ByteToCharJIS0208 extends ByteToCharDoubleByte {
-
- public String getCharacterEncoding() {
- return "JIS0208";
- }
-
- public ByteToCharJIS0208() {
- super.index1 = JIS_X_0208_Decoder.getIndex1();
- super.index2 = JIS_X_0208_Decoder.getIndex2();
- start = 0x21;
- end = 0x7E;
- }
-
- protected char convSingleByte(int b) {
- //Fix bug#4179800 - JIS0208 is 7bit,double-byte encoding
- return REPLACE_CHAR;
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharJIS0208_Solaris.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.JIS_X_0208_Solaris_Decoder;
-
-/**
- * Tables and data to convert JIS0208_Solaris to Unicode
- *
- * Vendor defined chars added for benefit of vendor defined character
- * supplemented mappings for EUC-JP-Solaris/PCK Solaris variants of EUC-JP
- * and SJIS/Shift_JIS (4765370)
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharJIS0208_Solaris extends ByteToCharDoubleByte {
-
- public String getCharacterEncoding() {
- return "JIS0208_Solaris";
- }
-
- protected char convSingleByte(int b) {
- //Fix bug#4179800 - JIS0208 is 7bit,double-byte encoding
- return REPLACE_CHAR;
- }
-
- public ByteToCharJIS0208_Solaris() {
- super.index1 = JIS_X_0208_Solaris_Decoder.getIndex1();
- super.index2 = JIS_X_0208_Solaris_Decoder.getIndex2();
- start = 0x21;
- end = 0x7E;
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharJIS0212.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.JIS_X_0212_Decoder;
-
-/**
- * Tables and data to convert JIS0212 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-
-public class ByteToCharJIS0212 extends ByteToCharDoubleByte {
-
- public String getCharacterEncoding() {
- return "JIS0212";
- }
-
- protected char convSingleByte(int b) {
- //Fix bug#4179800 - JIS0212 is 7bit,double-byte encoding
- return REPLACE_CHAR;
- }
-
- public ByteToCharJIS0212() {
- super.index1 = JIS_X_0212_Decoder.getIndex1();
- super.index2 = JIS_X_0212_Decoder.getIndex2();
- start = 0x21;
- end = 0x7E;
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharJIS0212_Solaris.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.JIS_X_0212_Solaris_Decoder;
-
-/**
- * Tables and data to convert JIS0212_Solaris to Unicode
- * Solaris ==> vendor defined characters -- NEC row 13 + IBM extended
- * selected character set.
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharJIS0212_Solaris extends ByteToCharDoubleByte {
-
- public String getCharacterEncoding() {
- return "JIS0212_Solaris";
- }
-
- protected char convSingleByte(int b) {
- //Fix bug#4179800 - JIS0212 is 7bit,double-byte encoding
- return REPLACE_CHAR;
- }
-
- public ByteToCharJIS0212_Solaris() {
- super.index1 = JIS_X_0212_Solaris_Decoder.getIndex1();
- super.index2 = JIS_X_0212_Solaris_Decoder.getIndex2();
- start = 0x21;
- end = 0x7E;
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharJISAutoDetect.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,239 +0,0 @@
-/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-import java.io.UnsupportedEncodingException;
-import sun.nio.cs.ext.JISAutoDetect;
-
-public class ByteToCharJISAutoDetect extends ByteToCharConverter {
-
- private final static int EUCJP_MASK = 0x01;
- private final static int SJIS2B_MASK = 0x02;
- private final static int SJIS1B_MASK = 0x04;
- private final static int EUCJP_KANA1_MASK = 0x08;
- private final static int EUCJP_KANA2_MASK = 0x10;
- private final static byte[] maskTable1 = JISAutoDetect.getByteMask1();
- private final static byte[] maskTable2 = JISAutoDetect.getByteMask2();
-
- private final static int SS2 = 0x8e;
- private final static int SS3 = 0x8f;
-
- // SJISName is set to either "SJIS" or "MS932"
- private String SJISName;
- private String EUCJPName;
-
- private String convName = null;
- private ByteToCharConverter detectedConv = null;
- private ByteToCharConverter defaultConv = null;
-
- public ByteToCharJISAutoDetect() {
- super();
- SJISName = CharacterEncoding.getSJISName();
- EUCJPName = CharacterEncoding.getEUCJPName();
- defaultConv = new ByteToCharISO8859_1();
- defaultConv.subChars = subChars;
- defaultConv.subMode = subMode;
- }
-
- public int flush(char [] output, int outStart, int outEnd)
- throws MalformedInputException, ConversionBufferFullException
- {
- badInputLength = 0;
- if(detectedConv != null)
- return detectedConv.flush(output, outStart, outEnd);
- else
- return defaultConv.flush(output, outStart, outEnd);
- }
-
-
- /**
- * Character conversion
- */
- public int convert(byte[] input, int inOff, int inEnd,
- char[] output, int outOff, int outEnd)
- throws UnknownCharacterException, MalformedInputException,
- ConversionBufferFullException
- {
- int num = 0;
-
- charOff = outOff;
- byteOff = inOff;
-
- try {
- if (detectedConv == null) {
- int euckana = 0;
- int ss2count = 0;
- int firstmask = 0;
- int secondmask = 0;
- int cnt;
- boolean nonAsciiFound = false;
-
- for (cnt = inOff; cnt < inEnd; cnt++) {
- firstmask = 0;
- secondmask = 0;
- int byte1 = input[cnt]&0xff;
- int byte2;
-
- // TODO: should check valid escape sequences!
- if (byte1 == 0x1b) {
- convName = "ISO2022JP";
- break;
- }
-
- // Try to convert all leading ASCII characters.
- if ((nonAsciiFound == false) && (byte1 < 0x80)) {
- if (charOff >= outEnd)
- throw new ConversionBufferFullException();
- output[charOff++] = (char) byte1;
- byteOff++;
- num++;
- continue;
- }
-
- // We can no longer convert ASCII.
- nonAsciiFound = true;
-
- firstmask = maskTable1[byte1];
- if (byte1 == SS2)
- ss2count++;
-
- if (firstmask != 0) {
- if (cnt+1 < inEnd) {
- byte2 = input[++cnt] & 0xff;
- secondmask = maskTable2[byte2];
- int mask = firstmask & secondmask;
- if (mask == EUCJP_MASK) {
- convName = EUCJPName;
- break;
- }
- if ((mask == SJIS2B_MASK) || (mask == SJIS1B_MASK)
- || (JISAutoDetect.canBeSJIS1B(firstmask) && secondmask == 0)) {
- convName = SJISName;
- break;
- }
-
- // If the first byte is a SS3 and the third byte
- // is not an EUC byte, it should be SJIS.
- // Otherwise, we can't determine it yet, but it's
- // very likely SJIS. So we don't take the EUCJP CS3
- // character boundary. If we tried both
- // possibilities here, it might be able to be
- // determined correctly.
- if ((byte1 == SS3) && JISAutoDetect.canBeEUCJP(secondmask)) {
- if (cnt+1 < inEnd) {
- int nextbyte = input[cnt+1] & 0xff;
- if (! JISAutoDetect.canBeEUCJP(maskTable2[nextbyte]))
- convName = SJISName;
- } else
- convName = SJISName;
- }
- if (JISAutoDetect.canBeEUCKana(firstmask, secondmask))
- euckana++;
- } else {
- if ((firstmask & SJIS1B_MASK) != 0) {
- convName = SJISName;
- break;
- }
- }
- }
- }
-
- if (nonAsciiFound && (convName == null)) {
- if ((euckana > 1) || (ss2count > 1))
- convName = EUCJPName;
- else
- convName = SJISName;
- }
-
- if (convName != null) {
- try {
- detectedConv = ByteToCharConverter.getConverter(convName);
- detectedConv.subChars = subChars;
- detectedConv.subMode = subMode;
- } catch (UnsupportedEncodingException e){
- detectedConv = null;
- convName = null;
- }
- }
- }
- } catch (ConversionBufferFullException bufferFullException) {
- throw bufferFullException;
- } catch (Exception e) {
- // If we fail to detect the converter needed for any reason,
- // use the default converter.
- detectedConv = defaultConv;
- }
-
- // If we've converted all ASCII characters, then return.
- if (byteOff == inEnd) {
- return num;
- }
-
- if(detectedConv != null) {
- try {
- num += detectedConv.convert(input, inOff + num, inEnd,
- output, outOff + num, outEnd);
- } finally {
- charOff = detectedConv.nextCharIndex();
- byteOff = detectedConv.nextByteIndex();
- badInputLength = detectedConv.badInputLength;
- }
- } else {
- try {
- num += defaultConv.convert(input, inOff + num, inEnd,
- output, outOff + num, outEnd);
- } finally {
- charOff = defaultConv.nextCharIndex();
- byteOff = defaultConv.nextByteIndex();
- badInputLength = defaultConv.badInputLength;
- }
- }
- return num;
- }
-
- public void reset() {
- if(detectedConv != null) {
- detectedConv.reset();
- detectedConv = null;
- convName = null;
- } else
- defaultConv.reset();
- charOff = byteOff = 0;
- }
-
- public String getCharacterEncoding() {
- return "JISAutoDetect";
- }
-
- public String toString() {
- String s = getCharacterEncoding();
- if (detectedConv != null) {
- s += "[" + detectedConv.getCharacterEncoding() + "]";
- } else {
- s += "[unknown]";
- }
- return s;
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharJohab.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class ByteToCharJohab extends ByteToCharDBCS_ASCII {
-
- private static DoubleByte.Decoder dec =
- (DoubleByte.Decoder)new Johab().newDecoder();
-
- public String getCharacterEncoding() {
- return "Johab";
- }
-
- public ByteToCharJohab() {
- super(dec);
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharKOI8_R.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.KOI8_R;
-
-/**
- * A table to convert KOI8_R to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharKOI8_R extends ByteToCharSingleByte {
-
- private final static KOI8_R nioCoder = new KOI8_R();
-
- public String getCharacterEncoding() {
- return "KOI8_R";
- }
-
- public ByteToCharKOI8_R() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharMS874.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.MS874;
-
-/**
- * A table to convert MS874 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharMS874 extends ByteToCharSingleByte {
-
- private final static MS874 nioCoder = new MS874();
-
- public String getCharacterEncoding() {
- return "MS874";
- }
-
- public ByteToCharMS874() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharMS932.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class ByteToCharMS932 extends ByteToCharDBCS_ASCII {
-
- private static DoubleByte.Decoder dec =
- (DoubleByte.Decoder)new MS932().newDecoder();
-
- public String getCharacterEncoding() {
- return "MS932";
- }
-
- public ByteToCharMS932() {
- super(dec);
- }
-
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharMS936.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class ByteToCharMS936 extends ByteToCharDBCS_ASCII {
-
- private static DoubleByte.Decoder dec =
- (DoubleByte.Decoder)new MS936().newDecoder();
-
- public String getCharacterEncoding() {
- return "MS936";
- }
-
- public ByteToCharMS936() {
- super(dec);
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharMS949.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class ByteToCharMS949 extends ByteToCharDBCS_ASCII {
-
- private static DoubleByte.Decoder dec =
- (DoubleByte.Decoder)new MS949().newDecoder();
-
-
- public String getCharacterEncoding() {
- return "MS949";
- }
-
- public ByteToCharMS949() {
- super(dec);
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharMS950.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class ByteToCharMS950 extends ByteToCharDBCS_ASCII {
-
- private static DoubleByte.Decoder dec =
- (DoubleByte.Decoder)new MS950().newDecoder();
-
- public String getCharacterEncoding() {
- return "MS950";
- }
-
- public ByteToCharMS950() {
- super(dec);
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharMS950_HKSCS.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.HKSCS;
-import sun.nio.cs.ext.MS950_HKSCS;
-import static sun.nio.cs.CharsetMapping.*;
-
-public class ByteToCharMS950_HKSCS extends ByteToCharDBCS_ASCII {
-
- private static HKSCS.Decoder dec =
- (HKSCS.Decoder)new MS950_HKSCS().newDecoder();
-
- public String getCharacterEncoding() {
- return "MS950_HKSCS";
- }
-
- public ByteToCharMS950_HKSCS() {
- super(dec);
- }
-
- protected char decodeDouble(int byte1, int byte2) {
- char c = dec.decodeDouble(byte1, byte2);
- if (c == UNMAPPABLE_DECODING)
- c = dec.decodeBig5(byte1, byte2);
- return c;
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharMacArabic.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.MacArabic;
-
-/**
- * A table to convert to MacArabic to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharMacArabic extends ByteToCharSingleByte {
-
- private final static MacArabic nioCoder = new MacArabic();
-
- public String getCharacterEncoding() {
- return "MacArabic";
- }
-
- public ByteToCharMacArabic() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharMacCentralEurope.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.MacCentralEurope;
-
-/**
- * A table to convert to MacCentralEurope to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharMacCentralEurope extends ByteToCharSingleByte {
-
- private final static MacCentralEurope nioCoder = new MacCentralEurope();
-
- public String getCharacterEncoding() {
- return "MacCentralEurope";
- }
-
- public ByteToCharMacCentralEurope() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharMacCroatian.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.MacCroatian;
-
-/**
- * A table to convert to MacCroatian to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharMacCroatian extends ByteToCharSingleByte {
-
- private final static MacCroatian nioCoder = new MacCroatian();
-
- public String getCharacterEncoding() {
- return "MacCroatian";
- }
-
- public ByteToCharMacCroatian() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharMacCyrillic.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.MacCyrillic;
-
-/**
- * A table to convert to MacCyrillic to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharMacCyrillic extends ByteToCharSingleByte {
-
- private final static MacCyrillic nioCoder = new MacCyrillic();
-
- public String getCharacterEncoding() {
- return "MacCyrillic";
- }
-
- public ByteToCharMacCyrillic() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharMacDingbat.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.MacDingbat;
-
-/**
- * A table to convert to MacDingbat to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharMacDingbat extends ByteToCharSingleByte {
-
- private final static MacDingbat nioCoder = new MacDingbat();
-
- public String getCharacterEncoding() {
- return "MacDingbat";
- }
-
- public ByteToCharMacDingbat() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharMacGreek.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.MacGreek;
-
-/**
- * A table to convert to MacGreek to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharMacGreek extends ByteToCharSingleByte {
-
- private final static MacGreek nioCoder = new MacGreek();
-
- public String getCharacterEncoding() {
- return "MacGreek";
- }
-
- public ByteToCharMacGreek() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharMacHebrew.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.MacHebrew;
-
-/**
- * A table to convert to MacHebrew to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharMacHebrew extends ByteToCharSingleByte {
-
- private final static MacHebrew nioCoder = new MacHebrew();
-
- public String getCharacterEncoding() {
- return "MacHebrew";
- }
-
- public ByteToCharMacHebrew() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharMacIceland.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.MacIceland;
-
-/**
- * A table to convert to MacIceland to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharMacIceland extends ByteToCharSingleByte {
-
- private final static MacIceland nioCoder = new MacIceland();
-
- public String getCharacterEncoding() {
- return "MacIceland";
- }
-
- public ByteToCharMacIceland() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharMacRoman.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.MacRoman;
-
-/**
- * A table to convert to MacRoman to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharMacRoman extends ByteToCharSingleByte {
-
- private final static MacRoman nioCoder = new MacRoman();
-
- public String getCharacterEncoding() {
- return "MacRoman";
- }
-
- public ByteToCharMacRoman() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharMacRomania.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.MacRomania;
-
-/**
- * A table to convert to MacRomania to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharMacRomania extends ByteToCharSingleByte {
-
- private final static MacRomania nioCoder = new MacRomania();
-
- public String getCharacterEncoding() {
- return "MacRomania";
- }
-
- public ByteToCharMacRomania() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharMacSymbol.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.MacSymbol;
-
-/**
- * A table to convert to MacSymbol to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharMacSymbol extends ByteToCharSingleByte {
-
- private final static MacSymbol nioCoder = new MacSymbol();
-
- public String getCharacterEncoding() {
- return "MacSymbol";
- }
-
- public ByteToCharMacSymbol() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharMacThai.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.MacThai;
-
-/**
- * A table to convert to MacThai to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharMacThai extends ByteToCharSingleByte {
-
- private final static MacThai nioCoder = new MacThai();
-
- public String getCharacterEncoding() {
- return "MacThai";
- }
-
- public ByteToCharMacThai() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharMacTurkish.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.MacTurkish;
-
-/**
- * A table to convert to MacTurkish to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharMacTurkish extends ByteToCharSingleByte {
-
- private final static MacTurkish nioCoder = new MacTurkish();
-
- public String getCharacterEncoding() {
- return "MacTurkish";
- }
-
- public ByteToCharMacTurkish() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharMacUkraine.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.MacUkraine;
-
-/**
- * A table to convert to MacUkraine to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharMacUkraine extends ByteToCharSingleByte {
-
- private final static MacUkraine nioCoder = new MacUkraine();
-
- public String getCharacterEncoding() {
- return "MacUkraine";
- }
-
- public ByteToCharMacUkraine() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharPCK.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.JIS_X_0208_Solaris_Decoder;
-
-/**
- *
- * @author Limin Shi
- * @author Mark Son-Bell
- * @author Ian Little
- *
- *
- * PCK Converter for Solaris ja locales
- * refer to : Solaris manpage man PCK(5)
- * Incorporates mappings from NEC row 13 and IBM select extension chars
- * in addition to those defined within JIS X0208:1997 (bugID: 4765370)
- *
- */
-
-public class ByteToCharPCK extends ByteToCharSJIS {
- ByteToCharJIS0201 bcJIS0201 = new ByteToCharJIS0201();
- ByteToCharJIS0208_Solaris bcJIS0208 = new ByteToCharJIS0208_Solaris();
-
- public String getCharacterEncoding() {
- return "PCK";
- }
-
- protected char convSingleByte(int b) {
- // If the high bits are all off, it's ASCII == Unicode
- if ((b & 0xFF80) == 0) {
- return (char)b;
- }
- return bcJIS0201.getUnicode(b);
- }
-
- protected char getUnicode(int c1, int c2) {
- char outChar;
- if ((outChar = super.getUnicode(c1, c2)) != '\uFFFD') {
- // Map JIS X 0208:1983 0x213D <--> U+2015
- return ((outChar != '\u2014')? outChar: '\u2015');
- } else {
- int adjust = c2 < 0x9F ? 1 : 0;
- int rowOffset = c1 < 0xA0 ? 0x70 : 0xB0;
- int cellOffset = (adjust == 1) ? (c2 > 0x7F ? 0x20 : 0x1F) : 0x7E;
- int b1 = ((c1 - rowOffset) << 1) - adjust;
- int b2 = c2 - cellOffset;
- outChar = bcJIS0208.getUnicode(b1, b2);
- return outChar;
- }
- }
-
- String prt(int i) {
- return Integer.toString(i,16);
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharSJIS.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 1996, 1998, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-/**
- * The SJIS converters follow the Shift JIS definition in the JIS
- * X0208:1997 standard as much as possible. The MS932 converters must
- * be used where the Microsoft Code Page 932 character repertoire and
- * Unicode mappings are required.
- *
- * @author Limin Shi
- * @author Mark Son-Bell
- */
-
-public class ByteToCharSJIS extends ByteToCharJIS0208 {
- ByteToCharJIS0201 bcJIS0201 = new ByteToCharJIS0201();
-
- public String getCharacterEncoding() {
- return "SJIS";
- }
-
- protected char convSingleByte(int b) {
- // If the high bits are all off, it's ASCII == Unicode
- if ((b & 0xFF80) == 0) {
- return (char)b;
- }
- return bcJIS0201.getUnicode(b);
- }
-
- protected char getUnicode(int c1, int c2) {
- int adjust = c2 < 0x9F ? 1 : 0;
- int rowOffset = c1 < 0xA0 ? 0x70 : 0xB0;
- int cellOffset = (adjust == 1) ? (c2 > 0x7F ? 0x20 : 0x1F) : 0x7E;
- int b1 = ((c1 - rowOffset) << 1) - adjust;
- int b2 = c2 - cellOffset;
- return super.getUnicode(b1, b2);
- }
-
- String prt(int i) {
- return Integer.toString(i,16);
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharSingleByte.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,137 +0,0 @@
-/*
- * Copyright (c) 1996, 2002, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-/**
- * A table driven conversion from byte to char for single byte character sets.
- * The needed data tables will reside in a character set specific subclass.
- *
- * @author Lloyd Honomichl
- * @author Asmus Freytag
- */
-public abstract class ByteToCharSingleByte extends ByteToCharConverter {
-
- /**
- * Mapping table. Values supplied by subclass
- */
- protected String byteToCharTable;
-
- public String getByteToCharTable() {
- return byteToCharTable;
- }
-
- public int flush(char[] output, int outStart, int outEnd) {
- byteOff = charOff = 0;
- return 0;
- }
-
- /**
- * Converts bytes to characters according to the selected character
- * encoding.
- * Maintains internal state, so that conversions that result in
- * exceptions can be restarted by calling convert again, with
- * appropriately modified parameters.
- * Call reset before converting input that is not a continuation of
- * the previous call.
- * @return the number of characters written to output.
- * @param input byte array containing text in character set
- * @param inStart offset in input array
- * @param inEnd offset of last byte to be converted
- * @param output character array to receive conversion result
- * @param outStart starting offset
- * @param outEnd offset of last character to be written to
- * @throw MalformedInputException for any sequence of bytes that is
- * illegal for the input character set, including any partial multi-byte
- * sequence which occurs at the end of an input buffer.
- * @throw UnsupportedCharacterException for any sequence of bytes that
- * contain a character not supported in the current conversion.
- * @throw BufferFullException whenever the output buffer is full
- * before the input is exhausted.
- * @see #reset
- */
- public int convert(byte[] input, int inOff, int inEnd,
- char[] output, int outOff, int outEnd)
- throws UnknownCharacterException,
- MalformedInputException,
- ConversionBufferFullException
- {
- char outputChar;
- int byteIndex;
-
- charOff = outOff;
- byteOff = inOff;
-
- // Loop until we hit the end of the input
- while(byteOff < inEnd) {
-
- byteIndex = input[byteOff];
-
- /* old source
- *outputChar = byteToCharTable[input[byteOff] + 128];
- */
- // Lookup the output character
- outputChar = getUnicode(byteIndex);
-
- // Is the output unmappable?
- if (outputChar == '\uFFFD') {
- if (subMode) {
- outputChar = subChars[0];
- } else {
- badInputLength = 1;
- throw new UnknownCharacterException();
- }
- }
-
- // If we don't have room for the output, throw an exception
- if (charOff >= outEnd)
- throw new ConversionBufferFullException();
-
- // Put the character in the output buffer
- output[charOff]= outputChar;
- charOff++;
- byteOff++;
- }
-
- // Return the length written to the output buffer
- return charOff-outOff;
- }
-
- protected char getUnicode(int byteIndex) {
- int n = byteIndex + 128;
- if (n >= byteToCharTable.length() || n < 0)
- return '\uFFFD';
- return byteToCharTable.charAt(n);
- }
-
- /**
- * Resets the converter.
- * Call this method to reset the converter to its initial state
- */
- public void reset() {
- byteOff = charOff = 0;
- }
-
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharTIS620.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.TIS_620;
-
-/**
- * A table to convert TIS620 to Unicode
- *
- * @author ConverterGenerator tool
- */
-
-public class ByteToCharTIS620 extends ByteToCharSingleByte {
-
- private final static TIS_620 nioCoder = new TIS_620();
-
- public String getCharacterEncoding() {
- return "TIS620";
- }
-
- public ByteToCharTIS620() {
- super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharUTF16.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-
-/**
- * Convert byte arrays containing Unicode characters into arrays of actual
- * Unicode characters, assuming an initial byte-order mark.
- */
-
-public class ByteToCharUTF16 extends ByteToCharUnicode {
-
- public ByteToCharUTF16() {
- super(AUTO, true);
- }
-
- public String getCharacterEncoding() {
- return "UTF-16";
- }
-
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharUTF8.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,200 +0,0 @@
-/*
- * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-
-/**
- * UCS Transformation Format 8 (UTF-8) -> UCS2 (UTF16) converter
- *
- * see CharToByteUTF8.java about UTF-8 format
- */
-
-public class ByteToCharUTF8 extends ByteToCharConverter {
-
- private int savedSize;
- private byte[] savedBytes;
-
- public ByteToCharUTF8() {
- super();
- savedSize = 0;
- savedBytes = new byte[5];
- }
-
- public int flush(char[] output, int outStart, int outEnd)
- throws MalformedInputException
- {
- if (savedSize != 0) {
- savedSize = 0;
- badInputLength = 0;
- throw new MalformedInputException();
- }
- byteOff = charOff = 0;
- return 0;
- }
-
- /**
- * Character converson
- */
- public int convert(byte[] input, int inOff, int inEnd,
- char[] output, int outOff, int outEnd)
- throws MalformedInputException, ConversionBufferFullException
- {
- int byte1, byte2, byte3, byte4;
- char[] outputChar = new char[2];
- int outputSize;
- int byteOffAdjustment = 0;
-
- if (savedSize != 0) {
- byte[] newBuf;
- newBuf = new byte[inEnd - inOff + savedSize];
- for (int i = 0; i < savedSize; i++) {
- newBuf[i] = savedBytes[i];
- }
- System.arraycopy(input, inOff, newBuf, savedSize, inEnd - inOff);
- input = newBuf;
- inOff = 0;
- inEnd = newBuf.length;
- byteOffAdjustment = -savedSize;
- savedSize = 0;
- }
-
- charOff = outOff;
- byteOff = inOff;
- int startByteOff;
-
- while(byteOff < inEnd) {
-
- startByteOff = byteOff;
- byte1 = input[byteOff++] & 0xff;
-
- if ((byte1 & 0x80) == 0){
- outputChar[0] = (char)byte1;
- outputSize = 1;
- } else if ((byte1 & 0xe0) == 0xc0) {
- if (byteOff >= inEnd) {
- savedSize = 1;
- savedBytes[0] = (byte)byte1;
- break;
- }
- byte2 = input[byteOff++] & 0xff;
- if ((byte2 & 0xc0) != 0x80) {
- badInputLength = 2;
- byteOff += byteOffAdjustment;
- throw new MalformedInputException();
- }
- outputChar[0] = (char)(((byte1 & 0x1f) << 6) | (byte2 & 0x3f));
- outputSize = 1;
- } else if ((byte1 & 0xf0) == 0xe0){
- if (byteOff + 1 >= inEnd) {
- savedBytes[0] = (byte)byte1;
- if (byteOff >= inEnd) {
- savedSize = 1;
- } else {
- savedSize = 2;
- savedBytes[1] = input[byteOff++];
- }
- break;
- }
- byte2 = input[byteOff++] & 0xff;
- byte3 = input[byteOff++] & 0xff;
- if ((byte2 & 0xc0) != 0x80 || (byte3 & 0xc0) != 0x80) {
- badInputLength = 3;
- byteOff += byteOffAdjustment;
- throw new MalformedInputException();
- }
- outputChar[0] = (char)(((byte1 & 0x0f) << 12)
- | ((byte2 & 0x3f) << 6)
- | (byte3 & 0x3f));
- outputSize = 1;
- } else if ((byte1 & 0xf8) == 0xf0) {
- if (byteOff + 2 >= inEnd) {
- savedBytes[0] = (byte)byte1;
- if (byteOff >= inEnd) {
- savedSize = 1;
- } else if (byteOff + 1 >= inEnd) {
- savedSize = 2;
- savedBytes[1] = input[byteOff++];
- } else {
- savedSize = 3;
- savedBytes[1] = input[byteOff++];
- savedBytes[2] = input[byteOff++];
- }
- break;
- }
- byte2 = input[byteOff++] & 0xff;
- byte3 = input[byteOff++] & 0xff;
- byte4 = input[byteOff++] & 0xff;
- if ((byte2 & 0xc0) != 0x80 ||
- (byte3 & 0xc0) != 0x80 ||
- (byte4 & 0xc0) != 0x80) {
- badInputLength = 4;
- byteOff += byteOffAdjustment;
- throw new MalformedInputException();
- }
- // this byte sequence is UTF16 character
- int ucs4 = (0x07 & byte1) << 18 |
- (0x3f & byte2) << 12 |
- (0x3f & byte3) << 6 |
- (0x3f & byte4);
- outputChar[0] = (char)((ucs4 - 0x10000) / 0x400 + 0xd800);
- outputChar[1] = (char)((ucs4 - 0x10000) % 0x400 + 0xdc00);
- outputSize = 2;
- } else {
- badInputLength = 1;
- byteOff += byteOffAdjustment;
- throw new MalformedInputException();
- }
-
- if (charOff + outputSize > outEnd) {
- byteOff = startByteOff;
- byteOff += byteOffAdjustment;
- throw new ConversionBufferFullException();
- }
-
- for (int i = 0; i < outputSize; i++) {
- output[charOff + i] = outputChar[i];
- }
- charOff += outputSize;
- }
-
- byteOff += byteOffAdjustment;
- return charOff - outOff;
- }
-
- /*
- * Return the character set id
- */
- public String getCharacterEncoding() {
- return "UTF8";
- }
-
- /*
- * Reset after finding bad input
- */
- public void reset() {
- byteOff = charOff = 0;
- savedSize = 0;
- }
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharUnicode.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,220 +0,0 @@
-/*
- * Copyright (c) 1996, 1999, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-import java.io.*;
-
-
-/**
- * Convert byte arrays containing Unicode characters into arrays of actual
- * Unicode characters. This class may be used directly, in which case it
- * expects the input byte array to begin with a byte-order mark, or it may be
- * subclassed in order to preset the byte order and mark behavior.
- *
- * <p> Whether or not a mark is expected, if a mark that does not match the
- * established byte order is later discovered then a
- * <tt>MalformedInputException</tt> will be thrown by the <tt>convert</tt>
- * method. If a correct mark is seen later in the input stream, it is passed
- * through as a character.
- *
- * @see ByteToCharUnicodeLittle
- * @see ByteToCharUnicodeLittleUnmarked
- * @see ByteToCharUnicodeBig
- * @see ByteToCharUnicodeBigUnmarked
- *
- * @author Mark Reinhold
- */
-
-public class ByteToCharUnicode extends ByteToCharConverter {
-
- static final char BYTE_ORDER_MARK = (char) 0xfeff;
- static final char REVERSED_MARK = (char) 0xfffe;
-
- static final int AUTO = 0;
- static final int BIG = 1;
- static final int LITTLE = 2;
-
- int originalByteOrder; /* Byte order specified at creation */
- int byteOrder; /* Byte order in use */
- boolean usesMark; /* Look for a mark and interpret it */
-
- /**
- * Creates a Unicode byte-to-char converter that expects the first pair of
- * input bytes to be a byte-order mark, which will be interpreted and
- * discarded. If the first pair of bytes is not such a mark then a
- * <tt>MalformedInputException</tt> will be thrown by the convert method.
- */
- public ByteToCharUnicode() {
- originalByteOrder = byteOrder = AUTO;
- usesMark = true;
- }
-
- /**
- * Creates a Unicode byte-to-char converter that uses the given byte order
- * and may or may not insist upon an initial byte-order mark.
- */
- protected ByteToCharUnicode(int bo, boolean m) {
- originalByteOrder = byteOrder = bo;
- usesMark = m;
- }
-
- public String getCharacterEncoding() {
- switch (originalByteOrder) {
- case BIG:
- return usesMark ? "UnicodeBig" : "UnicodeBigUnmarked";
- case LITTLE:
- return usesMark ? "UnicodeLittle" : "UnicodeLittleUnmarked";
- default:
- return "Unicode";
- }
- }
-
- boolean started = false;
- int leftOverByte;
- boolean leftOver = false;
-
- public int convert(byte[] in, int inOff, int inEnd,
- char[] out, int outOff, int outEnd)
- throws ConversionBufferFullException, MalformedInputException
- {
- byteOff = inOff;
- charOff = outOff;
-
- if (inOff >= inEnd)
- return 0;
-
- int b1, b2;
- int bc = 0;
- int inI = inOff, outI = outOff;
-
- if (leftOver) {
- b1 = leftOverByte & 0xff;
- leftOver = false;
- }
- else {
- b1 = in[inI++] & 0xff;
- }
- bc = 1;
-
- if (usesMark && !started) { /* Read initial byte-order mark */
- if (inI < inEnd) {
- b2 = in[inI++] & 0xff;
- bc = 2;
-
- char c = (char) ((b1 << 8) | b2);
- int bo = AUTO;
-
- if (c == BYTE_ORDER_MARK)
- bo = BIG;
- else if (c == REVERSED_MARK)
- bo = LITTLE;
-
- if (byteOrder == AUTO) {
- if (bo == AUTO) {
- badInputLength = bc;
- throw new
- MalformedInputException("Missing byte-order mark");
- }
- byteOrder = bo;
- if (inI < inEnd) {
- b1 = in[inI++] & 0xff;
- bc = 1;
- }
- }
- else if (bo == AUTO) {
- inI--;
- bc = 1;
- }
- else if (byteOrder == bo) {
- if (inI < inEnd) {
- b1 = in[inI++] & 0xff;
- bc = 1;
- }
- }
- else {
- badInputLength = bc;
- throw new
- MalformedInputException("Incorrect byte-order mark");
- }
-
- started = true;
- }
- }
-
- /* Loop invariant: (b1 contains the next input byte) && (bc == 1) */
- while (inI < inEnd) {
- b2 = in[inI++] & 0xff;
- bc = 2;
-
- char c;
- if (byteOrder == BIG)
- c = (char) ((b1 << 8) | b2);
- else
- c = (char) ((b2 << 8) | b1);
-
- if (c == REVERSED_MARK)
- throw new
- MalformedInputException("Reversed byte-order mark");
-
- if (outI >= outEnd)
- throw new ConversionBufferFullException();
- out[outI++] = c;
- byteOff = inI;
- charOff = outI;
-
- if (inI < inEnd) {
- b1 = in[inI++] & 0xff;
- bc = 1;
- }
- }
-
- if (bc == 1) {
- leftOverByte = b1;
- byteOff = inI;
- leftOver = true;
- }
-
- return outI - outOff;
- }
-
- public void reset() {
- leftOver = false;
- byteOff = charOff = 0;
- started = false;
- byteOrder = originalByteOrder;
- }
-
- public int flush(char buf[], int off, int len)
- throws MalformedInputException
- {
- if (leftOver) {
- reset();
- throw new MalformedInputException();
- }
- byteOff = charOff = 0;
- return 0;
- }
-
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharUnicodeBig.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 1996, 1999, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-import java.io.*;
-
-
-/**
- * Convert byte arrays containing Unicode characters into arrays of actual
- * Unicode characters, assuming a big-endian byte order.
- *
- * @author Mark Reinhold
- */
-
-public class ByteToCharUnicodeBig extends ByteToCharUnicode {
-
- public ByteToCharUnicodeBig() {
- super(BIG, true);
- }
-
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharUnicodeBigUnmarked.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-import java.io.*;
-
-
-/**
- * Convert byte arrays containing Unicode characters into arrays of actual
- * Unicode characters, assuming a big-endian byte order and requiring no
- * byte-order mark.
- *
- * @author Mark Reinhold
- */
-
-public class ByteToCharUnicodeBigUnmarked extends ByteToCharUnicode {
-
- public ByteToCharUnicodeBigUnmarked() {
- super(BIG, false);
- }
-
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharUnicodeLittle.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 1996, 1999, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-import java.io.*;
-
-
-/**
- * Convert byte arrays containing Unicode characters into arrays of actual
- * Unicode characters, assuming a little-endian byte order.
- *
- * @author Mark Reinhold
- */
-
-public class ByteToCharUnicodeLittle extends ByteToCharUnicode {
-
- public ByteToCharUnicodeLittle() {
- super(LITTLE, true);
- }
-
-}
--- a/jdk/src/share/classes/sun/io/ByteToCharUnicodeLittleUnmarked.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-import java.io.*;
-
-
-/**
- * Convert byte arrays containing Unicode characters into arrays of actual
- * Unicode characters, assuming a little-endian byte order and requiring no
- * byte-order mark.
- *
- * @author Mark Reinhold
- */
-
-public class ByteToCharUnicodeLittleUnmarked extends ByteToCharUnicode {
-
- public ByteToCharUnicodeLittleUnmarked() {
- super(LITTLE, false);
- }
-
-}
--- a/jdk/src/share/classes/sun/io/CharToByteASCII.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,183 +0,0 @@
-/*
- * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-public class CharToByteASCII extends CharToByteConverter {
-
- // Return the character set ID
- public String getCharacterEncoding()
- {
- return "ASCII";
- }
-
- private char highHalfZoneCode;
-
- public int flush(byte[] output, int outStart, int outEnd)
- throws MalformedInputException
- {
- if (highHalfZoneCode != 0) {
- highHalfZoneCode = 0;
- throw new MalformedInputException
- ("String ends with <High Half Zone code> of UTF16");
- }
- byteOff = charOff = 0;
- return 0;
- }
-
- /*
- * Character conversion
- */
- public int convert(char[] input, int inOff, int inEnd,
- byte[] output, int outOff, int outEnd)
- throws MalformedInputException,
- UnknownCharacterException,
- ConversionBufferFullException
- {
- char inputChar; // Input character to be converted
- byte[] outputByte; // Output byte written to output
- byte[] tmpArray = new byte[1];
- int inputSize; // Size of input
- int outputSize; // Size of output
-
- // Record beginning offsets
- charOff = inOff;
- byteOff = outOff;
-
- if (highHalfZoneCode != 0) {
- inputChar = highHalfZoneCode;
- highHalfZoneCode = 0;
- if (input[inOff] >= 0xdc00 && input[inOff] <= 0xdfff) {
- // This is legal UTF16 sequence.
- badInputLength = 1;
- throw new UnknownCharacterException();
- } else {
- // This is illegal UTF16 sequence.
- badInputLength = 0;
- throw new MalformedInputException
- ("Previous converted string ends with " +
- "<High Half Zone Code> of UTF16 " +
- ", but this string is not begin with <Low Half Zone>");
- }
- }
-
- // Loop until we hit the end of the input
- while(charOff < inEnd) {
- outputByte = tmpArray;
-
- // Get the input character
- inputChar = input[charOff];
-
- // default outputSize
- outputSize = 1;
-
- // Assume this is a simple character
- inputSize = 1;
-
- // Is this a high surrogate?
- if(inputChar >= '\uD800' && inputChar <= '\uDBFF') {
- // Is this the last character in the input?
- if (charOff + 1 == inEnd) {
- highHalfZoneCode = inputChar;
- break;
- }
-
- // Is there a low surrogate following?
- inputChar = input[charOff + 1];
- if (inputChar >= '\uDC00' && inputChar <= '\uDFFF') {
- // We have a valid surrogate pair. Too bad we don't map
- // surrogates. Is substitution enabled?
- if (subMode) {
- outputByte = subBytes;
- outputSize = subBytes.length;
- inputSize = 2;
- } else {
- badInputLength = 2;
- throw new UnknownCharacterException();
- }
- } else {
- // We have a malformed surrogate pair
- badInputLength = 1;
- throw new MalformedInputException();
- }
- }
- // Is this an unaccompanied low surrogate?
- else if (inputChar >= '\uDC00' && inputChar <= '\uDFFF') {
- badInputLength = 1;
- throw new MalformedInputException();
- }
- // Not part of a surrogate, so try to convert
- else {
- // Is this character mappable?
- if (inputChar <= '\u007F') {
- outputByte[0] = (byte)inputChar;
- } else {
- // Is substitution enabled?
- if (subMode) {
- outputByte = subBytes;
- outputSize = subBytes.length;
- } else {
- badInputLength = 1;
- throw new UnknownCharacterException();
- }
- }
- }
-
- // If we don't have room for the output, throw an exception
- if (byteOff + outputSize > outEnd)
- throw new ConversionBufferFullException();
-
- // Put the byte in the output buffer
- for (int i = 0; i < outputSize; i++) {
- output[byteOff++] = outputByte[i];
- }
- charOff += inputSize;
- }
-
- // Return the length written to the output buffer
- return byteOff-outOff;
- }
-
- // Determine if a character is mappable or not
- public boolean canConvert(char ch)
- {
- return (ch <= '\u007F');
- }
-
- // Reset the converter
- public void reset()
- {
- byteOff = charOff = 0;
- highHalfZoneCode = 0;
- }
-
- /**
- * returns the maximum number of bytes needed to convert a char
- */
- public int getMaxBytesPerChar()
- {
- return 1;
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteBig5.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.DoubleByte;
-import sun.nio.cs.ext.Big5;
-
-/**
- * Tables and data to convert Unicode to Big5
- *
- */
-
-public class CharToByteBig5 extends CharToByteDBCS_ASCII {
-
- private static DoubleByte.Encoder enc =
- (DoubleByte.Encoder)new Big5().newEncoder();
-
- public String getCharacterEncoding() {
- return "Big5";
- }
-
- public CharToByteBig5() {
- super(enc);
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteBig5_HKSCS.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.DoubleByte;
-import sun.nio.cs.ext.Big5_HKSCS;
-
-public class CharToByteBig5_HKSCS extends CharToByteDBCS_ASCII {
- private static DoubleByte.Encoder enc =
- (DoubleByte.Encoder)new Big5_HKSCS().newEncoder();
-
- public String getCharacterEncoding() {
- return "Big5_HKSCS";
- }
-
- public CharToByteBig5_HKSCS() {
- super(enc);
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteBig5_Solaris.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.DoubleByte;
-import sun.nio.cs.ext.Big5_Solaris;
-
-public class CharToByteBig5_Solaris extends CharToByteDBCS_ASCII {
-
- private static DoubleByte.Encoder enc =
- (DoubleByte.Encoder)new Big5_Solaris().newEncoder();
-
- public String getCharacterEncoding() {
- return "Big5_Solaris";
- }
-
- public CharToByteBig5_Solaris() {
- super(enc);
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteConverter.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,419 +0,0 @@
-/*
- * Copyright (c) 1996, 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import java.io.*;
-
-
-/**
- * An abstract base class for subclasses which convert Unicode
- * characters into an external encoding.
- *
- * @author Asmus Freytag
- * @author Lloyd Honomichl, Novell, Inc.
- *
- * @deprecated Replaced by {@link java.nio.charset}. THIS API WILL BE
- * REMOVED IN J2SE 1.6.
- */
-@Deprecated
-public abstract class CharToByteConverter {
-
- /**
- * Substitution mode flag.
- */
- protected boolean subMode = true;
-
- /**
- * Bytes to substitute for unmappable input.
- */
- protected byte[] subBytes = { (byte)'?' };
-
- /**
- * Offset of next character to be converted.
- */
- protected int charOff;
-
- /**
- * Offset of next byte to be output.
- */
- protected int byteOff;
-
- /**
- * Length of bad input that caused conversion to stop.
- */
- protected int badInputLength;
-
- /**
- * Create an instance of the default CharToByteConverter subclass.
- */
- public static CharToByteConverter getDefault() {
- Object cvt;
- cvt = Converters.newDefaultConverter(Converters.CHAR_TO_BYTE);
- return (CharToByteConverter)cvt;
- }
-
- /**
- * Returns appropriate CharToByteConverter subclass instance.
- * @param string represets encoding
- */
- public static CharToByteConverter getConverter(String encoding)
- throws UnsupportedEncodingException
- {
- Object cvt;
- cvt = Converters.newConverter(Converters.CHAR_TO_BYTE, encoding);
- return (CharToByteConverter)cvt;
- }
-
- /**
- * Returns the character set id for the conversion.
- */
- public abstract String getCharacterEncoding();
-
- /**
- * Converts an array of Unicode characters into an array of bytes
- * in the target character encoding. This method allows a buffer by
- * buffer conversion of a data stream. The state of the conversion is
- * saved between calls to convert. If a call to convert results in
- * an exception, the conversion may be continued by calling convert again
- * with suitably modified parameters. All conversions should be finished
- * with a call to the flush method.
- *
- * @return the number of bytes written to output.
- * @param input array containing Unicode characters to be converted.
- * @param inStart begin conversion at this offset in input array.
- * @param inEnd stop conversion at this offset in input array (exclusive).
- * @param output byte array to receive conversion result.
- * @param outStart start writing to output array at this offset.
- * @param outEnd stop writing to output array at this offset (exclusive).
- * @exception MalformedInputException if the input buffer contains any
- * sequence of chars that is illegal in Unicode (principally unpaired
- * surrogates and \uFFFF or \uFFFE). After this exception is thrown,
- * the method nextCharIndex can be called to obtain the index of the
- * first invalid input character. The MalformedInputException can
- * be queried for the length of the invalid input.
- * @exception UnknownCharacterException for any character that
- * that cannot be converted to the external character encoding. Thrown
- * only when converter is not in substitution mode.
- * @exception ConversionBufferFullException if output array is filled prior
- * to converting all the input.
- */
- public abstract int convert(char[] input, int inStart, int inEnd,
- byte[] output, int outStart, int outEnd)
- throws MalformedInputException,
- UnknownCharacterException,
- ConversionBufferFullException;
-
- /*
- * Converts any array of characters, including malformed surrogate
- * pairs, into an array of bytes in the target character encoding.
- * A precondition is that substitution mode is turned on. This method
- * allows a buffer by buffer conversion of a data stream.
- * The state of the conversion is saved between calls to convert.
- * All conversions should be finished with a call to the flushAny method.
- *
- * @return the number of bytes written to output.
- * @param input array containing Unicode characters to be converted.
- * @param inStart begin conversion at this offset in input array.
- * @param inEnd stop conversion at this offset in input array (exclusive).
- * @param output byte array to receive conversion result.
- * @param outStart start writing to output array at this offset.
- * @param outEnd stop writing to output array at this offset (exclusive).
- * @exception ConversionBufferFullException if output array is filled prior
- * to converting all the input.
- */
- public int convertAny(char[] input, int inStart, int inEnd,
- byte[] output, int outStart, int outEnd)
- throws ConversionBufferFullException
- {
- if (!subMode) { /* Precondition: subMode == true */
- throw new IllegalStateException("Substitution mode is not on");
- }
- /* Rely on the untested precondition that the indices are meaningful */
- /* For safety, use the public interface to charOff and byteOff, but
- badInputLength is directly modified.*/
- int localInOff = inStart;
- int localOutOff = outStart;
- while(localInOff < inEnd) {
- try {
- int discard = convert(input, localInOff, inEnd,
- output, localOutOff, outEnd);
- return (nextByteIndex() - outStart);
- } catch (MalformedInputException e) {
- byte[] s = subBytes;
- int subSize = s.length;
- localOutOff = nextByteIndex();
- if ((localOutOff + subSize) > outEnd)
- throw new ConversionBufferFullException();
- for (int i = 0; i < subSize; i++)
- output[localOutOff++] = s[i];
- localInOff = nextCharIndex();
- localInOff += badInputLength;
- badInputLength = 0;
- if (localInOff >= inEnd){
- byteOff = localOutOff;
- return (byteOff - outStart);
- }
- continue;
- }catch (UnknownCharacterException e) {
- /* Should never occur, since subMode == true */
- throw new Error("UnknownCharacterException thrown "
- + "in substititution mode",
- e);
- }
- }
- return (nextByteIndex() - outStart);
- }
-
-
-
- /**
- * Converts an array of Unicode characters into an array of bytes
- * in the target character encoding. Unlike convert, this method
- * does not do incremental conversion. It assumes that the given
- * input array contains all the characters to be converted. The
- * state of the converter is reset at the beginning of this method
- * and is left in the reset state on successful termination.
- * The converter is not reset if an exception is thrown.
- * This allows the caller to determine where the bad input
- * was encountered by calling nextCharIndex.
- * <p>
- * This method uses substitution mode when performing the conversion.
- * The method setSubstitutionBytes may be used to determine what
- * bytes are substituted. Even though substitution mode is used,
- * the state of the converter's substitution mode is not changed
- * at the end of this method.
- *
- * @return an array of bytes containing the converted characters.
- * @param input array containing Unicode characters to be converted.
- * @exception MalformedInputException if the input buffer contains any
- * sequence of chars that is illegal in Unicode (principally unpaired
- * surrogates and \uFFFF or \uFFFE). After this exception is thrown,
- * the method nextCharIndex can be called to obtain the index of the
- * first invalid input character and getBadInputLength can be called
- * to determine the length of the invalid input.
- *
- * @see #nextCharIndex
- * @see #setSubstitutionMode
- * @see #setSubstitutionBytes
- * @see #getBadInputLength
- */
- public byte[] convertAll( char input[] ) throws MalformedInputException {
- reset();
- boolean savedSubMode = subMode;
- subMode = true;
-
- byte[] output = new byte[ getMaxBytesPerChar() * input.length ];
-
- try {
- int outputLength = convert( input, 0, input.length,
- output, 0, output.length );
- outputLength += flush( output, nextByteIndex(), output.length );
-
- byte [] returnedOutput = new byte[ outputLength ];
- System.arraycopy( output, 0, returnedOutput, 0, outputLength );
- return returnedOutput;
- }
- catch( ConversionBufferFullException e ) {
- //Not supposed to happen. If it does, getMaxBytesPerChar() lied.
- throw new
- InternalError("this.getMaxBytesPerChar returned bad value");
- }
- catch( UnknownCharacterException e ) {
- // Not supposed to happen since we're in substitution mode.
- throw new InternalError();
- }
- finally {
- subMode = savedSubMode;
- }
- }
-
- /**
- * Writes any remaining output to the output buffer and resets the
- * converter to its initial state.
- *
- * @param output byte array to receive flushed output.
- * @param outStart start writing to output array at this offset.
- * @param outEnd stop writing to output array at this offset (exclusive).
- * @exception MalformedInputException if the output to be flushed contained
- * a partial or invalid multibyte character sequence. Will occur if the
- * input buffer on the last call to convert ended with the first character
- * of a surrogate pair. flush will write what it can to the output buffer
- * and reset the converter before throwing this exception. An additional
- * call to flush is not required.
- * @exception ConversionBufferFullException if output array is filled
- * before all the output can be flushed. flush will write what it can
- * to the output buffer and remember its state. An additional call to
- * flush with a new output buffer will conclude the operation.
- */
- public abstract int flush( byte[] output, int outStart, int outEnd )
- throws MalformedInputException, ConversionBufferFullException;
-
- /**
- * Writes any remaining output to the output buffer and resets the
- * converter to its initial state. May only be called when substitution
- * mode is turned on, and never complains about malformed input (always
- * substitutes).
- *
- * @param output byte array to receive flushed output.
- * @param outStart start writing to output array at this offset.
- * @param outEnd stop writing to output array at this offset (exclusive).
- * @return number of bytes writter into output.
- * @exception ConversionBufferFullException if output array is filled
- * before all the output can be flushed. flush will write what it can
- * to the output buffer and remember its state. An additional call to
- * flush with a new output buffer will conclude the operation.
- */
- public int flushAny( byte[] output, int outStart, int outEnd )
- throws ConversionBufferFullException
- {
- if (!subMode) { /* Precondition: subMode == true */
- throw new IllegalStateException("Substitution mode is not on");
- }
- try {
- return flush(output, outStart, outEnd);
- } catch (MalformedInputException e) {
- /* Assume that if a malformed input exception has occurred,
- no useful data has been placed in the output buffer.
- i.e. there is no mixture of left over good + some bad data.
- Usually occurs with a trailing high surrogate pair element.
- Special cases occur in Cp970, 949c and 933 that seem
- to be covered, but may require further investigation */
- int subSize = subBytes.length;
- byte[] s = subBytes;
- int outIndex = outStart;
- if ((outStart + subSize) > outEnd)
- throw new ConversionBufferFullException();
- for (int i = 0; i < subSize; i++)
- output[outIndex++] = s[i];
- byteOff = charOff = 0; // Reset the internal state.
- badInputLength = 0;
- return subSize;
- }
- }
-
- /**
- * Resets converter to its initial state.
- */
- public abstract void reset();
-
- /**
- * Returns true if the given character can be converted to the
- * target character encoding.
- * @return true if given character is translatable, false otherwise.
- * @param c character to test
- */
- public boolean canConvert(char c) {
- try {
- //FIXME output buffer size should use getMaxBytesPerChar value.
- char[] input = new char[1];
- byte[] output = new byte[3];
- input[0] = c;
- convert(input, 0, 1, output, 0, 3);
- return true;
- } catch(CharConversionException e){
- return false;
- }
- }
-
- /**
- * Returns the maximum number of bytes needed to convert a char. Useful
- * for calculating the maximum output buffer size needed for a particular
- * input buffer.
- */
- public abstract int getMaxBytesPerChar();
-
- /**
- * Returns the length, in chars, of the input which caused a
- * MalformedInputException. Always refers to the last
- * MalformedInputException thrown by the converter. If none have
- * ever been thrown, returns 0.
- */
- public int getBadInputLength() {
- return badInputLength;
- }
-
- /**
- * Returns the index of the character just past
- * the last character successfully converted by the previous call
- * to convert.
- */
- public int nextCharIndex() {
- return charOff;
- }
-
- /**
- * Returns the index of the byte just past the last byte written by
- * the previous call to convert.
- */
- public int nextByteIndex() {
- return byteOff;
- }
-
- /**
- * Sets converter into substitution mode. In substitution mode,
- * the converter will replace untranslatable characters in the source
- * encoding with the substitution character set by setSubstitutionBytes.
- * When not in substitution mode, the converter will throw an
- * UnknownCharacterException when it encounters untranslatable input.
- *
- * @param doSub if true, enable substitution mode.
- * @see #setSubstitutionBytes
- */
- public void setSubstitutionMode(boolean doSub) {
- subMode = doSub;
- }
-
- /**
- * Sets the substitution bytes to use when the converter is in
- * substitution mode. The given bytes should represent a valid
- * character in the target character encoding and must not be
- * longer than the value returned by getMaxBytesPerChar for this
- * converter.
- *
- * @param newSubBytes the substitution bytes
- * @exception IllegalArgumentException if given byte array is longer than
- * the value returned by the method getMaxBytesPerChar.
- * @see #setSubstitutionMode
- * @see #getMaxBytesPerChar
- */
- public void setSubstitutionBytes( byte[] newSubBytes )
- throws IllegalArgumentException
- {
- if( newSubBytes.length > getMaxBytesPerChar() ) {
- throw new IllegalArgumentException();
- }
-
- subBytes = new byte[ newSubBytes.length ];
- System.arraycopy( newSubBytes, 0, subBytes, 0, newSubBytes.length );
- }
-
- /**
- * Returns a string representation of the class.
- */
- public String toString() {
- return "CharToByteConverter: " + getCharacterEncoding();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp037.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM037;
-
-/**
- * Tables and data to convert Unicode to Cp037
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp037 extends CharToByteSingleByte {
-
- private final static IBM037 nioCoder = new IBM037();
-
- public String getCharacterEncoding() {
- return "Cp037";
- }
-
- public CharToByteCp037() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp1006.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM1006;
-
-/**
- * Tables and data to convert Unicode to Cp1006
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp1006 extends CharToByteSingleByte {
-
- private final static IBM1006 nioCoder = new IBM1006();
-
- public String getCharacterEncoding() {
- return "Cp1006";
- }
-
- public CharToByteCp1006() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp1025.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM1025;
-
-/**
- * Tables and data to convert Unicode to Cp1025
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp1025 extends CharToByteSingleByte {
-
- private final static IBM1025 nioCoder = new IBM1025();
-
- public String getCharacterEncoding() {
- return "Cp1025";
- }
-
- public CharToByteCp1025() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp1026.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM1026;
-
-/**
- * Tables and data to convert Unicode to Cp1026
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp1026 extends CharToByteSingleByte {
-
- private final static IBM1026 nioCoder = new IBM1026();
-
- public String getCharacterEncoding() {
- return "Cp1026";
- }
-
- public CharToByteCp1026() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp1046.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM1046;
-
-/**
- * Tables and data to convert Unicode to Cp1046
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp1046 extends CharToByteSingleByte {
-
- private final static IBM1046 nioCoder = new IBM1046();
-
- public String getCharacterEncoding() {
- return "Cp1046";
- }
-
- public CharToByteCp1046() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp1047.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM1047;
-
-/**
- * Tables and data to convert Unicode to Cp1047
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp1047 extends CharToByteSingleByte {
-
- private final static IBM1047 nioCoder = new IBM1047();
-
- public String getCharacterEncoding() {
- return "Cp1047";
- }
-
- public CharToByteCp1047() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp1097.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM1097;
-
-/**
- * Tables and data to convert Unicode to Cp1097
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp1097 extends CharToByteSingleByte {
-
- private final static IBM1097 nioCoder = new IBM1097();
-
- public String getCharacterEncoding() {
- return "Cp1097";
- }
-
- public CharToByteCp1097() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp1098.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM1098;
-
-/**
- * Tables and data to convert Unicode to Cp1098
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp1098 extends CharToByteSingleByte {
-
- private final static IBM1098 nioCoder = new IBM1098();
-
- public String getCharacterEncoding() {
- return "Cp1098";
- }
-
- public CharToByteCp1098() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp1112.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM1112;
-
-/**
- * Tables and data to convert Unicode to Cp1112
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp1112 extends CharToByteSingleByte {
-
- private final static IBM1112 nioCoder = new IBM1112();
-
- public String getCharacterEncoding() {
- return "Cp1112";
- }
-
- public CharToByteCp1112() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp1122.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM1122;
-
-/**
- * Tables and data to convert Unicode to Cp1122
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp1122 extends CharToByteSingleByte {
-
- private final static IBM1122 nioCoder = new IBM1122();
-
- public String getCharacterEncoding() {
- return "Cp1122";
- }
-
- public CharToByteCp1122() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp1123.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM1123;
-
-/**
- * Tables and data to convert Unicode to Cp1123
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp1123 extends CharToByteSingleByte {
-
- private final static IBM1123 nioCoder = new IBM1123();
-
- public String getCharacterEncoding() {
- return "Cp1123";
- }
-
- public CharToByteCp1123() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp1124.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM1124;
-
-/**
- * Tables and data to convert Unicode to Cp1124
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp1124 extends CharToByteSingleByte {
-
- private final static IBM1124 nioCoder = new IBM1124();
-
- public String getCharacterEncoding() {
- return "Cp1124";
- }
-
- public CharToByteCp1124() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp1140.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * (C) Copyright IBM Corp. 1998 - All Rights Reserved
- *
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM1140;
-
-/**
- * Tables and data to convert Unicode to Cp1140
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp1140 extends CharToByteSingleByte {
-
- private final static IBM1140 nioCoder = new IBM1140();
-
- public String getCharacterEncoding() {
- return "Cp1140";
- }
-
- public CharToByteCp1140() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp1141.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * (C) Copyright IBM Corp. 1998 - All Rights Reserved
- *
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM1141;
-
-/**
- * Tables and data to convert Unicode to Cp1141
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp1141 extends CharToByteSingleByte {
-
- private final static IBM1141 nioCoder = new IBM1141();
-
- public String getCharacterEncoding() {
- return "Cp1141";
- }
-
- public CharToByteCp1141() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp1142.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * (C) Copyright IBM Corp. 1998 - All Rights Reserved
- *
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM1142;
-
-/**
- * Tables and data to convert Unicode to Cp1142
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp1142 extends CharToByteSingleByte {
-
- private final static IBM1142 nioCoder = new IBM1142();
-
- public String getCharacterEncoding() {
- return "Cp1142";
- }
-
- public CharToByteCp1142() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp1143.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * (C) Copyright IBM Corp. 1998 - All Rights Reserved
- *
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM1143;
-
-/**
- * Tables and data to convert Unicode to Cp1143
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp1143 extends CharToByteSingleByte {
-
- private final static IBM1143 nioCoder = new IBM1143();
-
- public String getCharacterEncoding() {
- return "Cp1143";
- }
-
- public CharToByteCp1143() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp1144.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * (C) Copyright IBM Corp. 1998 - All Rights Reserved
- *
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM1144;
-
-/**
- * Tables and data to convert Unicode to Cp1144
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp1144 extends CharToByteSingleByte {
-
- private final static IBM1144 nioCoder = new IBM1144();
-
- public String getCharacterEncoding() {
- return "Cp1144";
- }
-
- public CharToByteCp1144() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp1145.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * (C) Copyright IBM Corp. 1998 - All Rights Reserved
- *
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM1145;
-
-/**
- * Tables and data to convert Unicode to Cp1145
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp1145 extends CharToByteSingleByte {
-
- private final static IBM1145 nioCoder = new IBM1145();
-
- public String getCharacterEncoding() {
- return "Cp1145";
- }
-
- public CharToByteCp1145() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp1146.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * (C) Copyright IBM Corp. 1998 - All Rights Reserved
- *
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM1146;
-
-/**
- * Tables and data to convert Unicode to Cp1146
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp1146 extends CharToByteSingleByte {
-
- private final static IBM1146 nioCoder = new IBM1146();
-
- public String getCharacterEncoding() {
- return "Cp1146";
- }
-
- public CharToByteCp1146() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp1147.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * (C) Copyright IBM Corp. 1998 - All Rights Reserved
- *
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM1147;
-
-/**
- * Tables and data to convert Unicode to Cp1147
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp1147 extends CharToByteSingleByte {
-
- private final static IBM1147 nioCoder = new IBM1147();
-
- public String getCharacterEncoding() {
- return "Cp1147";
- }
-
- public CharToByteCp1147() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp1148.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * (C) Copyright IBM Corp. 1998 - All Rights Reserved
- *
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM1148;
-
-/**
- * Tables and data to convert Unicode to Cp1148
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp1148 extends CharToByteSingleByte {
-
- private final static IBM1148 nioCoder = new IBM1148();
-
- public String getCharacterEncoding() {
- return "Cp1148";
- }
-
- public CharToByteCp1148() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp1149.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * (C) Copyright IBM Corp. 1998 - All Rights Reserved
- *
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM1149;
-
-/**
- * Tables and data to convert Unicode to Cp1149
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp1149 extends CharToByteSingleByte {
-
- private final static IBM1149 nioCoder = new IBM1149();
-
- public String getCharacterEncoding() {
- return "Cp1149";
- }
-
- public CharToByteCp1149() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp1250.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.MS1250;
-
-/**
- * Tables and data to convert Unicode to Cp1250
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp1250 extends CharToByteSingleByte {
-
- private final static MS1250 nioCoder = new MS1250();
-
- public String getCharacterEncoding() {
- return "Cp1250";
- }
-
- public CharToByteCp1250() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp1251.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.MS1251;
-
-/**
- * Tables and data to convert Unicode to Cp1251
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp1251 extends CharToByteSingleByte {
-
- private final static MS1251 nioCoder = new MS1251();
-
- public String getCharacterEncoding() {
- return "Cp1251";
- }
-
- public CharToByteCp1251() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp1252.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.MS1252;
-
-/**
- * Tables and data to convert Unicode to Cp1252
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp1252 extends CharToByteSingleByte {
-
- private final static MS1252 nioCoder = new MS1252();
-
- public String getCharacterEncoding() {
- return "Cp1252";
- }
-
- public CharToByteCp1252() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp1253.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.MS1253;
-
-/**
- * Tables and data to convert Unicode to Cp1253
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp1253 extends CharToByteSingleByte {
-
- private final static MS1253 nioCoder = new MS1253();
-
- public String getCharacterEncoding() {
- return "Cp1253";
- }
-
- public CharToByteCp1253() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp1254.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.MS1254;
-
-/**
- * Tables and data to convert Unicode to Cp1254
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp1254 extends CharToByteSingleByte {
-
- private final static MS1254 nioCoder = new MS1254();
-
- public String getCharacterEncoding() {
- return "Cp1254";
- }
-
- public CharToByteCp1254() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp1255.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.MS1255;
-
-/**
- * Tables and data to convert Unicode to Cp1255
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp1255 extends CharToByteSingleByte {
-
- private final static MS1255 nioCoder = new MS1255();
-
- public String getCharacterEncoding() {
- return "Cp1255";
- }
-
- public CharToByteCp1255() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp1256.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.MS1256;
-
-/**
- * Tables and data to convert Unicode to Cp1256
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp1256 extends CharToByteSingleByte {
-
- private final static MS1256 nioCoder = new MS1256();
-
- public String getCharacterEncoding() {
- return "Cp1256";
- }
-
- public CharToByteCp1256() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp1257.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.MS1257;
-
-/**
- * Tables and data to convert Unicode to Cp1257
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp1257 extends CharToByteSingleByte {
-
- private final static MS1257 nioCoder = new MS1257();
-
- public String getCharacterEncoding() {
- return "Cp1257";
- }
-
- public CharToByteCp1257() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp1258.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.MS1258;
-
-/**
- * Tables and data to convert Unicode to Cp1258
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp1258 extends CharToByteSingleByte {
-
- private final static MS1258 nioCoder = new MS1258();
-
- public String getCharacterEncoding() {
- return "Cp1258";
- }
-
- public CharToByteCp1258() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp1381.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class CharToByteCp1381 extends CharToByteDBCS_ASCII {
-
- // Return the character set id
- public String getCharacterEncoding() {
- return "Cp1381";
- }
-
- public CharToByteCp1381() {
- super((DoubleByte.Encoder)new IBM1381().newEncoder());
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp1383.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class CharToByteCp1383 extends CharToByteDBCS_ASCII {
-
- // Return the character set id
- public String getCharacterEncoding() {
- return "Cp1383";
- }
-
- public CharToByteCp1383() {
- super((DoubleByte.Encoder)new IBM1383().newEncoder());
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp273.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM273;
-
-/**
- * Tables and data to convert Unicode to Cp273
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp273 extends CharToByteSingleByte {
-
- private final static IBM273 nioCoder = new IBM273();
-
- public String getCharacterEncoding() {
- return "Cp273";
- }
-
- public CharToByteCp273() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp277.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM277;
-
-/**
- * Tables and data to convert Unicode to Cp277
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp277 extends CharToByteSingleByte {
-
- private final static IBM277 nioCoder = new IBM277();
-
- public String getCharacterEncoding() {
- return "Cp277";
- }
-
- public CharToByteCp277() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp278.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM278;
-
-/**
- * Tables and data to convert Unicode to Cp278
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp278 extends CharToByteSingleByte {
-
- private final static IBM278 nioCoder = new IBM278();
-
- public String getCharacterEncoding() {
- return "Cp278";
- }
-
- public CharToByteCp278() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp280.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM280;
-
-/**
- * Tables and data to convert Unicode to Cp280
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp280 extends CharToByteSingleByte {
-
- private final static IBM280 nioCoder = new IBM280();
-
- public String getCharacterEncoding() {
- return "Cp280";
- }
-
- public CharToByteCp280() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp284.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM284;
-
-/**
- * Tables and data to convert Unicode to Cp284
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp284 extends CharToByteSingleByte {
-
- private final static IBM284 nioCoder = new IBM284();
-
- public String getCharacterEncoding() {
- return "Cp284";
- }
-
- public CharToByteCp284() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp285.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM285;
-
-/**
- * Tables and data to convert Unicode to Cp285
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp285 extends CharToByteSingleByte {
-
- private final static IBM285 nioCoder = new IBM285();
-
- public String getCharacterEncoding() {
- return "Cp285";
- }
-
- public CharToByteCp285() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp297.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM297;
-
-/**
- * Tables and data to convert Unicode to Cp297
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp297 extends CharToByteSingleByte {
-
- private final static IBM297 nioCoder = new IBM297();
-
- public String getCharacterEncoding() {
- return "Cp297";
- }
-
- public CharToByteCp297() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp33722.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-import sun.nio.cs.ext.IBM33722;
-
-/**
-* Tables and data to convert Unicode to Cp33722
-*
-* @author Malcolm Ayres, assisted by UniMap program
-*/
-public class CharToByteCp33722
- extends CharToByteEUC
-
-{
- private final static IBM33722 nioCoder = new IBM33722();
-
- // Return the character set id
- public String getCharacterEncoding()
- {
- return "Cp33722";
- }
-
- public int getMaxBytesPerChar() {
- return 3;
- }
-
- public CharToByteCp33722()
- {
- super();
- super.mask1 = 0xFFE0;
- super.mask2 = 0x001F;
- super.shift = 5;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- super.index2a = nioCoder.getEncoderIndex2a();
- super.index2b = nioCoder.getEncoderIndex2b();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp420.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM420;
-
-/**
- * Tables and data to convert Unicode to Cp420
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp420 extends CharToByteSingleByte {
-
- private final static IBM420 nioCoder = new IBM420();
-
- public String getCharacterEncoding() {
- return "Cp420";
- }
-
- public CharToByteCp420() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp424.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM424;
-
-/**
- * Tables and data to convert Unicode to Cp424
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp424 extends CharToByteSingleByte {
-
- private final static IBM424 nioCoder = new IBM424();
-
- public String getCharacterEncoding() {
- return "Cp424";
- }
-
- public CharToByteCp424() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp437.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 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. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.IBM437;
-
-/**
- * Tables and data to convert Unicode to Cp437
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp437 extends CharToByteSingleByte {
-
- private final static IBM437 nioCoder = new IBM437();
-
- public String getCharacterEncoding() {
- return "Cp437";
- }
-
- public CharToByteCp437() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp500.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM500;
-
-/**
- * Tables and data to convert Unicode to Cp500
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp500 extends CharToByteSingleByte {
-
- private final static IBM500 nioCoder = new IBM500();
-
- public String getCharacterEncoding() {
- return "Cp500";
- }
-
- public CharToByteCp500() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp737.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 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. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.IBM737;
-
-/**
- * Tables and data to convert Unicode to Cp737
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp737 extends CharToByteSingleByte {
-
- private final static IBM737 nioCoder = new IBM737();
-
- public String getCharacterEncoding() {
- return "Cp737";
- }
-
- public CharToByteCp737() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp775.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 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. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.IBM775;
-
-/**
- * Tables and data to convert Unicode to Cp775
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp775 extends CharToByteSingleByte {
-
- private final static IBM775 nioCoder = new IBM775();
-
- public String getCharacterEncoding() {
- return "Cp775";
- }
-
- public CharToByteCp775() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp833.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM833;
-
-public class CharToByteCp833 extends CharToByteSingleByte {
-
- private final static IBM833 nioCoder = new IBM833();
-
- public String getCharacterEncoding() {
- return "Cp833";
- }
-
- public CharToByteCp833() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
-
--- a/jdk/src/share/classes/sun/io/CharToByteCp834.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-//EBIDIC DBCSONLY Korean
-
-public class CharToByteCp834 extends CharToByteDBCS_ASCII {
-
- public CharToByteCp834() {
- super((DoubleByte.Encoder)new IBM834().newEncoder());
- subBytes = new byte[] {(byte)0xfe, (byte)0xfe};
- }
-
- public int getMaxBytesPerChar() {
- return 2;
- }
-
- public String getCharacterEncoding() {
- return "Cp834";
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp838.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM838;
-
-/**
- * Tables and data to convert Unicode to Cp838
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp838 extends CharToByteSingleByte {
-
- private final static IBM838 nioCoder = new IBM838();
-
- public String getCharacterEncoding() {
- return "Cp838";
- }
-
- public CharToByteCp838() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp850.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 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. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.IBM850;
-
-/**
- * Tables and data to convert Unicode to Cp850
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp850 extends CharToByteSingleByte {
-
- private final static IBM850 nioCoder = new IBM850();
-
- public String getCharacterEncoding() {
- return "Cp850";
- }
-
- public CharToByteCp850() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp852.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 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. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.IBM852;
-
-/**
- * Tables and data to convert Unicode to Cp852
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp852 extends CharToByteSingleByte {
-
- private final static IBM852 nioCoder = new IBM852();
-
- public String getCharacterEncoding() {
- return "Cp852";
- }
-
- public CharToByteCp852() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp855.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 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. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.IBM855;
-
-/**
- * Tables and data to convert Unicode to Cp855
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp855 extends CharToByteSingleByte {
-
- private final static IBM855 nioCoder = new IBM855();
-
- public String getCharacterEncoding() {
- return "Cp855";
- }
-
- public CharToByteCp855() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp856.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM856;
-
-/**
- * Tables and data to convert Unicode to Cp856
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp856 extends CharToByteSingleByte {
-
- private final static IBM856 nioCoder = new IBM856();
-
- public String getCharacterEncoding() {
- return "Cp856";
- }
-
- public CharToByteCp856() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp857.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 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. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.IBM857;
-
-/**
- * Tables and data to convert Unicode to Cp857
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp857 extends CharToByteSingleByte {
-
- private final static IBM857 nioCoder = new IBM857();
-
- public String getCharacterEncoding() {
- return "Cp857";
- }
-
- public CharToByteCp857() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp858.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 1998, 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. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * (C) Copyright IBM Corp. 1998 - All Rights Reserved
- *
- */
-
-package sun.io;
-
-import sun.nio.cs.IBM858;
-
-/**
- * Tables and data to convert Unicode to Cp858
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp858 extends CharToByteSingleByte {
-
- public String getCharacterEncoding() {
- return "Cp858";
- }
-
- private final static IBM858 nioCoder = new IBM858();
-
- public CharToByteCp858() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp860.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM860;
-
-/**
- * Tables and data to convert Unicode to Cp860
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp860 extends CharToByteSingleByte {
-
- private final static IBM860 nioCoder = new IBM860();
-
- public String getCharacterEncoding() {
- return "Cp860";
- }
-
- public CharToByteCp860() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp861.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM861;
-
-/**
- * Tables and data to convert Unicode to Cp861
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp861 extends CharToByteSingleByte {
-
- private final static IBM861 nioCoder = new IBM861();
-
- public String getCharacterEncoding() {
- return "Cp861";
- }
-
- public CharToByteCp861() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp862.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 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. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.IBM862;
-
-/**
- * Tables and data to convert Unicode to Cp862
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp862 extends CharToByteSingleByte {
-
- private final static IBM862 nioCoder = new IBM862();
-
- public String getCharacterEncoding() {
- return "Cp862";
- }
-
- public CharToByteCp862() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp863.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM863;
-
-/**
- * Tables and data to convert Unicode to Cp863
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp863 extends CharToByteSingleByte {
-
- private final static IBM863 nioCoder = new IBM863();
-
- public String getCharacterEncoding() {
- return "Cp863";
- }
-
- public CharToByteCp863() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp864.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM864;
-
-/**
- * Tables and data to convert Unicode to Cp864
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp864 extends CharToByteSingleByte {
-
- private final static IBM864 nioCoder = new IBM864();
-
- public String getCharacterEncoding() {
- return "Cp864";
- }
-
- public CharToByteCp864() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp865.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM865;
-
-/**
- * Tables and data to convert Unicode to Cp865
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp865 extends CharToByteSingleByte {
-
- private final static IBM865 nioCoder = new IBM865();
-
- public String getCharacterEncoding() {
- return "Cp865";
- }
-
- public CharToByteCp865() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp866.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 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. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.IBM866;
-
-/**
- * Tables and data to convert Unicode to Cp866
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp866 extends CharToByteSingleByte {
-
- private final static IBM866 nioCoder = new IBM866();
-
- public String getCharacterEncoding() {
- return "Cp866";
- }
-
- public CharToByteCp866() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp868.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM868;
-
-/**
- * Tables and data to convert Unicode to Cp868
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp868 extends CharToByteSingleByte {
-
- private final static IBM868 nioCoder = new IBM868();
-
- public String getCharacterEncoding() {
- return "Cp868";
- }
-
- public CharToByteCp868() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp869.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM869;
-
-/**
- * Tables and data to convert Unicode to Cp869
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp869 extends CharToByteSingleByte {
-
- private final static IBM869 nioCoder = new IBM869();
-
- public String getCharacterEncoding() {
- return "Cp869";
- }
-
- public CharToByteCp869() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp870.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM870;
-
-/**
- * Tables and data to convert Unicode to Cp870
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp870 extends CharToByteSingleByte {
-
- private final static IBM870 nioCoder = new IBM870();
-
- public String getCharacterEncoding() {
- return "Cp870";
- }
-
- public CharToByteCp870() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp871.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM871;
-
-/**
- * Tables and data to convert Unicode to Cp871
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp871 extends CharToByteSingleByte {
-
- private final static IBM871 nioCoder = new IBM871();
-
- public String getCharacterEncoding() {
- return "Cp871";
- }
-
- public CharToByteCp871() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp874.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 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. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.IBM874;
-
-/**
- * Tables and data to convert Unicode to Cp874
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp874 extends CharToByteSingleByte {
-
- private final static IBM874 nioCoder = new IBM874();
-
- public String getCharacterEncoding() {
- return "Cp874";
- }
-
- public CharToByteCp874() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp875.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM875;
-
-/**
- * Tables and data to convert Unicode to Cp875
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp875 extends CharToByteSingleByte {
-
- private final static IBM875 nioCoder = new IBM875();
-
- public String getCharacterEncoding() {
- return "Cp875";
- }
-
- public CharToByteCp875() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp918.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM918;
-
-/**
- * Tables and data to convert Unicode to Cp918
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp918 extends CharToByteSingleByte {
-
- private final static IBM918 nioCoder = new IBM918();
-
- public String getCharacterEncoding() {
- return "Cp918";
- }
-
- public CharToByteCp918() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp921.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM921;
-
-/**
- * Tables and data to convert Unicode to Cp921
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp921 extends CharToByteSingleByte {
-
- private final static IBM921 nioCoder = new IBM921();
-
- public String getCharacterEncoding() {
- return "Cp921";
- }
-
- public CharToByteCp921() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp922.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.IBM922;
-
-/**
- * Tables and data to convert Unicode to Cp922
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteCp922 extends CharToByteSingleByte {
-
- private final static IBM922 nioCoder = new IBM922();
-
- public String getCharacterEncoding() {
- return "Cp922";
- }
-
- public CharToByteCp922() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp930.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class CharToByteCp930 extends CharToByteDBCS_EBCDIC {
-
- // Return the character set id
- public String getCharacterEncoding() {
- return "Cp930";
- }
-
- public CharToByteCp930() {
- super((DoubleByte.Encoder)new IBM930().newEncoder());
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp933.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class CharToByteCp933 extends CharToByteDBCS_EBCDIC {
-
- // Return the character set id
- public String getCharacterEncoding() {
- return "Cp933";
- }
-
- public CharToByteCp933() {
- super((DoubleByte.Encoder)new IBM933().newEncoder());
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp935.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class CharToByteCp935 extends CharToByteDBCS_EBCDIC {
-
- // Return the character set id
- public String getCharacterEncoding() {
- return "Cp935";
- }
-
- public CharToByteCp935() {
- super((DoubleByte.Encoder)new IBM935().newEncoder());
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp937.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class CharToByteCp937 extends CharToByteDBCS_EBCDIC {
-
- // Return the character set id
- public String getCharacterEncoding() {
- return "Cp937";
- }
-
- public CharToByteCp937() {
- super((DoubleByte.Encoder)new IBM937().newEncoder());
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp939.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class CharToByteCp939 extends CharToByteDBCS_EBCDIC {
-
- // Return the character set id
- public String getCharacterEncoding() {
- return "Cp939";
- }
-
- public CharToByteCp939() {
- super((DoubleByte.Encoder)new IBM939().newEncoder());
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp942.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class CharToByteCp942 extends CharToByteDBCS_ASCII {
-
- // Return the character set id
- public String getCharacterEncoding() {
- return "Cp942";
- }
-
- public CharToByteCp942() {
- super((DoubleByte.Encoder)new IBM942().newEncoder());
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp942C.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class CharToByteCp942C extends CharToByteDBCS_ASCII {
-
- // Return the character set id
- public String getCharacterEncoding() {
- return "Cp942C";
- }
-
- public CharToByteCp942C() {
- super((DoubleByte.Encoder)new IBM942C().newEncoder());
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp943.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class CharToByteCp943 extends CharToByteDBCS_ASCII {
-
- // Return the character set id
- public String getCharacterEncoding() {
- return "Cp943";
- }
-
- public CharToByteCp943() {
- super((DoubleByte.Encoder)new IBM943().newEncoder());
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp943C.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class CharToByteCp943C extends CharToByteDBCS_ASCII {
-
- // Return the character set id
- public String getCharacterEncoding() {
- return "Cp943C";
- }
-
- public CharToByteCp943C() {
- super((DoubleByte.Encoder)new IBM943C().newEncoder());
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp948.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class CharToByteCp948 extends CharToByteDBCS_ASCII {
-
- // Return the character set id
- public String getCharacterEncoding() {
- return "Cp948";
- }
-
- public CharToByteCp948() {
- super((DoubleByte.Encoder)new IBM948().newEncoder());
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp949.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class CharToByteCp949 extends CharToByteDBCS_ASCII {
-
- // Return the character set id
- public String getCharacterEncoding() {
- return "Cp949";
- }
-
- public CharToByteCp949() {
- super((DoubleByte.Encoder)new IBM949().newEncoder());
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp949C.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class CharToByteCp949C extends CharToByteDBCS_ASCII {
-
- // Return the character set id
- public String getCharacterEncoding() {
- return "Cp949C";
- }
-
- public CharToByteCp949C() {
- super((DoubleByte.Encoder)new IBM949C().newEncoder());
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp950.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class CharToByteCp950 extends CharToByteDBCS_ASCII {
-
- // Return the character set id
- public String getCharacterEncoding() {
- return "Cp950";
- }
-
- public CharToByteCp950() {
- super((DoubleByte.Encoder)new IBM950().newEncoder());
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp964.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-import sun.nio.cs.ext.IBM964;
-
-/**
-* Tables and data to convert Unicode to Cp964
-*
-* @author Malcolm Ayres, assisted by UniMap program
-*/
-public class CharToByteCp964
- extends CharToByteEUC
-
-{
- private final static IBM964 nioCoder = new IBM964();
-
- // Return the character set id
- public String getCharacterEncoding()
- {
- return "Cp964";
- }
-
- public int getMaxBytesPerChar() {
- return 4;
- }
-
- public CharToByteCp964()
- {
- super();
- super.mask1 = 0xFFC0;
- super.mask2 = 0x003F;
- super.shift = 6;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- super.index2a = nioCoder.getEncoderIndex2a();
- super.index2b = nioCoder.getEncoderIndex2b();
- super.index2c = nioCoder.getEncoderIndex2c();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteCp970.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-// EUC_Simple is the same as DBCS_ASCII
-public class CharToByteCp970 extends CharToByteDBCS_ASCII {
-
- // Return the character set id
- public String getCharacterEncoding() {
- return "Cp970";
- }
-
- public CharToByteCp970() {
- super((DoubleByte.Encoder)new IBM970().newEncoder());
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteDBCS_ASCII.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,195 +0,0 @@
-/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-import sun.nio.cs.ext.DoubleByte;
-import static sun.nio.cs.CharsetMapping.*;
-
-public abstract class CharToByteDBCS_ASCII extends CharToByteConverter
-{
-
- private char highHalfZoneCode;
- private byte[] outputByte = new byte[2];
-
- private DoubleByte.Encoder enc;
-
- public CharToByteDBCS_ASCII(DoubleByte.Encoder enc) {
- super();
- this.enc = enc;
- }
-
- int encodeChar(char c) {
- return enc.encodeChar(c);
- }
-
- /**
- * flush out any residual data and reset the buffer state
- */
- public int flush(byte [] output, int outStart, int outEnd)
- throws MalformedInputException, ConversionBufferFullException
- {
-
- if (highHalfZoneCode != 0) {
- reset();
- badInputLength = 0;
- throw new MalformedInputException();
- }
-
- reset();
- return 0;
- }
-
- /**
- * Character conversion
- */
- public int convert(char[] input, int inOff, int inEnd,
- byte[] output, int outOff, int outEnd)
- throws UnknownCharacterException, MalformedInputException,
- ConversionBufferFullException
- {
- char inputChar;
- int inputSize;
-
- byteOff = outOff;
- charOff = inOff;
-
- while(charOff < inEnd) {
- int index;
- int theBytes;
- int spaceNeeded;
-
- if (highHalfZoneCode == 0) {
- inputChar = input[charOff];
- inputSize = 1;
- } else {
- inputChar = highHalfZoneCode;
- inputSize = 0;
- highHalfZoneCode = 0;
- }
-
- // Is this a high surrogate?
- if (Character.isHighSurrogate(inputChar)) {
- // Is this the last character of the input?
- if (charOff + inputSize >= inEnd) {
- highHalfZoneCode = inputChar;
- charOff += inputSize;
- break;
- }
-
- // Is there a low surrogate following?
- inputChar = input[charOff + inputSize];
- if (Character.isLowSurrogate(inputChar)) {
- // We have a valid surrogate pair. Too bad we don't do
- // surrogates. Is substitution enabled?
- if (subMode) {
- if (subBytes.length == 1) {
- outputByte[0] = 0x00;
- outputByte[1] = subBytes[0];
- }
- else {
- outputByte[0] = subBytes[0];
- outputByte[1] = subBytes[1];
- }
- inputSize++;
- } else {
- badInputLength = 2;
- throw new UnknownCharacterException();
- }
- } else {
- // We have a malformed surrogate pair
- badInputLength = 1;
- throw new MalformedInputException();
- }
- }
- // Is this an unaccompanied low surrogate?
- else if (Character.isLowSurrogate(inputChar)) {
- badInputLength = 1;
- throw new MalformedInputException();
- } else {
-
- // We have a valid character, get the bytes for it
- theBytes = encodeChar(inputChar);
- if (theBytes == UNMAPPABLE_ENCODING) {
- // if there was no mapping - look for substitution characters
- if (subMode) {
- if (subBytes.length == 1) {
- outputByte[0] = 0x00;
- outputByte[1] = subBytes[0];
- } else {
- outputByte[0] = subBytes[0];
- outputByte[1] = subBytes[1];
- }
- } else {
- badInputLength = 1;
- throw new UnknownCharacterException();
- }
- } else {
- outputByte[0] = (byte)(theBytes >>8);
- outputByte[1] = (byte)theBytes;
- }
- }
- if (outputByte[0] == 0x00)
- spaceNeeded = 1;
- else
- spaceNeeded = 2;
-
- if (byteOff + spaceNeeded > outEnd)
- throw new ConversionBufferFullException();
-
- if (spaceNeeded == 1)
- output[byteOff++] = outputByte[1];
- else {
- output[byteOff++] = outputByte[0];
- output[byteOff++] = outputByte[1];
- }
-
- charOff += inputSize;
- }
- return byteOff - outOff;
- }
-
- /**
- * Resets converter to its initial state.
- */
- public void reset() {
- charOff = byteOff = 0;
- highHalfZoneCode = 0;
- }
-
- /**
- * Returns the maximum number of bytes needed to convert a char.
- */
- public int getMaxBytesPerChar() {
- return 2;
- }
-
- /**
- * Returns true if the given character can be converted to the
- * target character encoding.
- */
- public boolean canConvert(char c) {
- return encodeChar(c) != UNMAPPABLE_ENCODING;
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteDBCS_EBCDIC.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,253 +0,0 @@
-/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-import sun.nio.cs.ext.DoubleByte;
-import static sun.nio.cs.CharsetMapping.*;
-
-public abstract class CharToByteDBCS_EBCDIC extends CharToByteConverter
-{
- private static final int SBCS = 0;
- private static final int DBCS = 1;
-
- private static final byte SO = 0x0e;
- private static final byte SI = 0x0f;
-
- private int currentState;
- private char highHalfZoneCode;
- private byte[] outputByte = new byte[2];
-
- private DoubleByte.Encoder enc;
-
- public CharToByteDBCS_EBCDIC(DoubleByte.Encoder enc) {
- super();
- highHalfZoneCode = 0;
- currentState = SBCS;
- this.enc = enc;
- }
-
- int encodeChar(char c) {
- return enc.encodeChar(c);
- }
-
- /**
- * flush out any residual data and reset the buffer state
- */
- public int flush(byte [] output, int outStart, int outEnd)
- throws MalformedInputException, ConversionBufferFullException
- {
- int bytesOut = 0;
-
- if (highHalfZoneCode != 0) {
- reset();
- badInputLength = 0;
- throw new MalformedInputException();
- }
-
- if (currentState == DBCS) {
- if (outStart >= outEnd)
- throw new ConversionBufferFullException();
- output[outStart] = SI;
- bytesOut++;
- }
-
- reset();
- return bytesOut;
- }
-
- /**
- * Character conversion
- */
- public int convert(char[] input, int inOff, int inEnd,
- byte[] output, int outOff, int outEnd)
- throws UnknownCharacterException, MalformedInputException,
- ConversionBufferFullException
- {
- char inputChar;
- int inputSize;
-
- byteOff = outOff;
- charOff = inOff;
-
- while(charOff < inEnd) {
-
- int index;
- int theBytes;
- int spaceNeeded;
-
- if (highHalfZoneCode == 0) {
- inputChar = input[charOff];
- inputSize = 1;
- } else {
- inputChar = highHalfZoneCode;
- inputSize = 0;
- highHalfZoneCode = 0;
- }
-
- // Is this a high surrogate?
- if (Character.isHighSurrogate(inputChar)) {
- // Is this the last character of the input?
- if (charOff + inputSize >= inEnd) {
- highHalfZoneCode = inputChar;
- charOff += inputSize;
- break;
- }
-
- // Is there a low surrogate following?
- inputChar = input[charOff + inputSize];
- if (Character.isLowSurrogate(inputChar)) {
- // We have a valid surrogate pair. Too bad we don't do
- // surrogates. Is substitution enabled?
- if (subMode) {
- if (subBytes.length == 1) {
- outputByte[0] = 0x00;
- outputByte[1] = subBytes[0];
- }
- else {
- outputByte[0] = subBytes[0];
- outputByte[1] = subBytes[1];
- }
- inputSize++;
- } else {
- badInputLength = 2;
- throw new UnknownCharacterException();
- }
- } else {
- // We have a malformed surrogate pair
- badInputLength = 1;
- throw new MalformedInputException();
- }
- }
- // Is this an unaccompanied low surrogate?
- else if (Character.isLowSurrogate(inputChar)) {
- badInputLength = 1;
- throw new MalformedInputException();
- } else {
-
- // We have a valid character, get the bytes for it
- theBytes = encodeChar(inputChar);
- if (theBytes == UNMAPPABLE_ENCODING) {
- // if there was no mapping - look for substitution characters
- if (subMode) {
- if (subBytes.length == 1) {
- outputByte[0] = 0x00;
- outputByte[1] = subBytes[0];
- } else {
- outputByte[0] = subBytes[0];
- outputByte[1] = subBytes[1];
- }
- } else {
- badInputLength = 1;
- throw new UnknownCharacterException();
- }
- } else {
- outputByte[0] = (byte)((theBytes & 0x0000ff00)>>8);
- outputByte[1] = (byte)(theBytes & 0x000000ff);
- }
- }
-
- //Set the output buffer into the correct state
-
- if (currentState == DBCS && outputByte[0] == 0x00) {
- if (byteOff >= outEnd)
- throw new ConversionBufferFullException();
- currentState = SBCS;
- output[byteOff++] = SI;
- } else
- if (currentState == SBCS && outputByte[0] != 0x00) {
- if (byteOff >= outEnd) {
- throw new ConversionBufferFullException();
- }
- currentState = DBCS;
- output[byteOff++] = SO;
- }
-
- if (currentState == DBCS)
- spaceNeeded = 2;
- else
- spaceNeeded = 1;
-
- if (byteOff + spaceNeeded > outEnd) {
- throw new ConversionBufferFullException();
- }
-
- if (currentState == SBCS)
- output[byteOff++] = outputByte[1];
- else {
- output[byteOff++] = outputByte[0];
- output[byteOff++] = outputByte[1];
- }
-
- charOff += inputSize;
- }
- return byteOff - outOff;
- }
-
-
-
- /**
- * Resets converter to its initial state.
- */
- public void reset() {
- charOff = byteOff = 0;
- highHalfZoneCode = 0;
- currentState = SBCS;
- }
-
-
- /**
- * Returns the maximum number of bytes needed to convert a char.
- */
- public int getMaxBytesPerChar() {
- return 4; //Fixed with bug 4199599 so tests would pass.
- }
-
-
- /**
- * Sets the substitution bytes to use when the converter is in
- * substitution mode. The given bytes should represent a valid
- * character in the target character encoding.
- */
-
- public void setSubstitutionBytes( byte[] newSubBytes )
- throws IllegalArgumentException
- {
- if( newSubBytes.length > 2 || newSubBytes.length == 0) {
- throw new IllegalArgumentException();
- }
-
- subBytes = new byte[ newSubBytes.length ];
- System.arraycopy( newSubBytes, 0, subBytes, 0, newSubBytes.length );
-
- }
-
- /**
- * Returns true if the given character can be converted to the
- * target character encoding.
- */
- public boolean canConvert(char c) {
- return encodeChar(c) != UNMAPPABLE_ENCODING;
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteDoubleByte.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,232 +0,0 @@
-/*
- * Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-/**
- * @author Limin Shi
- */
-
-public abstract class CharToByteDoubleByte extends CharToByteConverter {
-
- /*
- * 1st level index, provided by subclass
- */
- protected short index1[];
-
- /*
- * 2nd level index, provided by subclass
- */
- protected String index2[];
-
- protected char highHalfZoneCode;
-
- public short[] getIndex1() {
- return index1;
- }
-
- public String[] getIndex2() {
- return index2;
- }
-
- public int flush(byte[] output, int outStart, int outEnd)
- throws MalformedInputException, ConversionBufferFullException
- {
- if (highHalfZoneCode != 0) {
- highHalfZoneCode = 0;
- badInputLength = 0;
- throw new MalformedInputException();
- }
- byteOff = charOff = 0;
- return 0;
- }
-
- /**
- * Converts characters to sequences of bytes.
- * Conversions that result in Exceptions can be restarted by calling
- * convert again, with appropriately modified parameters.
- * @return the characters written to output.
- * @param input char array containing text in Unicode
- * @param inStart offset in input array
- * @param inEnd offset of last byte to be converted
- * @param output byte array to receive conversion result
- * @param outStart starting offset
- * @param outEnd offset of last byte to be written to
- * @throw UnsupportedCharacterException for any character
- * that cannot be converted to the external character set.
- */
- public int convert(char[] input, int inOff, int inEnd,
- byte[] output, int outOff, int outEnd)
- throws MalformedInputException, UnknownCharacterException,
- ConversionBufferFullException
- {
- char inputChar; // Input character to be converted
- byte[] outputByte; // Output byte written to output
- int inputSize = 0; // Size of input
- int outputSize = 0; // Size of output
- byte[] tmpbuf = new byte[2];
-
- // Record beginning offsets
- charOff = inOff;
- byteOff = outOff;
-
- if (highHalfZoneCode != 0) {
- inputChar = highHalfZoneCode;
- highHalfZoneCode = 0;
- if (input[inOff] >= 0xdc00 && input[inOff] <= 0xdfff) {
- // This is legal UTF16 sequence.
- badInputLength = 1;
- throw new UnknownCharacterException();
- } else {
- // This is illegal UTF16 sequence.
- badInputLength = 0;
- throw new MalformedInputException();
- }
- }
-
- // Loop until we hit the end of the input
- while(charOff < inEnd) {
- inputSize = 1;
- outputByte = tmpbuf;
- inputChar = input[charOff]; // Get the input character
-
- // Is this a high surrogate?
- if(inputChar >= '\uD800' && inputChar <= '\uDBFF') {
- // Is this the last character of the input?
- if (charOff + 1 >= inEnd) {
- highHalfZoneCode = inputChar;
- break;
- }
-
- // Is there a low surrogate following?
- inputChar = input[charOff + 1];
- if (inputChar >= '\uDC00' && inputChar <= '\uDFFF') {
- // We have a valid surrogate pair. Too bad we don't do
- // surrogates. Is substitution enabled?
- if (subMode) {
- outputByte = subBytes;
- outputSize = subBytes.length;
- inputSize = 2;
- } else {
- badInputLength = 2;
- throw new UnknownCharacterException();
- }
- } else {
- // We have a malformed surrogate pair
- badInputLength = 1;
- throw new MalformedInputException();
- }
- }
- // Is this an unaccompanied low surrogate?
- else if (inputChar >= '\uDC00' && inputChar <= '\uDFFF') {
- badInputLength = 1;
- throw new MalformedInputException();
- } else {
- outputSize = convSingleByte(inputChar, outputByte);
- if (outputSize == 0) { // DoubleByte
- int ncode = getNative(inputChar);
- if (ncode != 0 ) {
- outputByte[0] = (byte) ((ncode & 0xff00) >> 8);
- outputByte[1] = (byte) (ncode & 0xff);
- outputSize = 2;
- } else {
- if (subMode) {
- outputByte = subBytes;
- outputSize = subBytes.length;
- } else {
- badInputLength = 1;
- throw new UnknownCharacterException();
- }
- }
- }
- }
-
- // If we don't have room for the output, throw an exception
- if (byteOff + outputSize > outEnd)
- throw new ConversionBufferFullException();
-
- // Put the byte in the output buffer
- for (int i = 0; i < outputSize; i++) {
- output[byteOff++] = outputByte[i];
- }
- charOff += inputSize;
- }
- // Return the length written to the output buffer
- return byteOff - outOff;
- }
-
-
- /**
- * the maximum number of bytes needed to hold a converted char
- * @returns the maximum number of bytes needed for a converted char
- */
- public int getMaxBytesPerChar() {
- return 2;
- }
-
- /**
- * Resets the converter.
- * Call this method to reset the converter to its initial state
- */
- public void reset() {
- byteOff = charOff = 0;
- highHalfZoneCode = 0;
- }
-
- /**
- * Return whether a character is mappable or not
- * @return true if a character is mappable
- */
- public boolean canConvert(char ch) {
- byte[] outByte = new byte[2];
-
- if ((ch == (char) 0) || (convSingleByte(ch, outByte) != 0))
- return true;
- if (this.getNative(ch) != 0)
- return true;
- return false;
- }
-
-
- /*
- * Can be changed by subclass
- */
- protected int convSingleByte(char inputChar, byte[] outputByte) {
- if (inputChar < 0x80) {
- outputByte[0] = (byte)(inputChar & 0x7f);
- return 1;
- }
- return 0;
- }
-
- /*
- * Can be changed by subclass
- */
- protected int getNative(char ch) {
- int offset = index1[((ch & 0xff00) >> 8 )] << 8;
- return index2[offset >> 12].charAt((offset & 0xfff) + (ch & 0xff));
- }
-
-}
--- a/jdk/src/share/classes/sun/io/CharToByteEUC.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,256 +0,0 @@
-/*
- * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-public abstract class CharToByteEUC extends CharToByteConverter
-{
-
- private char highHalfZoneCode;
- private byte[] outputByte;
-
- protected short index1[];
- protected String index2;
- protected String index2a;
- protected String index2b;
- protected String index2c;
- protected int mask1;
- protected int mask2;
- protected int shift;
-
- private byte[] workByte = new byte[4];
-
- /**
- * flush out any residual data and reset the buffer state
- */
- public int flush(byte [] output, int outStart, int outEnd)
- throws MalformedInputException, ConversionBufferFullException
- {
-
- if (highHalfZoneCode != 0) {
- reset();
- badInputLength = 0;
- throw new MalformedInputException();
- }
-
- reset();
- return 0;
- }
-
- /**
- * Character conversion
- */
- public int convert(char[] input, int inOff, int inEnd,
- byte[] output, int outOff, int outEnd)
- throws UnknownCharacterException, MalformedInputException,
- ConversionBufferFullException
- {
- char inputChar;
- int inputSize;
-
- byteOff = outOff;
- charOff = inOff;
-
- while(charOff < inEnd) {
-
- outputByte = workByte;
-
- int index;
- int theBytes;
- int spaceNeeded;
- boolean allZeroes = true;
- int i;
-
-
- if (highHalfZoneCode == 0) {
- inputChar = input[charOff];
- inputSize = 1;
- } else {
- inputChar = highHalfZoneCode;
- inputSize = 0;
- highHalfZoneCode = 0;
- }
-
-
- // Is this a high surrogate?
- if(inputChar >= '\ud800' && inputChar <= '\udbff') {
- // Is this the last character of the input?
- if (charOff + inputSize >= inEnd) {
- highHalfZoneCode = inputChar;
- charOff += inputSize;
- break;
- }
-
- // Is there a low surrogate following?
- inputChar = input[charOff + inputSize];
- if (inputChar >= '\udc00' && inputChar <= '\udfff') {
-
- // We have a valid surrogate pair. Too bad we don't do
- // surrogates. Is substitution enabled?
- if (subMode) {
- outputByte = subBytes;
- inputSize++;
- } else {
- badInputLength = 2;
- throw new UnknownCharacterException();
- }
- } else {
-
- // We have a malformed surrogate pair
- badInputLength = 1;
- throw new MalformedInputException();
- }
- }
-
- // Is this an unaccompanied low surrogate?
- else
- if (inputChar >= '\uDC00' && inputChar <= '\uDFFF') {
- badInputLength = 1;
- throw new MalformedInputException();
- } else {
-
- String theChars;
- char aChar;
-
- // We have a valid character, get the bytes for it
- index = index1[((inputChar & mask1) >> shift)] + (inputChar & mask2);
-
- if (index < 7500)
- theChars = index2;
- else
- if (index < 15000) {
- index = index - 7500;
- theChars = index2a;
- }
- else
- if (index < 22500){
- index = index - 15000;
- theChars = index2b;
- }
- else {
- index = index - 22500;
- theChars = index2c;
- }
-
- aChar = theChars.charAt(2*index);
- outputByte[0] = (byte)((aChar & 0xff00)>>8);
- outputByte[1] = (byte)(aChar & 0x00ff);
- aChar = theChars.charAt(2*index + 1);
- outputByte[2] = (byte)((aChar & 0xff00)>>8);
- outputByte[3] = (byte)(aChar & 0x00ff);
- }
-
- // if there was no mapping - look for substitution characters
-
- for (i = 0; i < outputByte.length; i++) {
- if (outputByte[i] != 0x00) {
- allZeroes = false;
- break;
- }
- }
-
- if (allZeroes && inputChar != '\u0000')
- {
- if (subMode) {
- outputByte = subBytes;
- } else {
- badInputLength = 1;
- throw new UnknownCharacterException();
- }
- }
-
- int oindex = 0;
- for (spaceNeeded = outputByte.length; spaceNeeded > 1; spaceNeeded--){
- if (outputByte[oindex++] != 0x00 )
- break;
- }
-
- if (byteOff + spaceNeeded > outEnd)
- throw new ConversionBufferFullException();
-
-
- for (i = outputByte.length - spaceNeeded; i < outputByte.length; i++) {
- output[byteOff++] = outputByte[i];
- }
-
- charOff += inputSize;
- }
-
- return byteOff - outOff;
- }
-
- /**
- * Resets converter to its initial state.
- */
- public void reset() {
- charOff = byteOff = 0;
- highHalfZoneCode = 0;
- }
-
- /**
- * Returns the maximum number of bytes needed to convert a char.
- */
- public int getMaxBytesPerChar() {
- return 2;
- }
-
-
- /**
- * Returns true if the given character can be converted to the
- * target character encoding.
- */
- public boolean canConvert(char ch) {
- int index;
- String theChars;
-
- index = index1[((ch & mask1) >> shift)] + (ch & mask2);
-
- if (index < 7500)
- theChars = index2;
- else
- if (index < 15000) {
- index = index - 7500;
- theChars = index2a;
- }
- else
- if (index < 22500){
- index = index - 15000;
- theChars = index2b;
- }
- else {
- index = index - 22500;
- theChars = index2c;
- }
-
- if (theChars.charAt(2*index) != '\u0000' ||
- theChars.charAt(2*index + 1) != '\u0000')
- return (true);
-
- // only return true if input char was unicode null - all others are
- // undefined
- return( ch == '\u0000');
-
- }
-
-}
--- a/jdk/src/share/classes/sun/io/CharToByteEUC_CN.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class CharToByteEUC_CN extends CharToByteDBCS_ASCII {
-
- private static DoubleByte.Encoder enc =
- (DoubleByte.Encoder)new EUC_CN().newEncoder();
-
- public String getCharacterEncoding() {
- return "EUC_CN";
- }
-
- public CharToByteEUC_CN() {
- super(enc);
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteEUC_JP.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,201 +0,0 @@
-/*
- * Copyright (c) 1996, 1999, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-/**
- * @author Limin Shi
- */
-
-public class CharToByteEUC_JP extends CharToByteJIS0208 {
- CharToByteJIS0201 cbJIS0201 = new CharToByteJIS0201();
- CharToByteJIS0212 cbJIS0212 = new CharToByteJIS0212();
-
- public String getCharacterEncoding() {
- return "EUC_JP";
- }
-
- protected int convSingleByte(char inputChar, byte[] outputByte) {
- byte b;
-
- if (inputChar == 0) {
- outputByte[0] = (byte)0;
- return 1;
- }
-
- if ((b = cbJIS0201.getNative(inputChar)) == 0)
- return 0;
-
- if (b > 0 && b < 128) {
- outputByte[0] = b;
- return 1;
- }
- outputByte[0] = (byte)0x8E;
- outputByte[1] = b;
- return 2;
- }
-
- protected int getNative(char ch) {
- int offset = index1[((ch & 0xff00) >> 8 )] << 8;
- int r = index2[offset >> 12].charAt((offset & 0xfff) + (ch & 0xff));
- if (r != 0)
- return r + 0x8080;
- r = cbJIS0212.getNative(ch);
- if (r == 0)
- return r;
- return r + 0x8F8080;
- }
-
-
- /**
- * Converts characters to sequences of bytes.
- * Conversions that result in Exceptions can be restarted by calling
- * convert again, with appropriately modified parameters.
- * @return the characters written to output.
- * @param input char array containing text in Unicode
- * @param inStart offset in input array
- * @param inEnd offset of last byte to be converted
- * @param output byte array to receive conversion result
- * @param outStart starting offset
- * @param outEnd offset of last byte to be written to
- * @throw UnsupportedCharacterException for any character
- * that cannot be converted to the external character set.
- */
- public int convert(char[] input, int inOff, int inEnd,
- byte[] output, int outOff, int outEnd)
- throws MalformedInputException, UnknownCharacterException,
- ConversionBufferFullException
- {
- char inputChar; // Input character to be converted
- byte[] outputByte; // Output byte written to output
- int inputSize = 0; // Size of input
- int outputSize = 0; // Size of output
- byte[] tmpbuf = new byte[4];
-
- // Record beginning offsets
- charOff = inOff;
- byteOff = outOff;
-
- if (highHalfZoneCode != 0) {
- inputChar = highHalfZoneCode;
- highHalfZoneCode = 0;
- if (input[inOff] >= 0xdc00 && input[inOff] <= 0xdfff) {
- // This is legal UTF16 sequence.
- badInputLength = 1;
- throw new UnknownCharacterException();
- } else {
- // This is illegal UTF16 sequence.
- badInputLength = 0;
- throw new MalformedInputException();
- }
- }
-
- // Loop until we hit the end of the input
- while(charOff < inEnd) {
- inputSize = 1;
- outputByte = tmpbuf;
- inputChar = input[charOff]; // Get the input character
-
- // Is this a high surrogate?
- if(inputChar >= '\uD800' && inputChar <= '\uDBFF') {
- // Is this the last character of the input?
- if (charOff + 1 >= inEnd) {
- highHalfZoneCode = inputChar;
- break;
- }
-
- // Is there a low surrogate following?
- inputChar = input[charOff + 1];
- if (inputChar >= '\uDC00' && inputChar <= '\uDFFF') {
- // We have a valid surrogate pair. Too bad we don't do
- // surrogates. Is substitution enabled?
- if (subMode) {
- outputByte = subBytes;
- outputSize = subBytes.length;
- inputSize = 2;
- } else {
- badInputLength = 2;
- throw new UnknownCharacterException();
- }
- } else {
- // We have a malformed surrogate pair
- badInputLength = 1;
- throw new MalformedInputException();
- }
- }
- // Is this an unaccompanied low surrogate?
- else if (inputChar >= '\uDC00' && inputChar <= '\uDFFF') {
- badInputLength = 1;
- throw new MalformedInputException();
- } else {
- outputSize = convSingleByte(inputChar, outputByte);
- if (outputSize == 0) { // DoubleByte
- int ncode = getNative(inputChar);
- if (ncode != 0 ) {
- if ((ncode & 0xFF0000) == 0) {
- outputByte[0] = (byte) ((ncode & 0xff00) >> 8);
- outputByte[1] = (byte) (ncode & 0xff);
- outputSize = 2;
- } else {
- outputByte[0] = (byte) 0x8F;
- outputByte[1] = (byte) ((ncode & 0xff00) >> 8);
- outputByte[2] = (byte) (ncode & 0xff);
- outputSize = 3;
- }
- } else {
- if (subMode) {
- outputByte = subBytes;
- outputSize = subBytes.length;
- } else {
- badInputLength = 1;
- throw new UnknownCharacterException();
- }
- }
- }
- }
-
- // If we don't have room for the output, throw an exception
- if (byteOff + outputSize > outEnd)
- throw new ConversionBufferFullException();
-
- // Put the byte in the output buffer
- for (int i = 0; i < outputSize; i++) {
- output[byteOff++] = outputByte[i];
- }
- charOff += inputSize;
- }
- // Return the length written to the output buffer
- return byteOff - outOff;
- }
-
-
- /**
- * the maximum number of bytes needed to hold a converted char
- * @returns the maximum number of bytes needed for a converted char
- */
- public int getMaxBytesPerChar() {
- return 3;
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteEUC_JP_LINUX.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,193 +0,0 @@
-/*
- * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-/**
- * Class for converting characters to bytes for the EUC-JP encoding in
- * linux. This converter supports the JIS0201 and the JIS0208 encoding and
- * omits support for the JIS212 encoding.
- *
- * @author Naveen Sanjeeva
- */
-
-public class CharToByteEUC_JP_LINUX extends CharToByteJIS0208 {
- CharToByteJIS0201 cbJIS0201 = new CharToByteJIS0201();
-
- public String getCharacterEncoding() {
- return "EUC_JP_LINUX";
- }
-
- protected int convSingleByte(char inputChar, byte[] outputByte) {
- byte b;
-
- if (inputChar == 0) {
- outputByte[0] = (byte)0;
- return 1;
- }
-
- if ((b = cbJIS0201.getNative(inputChar)) == 0)
- return 0;
-
- if (b > 0 && b < 128) {
- outputByte[0] = b;
- return 1;
- }
- outputByte[0] = (byte)0x8E;
- outputByte[1] = b;
- return 2;
- }
-
- protected int getNative(char ch) {
- int offset = index1[((ch & 0xff00) >> 8 )] << 8;
- int r = index2[offset >> 12].charAt((offset & 0xfff) + (ch & 0xff));
- if (r != 0)
- return r + 0x8080;
- return r;
- }
-
- /**
- * Converts characters to sequences of bytes.
- * Conversions that result in Exceptions can be restarted by calling
- * convert again, with appropriately modified parameters.
- * @return the characters written to output.
- * @param input char array containing text in Unicode
- * @param inStart offset in input array
- * @param inEnd offset of last byte to be converted
- * @param output byte array to receive conversion result
- * @param outStart starting offset
- * @param outEnd offset of last byte to be written to
- * @throw UnsupportedCharacterException for any character
- * that cannot be converted to the external character set.
- */
- public int convert(char[] input, int inOff, int inEnd,
- byte[] output, int outOff, int outEnd)
- throws MalformedInputException, UnknownCharacterException,
- ConversionBufferFullException
- {
- char inputChar; // Input character to be converted
- byte[] outputByte; // Output byte written to output
- int inputSize = 0; // Size of input
- int outputSize = 0; // Size of output
- byte[] tmpbuf = new byte[4];
-
- // Record beginning offsets
- charOff = inOff;
- byteOff = outOff;
-
- if (highHalfZoneCode != 0) {
- inputChar = highHalfZoneCode;
- highHalfZoneCode = 0;
- if (input[inOff] >= 0xdc00 && input[inOff] <= 0xdfff) {
- // This is legal UTF16 sequence.
- badInputLength = 1;
- throw new UnknownCharacterException();
- } else {
- // This is illegal UTF16 sequence.
- badInputLength = 0;
- throw new MalformedInputException();
- }
- }
-
- // Loop until we hit the end of the input
- while(charOff < inEnd) {
- inputSize = 1;
- outputByte = tmpbuf;
- inputChar = input[charOff]; // Get the input character
-
- // Is this a high surrogate?
- if(inputChar >= '\uD800' && inputChar <= '\uDBFF') {
- // Is this the last character of the input?
- if (charOff + 1 >= inEnd) {
- highHalfZoneCode = inputChar;
- break;
- }
-
- // Is there a low surrogate following?
- inputChar = input[charOff + 1];
- if (inputChar >= '\uDC00' && inputChar <= '\uDFFF') {
- // We have a valid surrogate pair. Too bad we don't do
- // surrogates. Is substitution enabled?
- if (subMode) {
- outputByte = subBytes;
- outputSize = subBytes.length;
- inputSize = 2;
- } else {
- badInputLength = 2;
- throw new UnknownCharacterException();
- }
- } else {
- // We have a malformed surrogate pair
- badInputLength = 1;
- throw new MalformedInputException();
- }
- }
- // Is this an unaccompanied low surrogate?
- else if (inputChar >= '\uDC00' && inputChar <= '\uDFFF') {
- badInputLength = 1;
- throw new MalformedInputException();
- } else {
- outputSize = convSingleByte(inputChar, outputByte);
- if (outputSize == 0) { // DoubleByte
- int ncode = getNative(inputChar);
- if (ncode != 0 && ((ncode & 0xFF0000) == 0)) {
- outputByte[0] = (byte) ((ncode & 0xff00) >> 8);
- outputByte[1] = (byte) (ncode & 0xff);
- outputSize = 2;
- } else {
- if (subMode) {
- outputByte = subBytes;
- outputSize = subBytes.length;
- } else {
- badInputLength = 1;
- throw new UnknownCharacterException();
- }
- }
- }
- }
-
- // If we don't have room for the output, throw an exception
- if (byteOff + outputSize > outEnd)
- throw new ConversionBufferFullException();
-
- // Put the byte in the output buffer
- for (int i = 0; i < outputSize; i++) {
- output[byteOff++] = outputByte[i];
- }
- charOff += inputSize;
- }
- // Return the length written to the output buffer
- return byteOff - outOff;
- }
-
-
- /**
- * the maximum number of bytes needed to hold a converted char
- * @returns the maximum number of bytes needed for a converted char
- */
- public int getMaxBytesPerChar() {
- return 2;
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteEUC_JP_Solaris.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,213 +0,0 @@
-/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.JIS_X_0208_Solaris_Encoder;
-import sun.nio.cs.ext.JIS_X_0212_Solaris_Encoder;
-
-/**
- * @author Limin Shi
- * @author Ian Little
- *
- * EUC_JP variant converter for Solaris with vendor defined chars
- * added (4765370)
- */
-
-public class CharToByteEUC_JP_Solaris extends CharToByteEUC_JP {
- CharToByteJIS0201 cbJIS0201 = new CharToByteJIS0201();
- CharToByteJIS0212_Solaris cbJIS0212 = new CharToByteJIS0212_Solaris();
-
- short[] j0208Index1 = JIS_X_0208_Solaris_Encoder.getIndex1();
- String[] j0208Index2 = JIS_X_0208_Solaris_Encoder.getIndex2();
-
- public String getCharacterEncoding() {
- return "eucJP-open";
- }
-
- protected int convSingleByte(char inputChar, byte[] outputByte) {
- byte b;
-
- if (inputChar == 0) {
- outputByte[0] = (byte)0;
- return 1;
- }
-
- if ((b = cbJIS0201.getNative(inputChar)) == 0)
- return 0;
-
- if (b > 0 && b < 128) {
- outputByte[0] = b;
- return 1;
- }
- outputByte[0] = (byte)0x8E;
- outputByte[1] = b;
- return 2;
- }
-
- protected int getNative(char ch) {
- int r = super.getNative(ch);
- if (r != 0) {
- return r;
- } else {
- int offset = j0208Index1[((ch & 0xff00) >> 8 )] << 8;
- r = j0208Index2[offset >> 12].charAt((offset & 0xfff) + (ch & 0xff));
- if (r > 0x7500)
- return 0x8f8080 + cbJIS0212.getNative(ch);
- }
- return (r == 0)? r : r + 0x8080;
- }
-
-
- /**
- * Converts characters to sequences of bytes.
- * Conversions that result in Exceptions can be restarted by calling
- * convert again, with appropriately modified parameters.
- * @return the characters written to output.
- * @param input char array containing text in Unicode
- * @param inStart offset in input array
- * @param inEnd offset of last byte to be converted
- * @param output byte array to receive conversion result
- * @param outStart starting offset
- * @param outEnd offset of last byte to be written to
- * @throw UnsupportedCharacterException for any character
- * that cannot be converted to the external character set.
- */
- public int convert(char[] input, int inOff, int inEnd,
- byte[] output, int outOff, int outEnd)
- throws MalformedInputException, UnknownCharacterException,
- ConversionBufferFullException
- {
- char inputChar; // Input character to be converted
- byte[] outputByte; // Output byte written to output
- int inputSize = 0; // Size of input
- int outputSize = 0; // Size of output
- byte[] tmpbuf = new byte[4];
-
- // Record beginning offsets
- charOff = inOff;
- byteOff = outOff;
-
- if (highHalfZoneCode != 0) {
- inputChar = highHalfZoneCode;
- highHalfZoneCode = 0;
- if (input[inOff] >= 0xdc00 && input[inOff] <= 0xdfff) {
- // This is legal UTF16 sequence.
- badInputLength = 1;
- throw new UnknownCharacterException();
- } else {
- // This is illegal UTF16 sequence.
- badInputLength = 0;
- throw new MalformedInputException();
- }
- }
-
- // Loop until we hit the end of the input
- while(charOff < inEnd) {
- inputSize = 1;
- outputByte = tmpbuf;
- inputChar = input[charOff]; // Get the input character
-
- // Is this a high surrogate?
- if(inputChar >= '\uD800' && inputChar <= '\uDBFF') {
- // Is this the last character of the input?
- if (charOff + 1 >= inEnd) {
- highHalfZoneCode = inputChar;
- break;
- }
-
- // Is there a low surrogate following?
- inputChar = input[charOff + 1];
- if (inputChar >= '\uDC00' && inputChar <= '\uDFFF') {
- // We have a valid surrogate pair. Too bad we don't do
- // surrogates. Is substitution enabled?
- if (subMode) {
- outputByte = subBytes;
- outputSize = subBytes.length;
- inputSize = 2;
- } else {
- badInputLength = 2;
- throw new UnknownCharacterException();
- }
- } else {
- // We have a malformed surrogate pair
- badInputLength = 1;
- throw new MalformedInputException();
- }
- }
- // Is this an unaccompanied low surrogate?
- else if (inputChar >= '\uDC00' && inputChar <= '\uDFFF') {
- badInputLength = 1;
- throw new MalformedInputException();
- } else {
- outputSize = convSingleByte(inputChar, outputByte);
- if (outputSize == 0) { // DoubleByte
- int ncode = getNative(inputChar);
- if (ncode != 0 ) {
- if ((ncode & 0xFF0000) == 0) {
- outputByte[0] = (byte) ((ncode & 0xff00) >> 8);
- outputByte[1] = (byte) (ncode & 0xff);
- outputSize = 2;
- } else {
- outputByte[0] = (byte) 0x8F;
- outputByte[1] = (byte) ((ncode & 0xff00) >> 8);
- outputByte[2] = (byte) (ncode & 0xff);
- outputSize = 3;
- }
- } else {
- if (subMode) {
- outputByte = subBytes;
- outputSize = subBytes.length;
- } else {
- badInputLength = 1;
- throw new UnknownCharacterException();
- }
- }
- }
- }
-
- // If we don't have room for the output, throw an exception
- if (byteOff + outputSize > outEnd)
- throw new ConversionBufferFullException();
-
- // Put the byte in the output buffer
- for (int i = 0; i < outputSize; i++) {
- output[byteOff++] = outputByte[i];
- }
- charOff += inputSize;
- }
- // Return the length written to the output buffer
- return byteOff - outOff;
- }
-
-
- /**
- * the maximum number of bytes needed to hold a converted char
- * @returns the maximum number of bytes needed for a converted char
- */
- public int getMaxBytesPerChar() {
- return 3;
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteEUC_KR.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class CharToByteEUC_KR extends CharToByteDBCS_ASCII {
-
- private static DoubleByte.Encoder enc =
- (DoubleByte.Encoder)new EUC_KR().newEncoder();
-
- public String getCharacterEncoding() {
- return "EUC_KR";
- }
-
- public CharToByteEUC_KR() {
- super(enc);
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteEUC_TW.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.EUC_TW;
-
-/*
- * @author Limin Shi
- */
-
-public class CharToByteEUC_TW extends CharToByteConverter
-{
- private final EUC_TW.Encoder enc = (EUC_TW.Encoder)(new EUC_TW().newEncoder());
-
- public int flush(byte[] output, int outStart, int outEnd)
- throws MalformedInputException
- {
- reset();
- return 0;
- }
-
- public void reset() {
- byteOff = charOff = 0;
- }
-
- public boolean canConvert(char ch){
- return enc.canEncode(ch);
- }
-
- /**
- * Character conversion
- */
- public int convert(char[] input, int inOff, int inEnd,
- byte[] output, int outOff, int outEnd)
- throws UnknownCharacterException, MalformedInputException,
- ConversionBufferFullException
- {
- int outputSize;
- byte [] tmpbuf = new byte[4];;
- byte [] outputByte;
- byteOff = outOff;
-
- //Fixed 4122961 by bringing the charOff++ out to this
- // loop where it belongs, changing the loop from
- // while(){} to for(){}.
- for (charOff = inOff; charOff < inEnd; charOff++) {
- outputByte = tmpbuf;
- if ( input[charOff] < 0x80) { // ASCII
- outputSize = 1;
- outputByte[0] = (byte)(input[charOff] & 0x7f);
- } else {
- outputSize = enc.toEUC(input[charOff], outputByte);
- }
-
- if (outputSize == -1) {
- if (subMode) {
- outputByte = subBytes;
- outputSize = subBytes.length;
- } else {
- badInputLength = 1;
- throw new UnknownCharacterException();
- }
- }
-
- if (outEnd - byteOff < outputSize)
- throw new ConversionBufferFullException();
-
- for (int i = 0; i < outputSize; i++)
- output[byteOff++] = outputByte[i];
- }
-
- return byteOff - outOff;
-
- }
-
- /**
- * returns the maximum number of bytes needed to convert a char
- */
- public int getMaxBytesPerChar() {
- return 4;
- }
-
- /**
- * Return the character set ID
- */
- public String getCharacterEncoding() {
- return "EUC_TW";
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteGB18030.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,261 +0,0 @@
-/*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- */
-
-
-package sun.io;
-import sun.nio.cs.ext.GB18030;
-
-public class CharToByteGB18030 extends CharToByteConverter
-{
-
- private char highHalfZoneCode;
- boolean flushed = true;
-
- private final static int GB18030_SINGLE_BYTE = 1;
- private final static int GB18030_DOUBLE_BYTE = 2;
- private final static int GB18030_FOUR_BYTE = 3;
- private static short[] index1;
- private static String[] index2;
- private int currentState;
-
- public CharToByteGB18030() {
- GB18030 nioCoder = new GB18030();
- currentState = GB18030_DOUBLE_BYTE;
- subBytes = new byte[1];
- subBytes[0] = (byte)'?';
- index1 = nioCoder.getEncoderIndex1();
- index2 = nioCoder.getEncoderIndex2();
- }
-
- public int flush(byte[] output, int outStart, int outEnd)
- throws MalformedInputException
- {
- if (highHalfZoneCode != 0) {
- highHalfZoneCode = 0;
- badInputLength = 0;
- throw new MalformedInputException();
- }
- reset();
- flushed = true;
- return 0;
- }
-
- public void reset() {
- byteOff = charOff = 0;
- currentState = GB18030_DOUBLE_BYTE;
- }
-
- public boolean canConvert(char c) {
- // converts all but unpaired surrogates
- // and illegal chars, U+FFFE & U+FFFF
-
- if ((c >= 0xd800 && c <=0xdfff) || (c >= 0xfffe))
- return false;
- else
- return true;
- }
-
- /**
- * Character conversion
- */
- public int convert(char[] input, int inOff, int inEnd,
- byte[] output, int outOff, int outEnd)
- throws UnknownCharacterException, MalformedInputException,
- ConversionBufferFullException
- {
- int linearDiffValue = 0;
- int hiByte = 0 , loByte = 0; // low and high order bytes
- char inputChar; // Input character to be converted
- charOff = inOff;
- byteOff = outOff;
- int inputSize; // Size of the input
- int outputSize; // Size of the output
-
- flushed = false;
-
- if (highHalfZoneCode != 0) {
- if (input[inOff] >= 0xDC00 && input[inOff] <= 0xDFFF) {
-
- // This is legal UTF16 sequence, so shunt in the high
- // surrogate for conversion by convert() loop.
-
- char[] newBuf = new char[inEnd - inOff + 1];
- newBuf[0] = highHalfZoneCode;
- System.arraycopy(input, inOff, newBuf, 1, inEnd - inOff);
- charOff -= 1;
- input = newBuf;
- inOff = 0;
- inEnd = newBuf.length;
- highHalfZoneCode = 0;
- } else {
- // This is illegal UTF16 sequence.
- badInputLength = 0;
- throw new MalformedInputException();
- }
- }
-
- // Main encode loop
-
- while (charOff < inEnd) {
- inputChar = input[charOff++];
-
- if(inputChar >= '\uD800' && inputChar <= '\uDBFF') {
- // Is this the last character of the input?
- if (charOff + 1 > inEnd) {
- highHalfZoneCode = inputChar;
- break;
- }
-
- char previousChar = inputChar;
- inputChar = input[charOff];
-
- // Is there a low surrogate following?
- if (inputChar >= '\uDC00' && inputChar <= '\uDFFF') {
- inputSize = 2;
- charOff++;
- linearDiffValue = ( previousChar - 0xD800) * 0x400 +
- ( inputChar - 0xDC00) + 0x2E248;
-
- currentState = GB18030_FOUR_BYTE;
- } else {
- // We have a malformed surrogate pair
- badInputLength = 1;
- throw new MalformedInputException();
- }
- }
- // Is this an unaccompanied low surrogate?
- else if (inputChar >= '\uDC00' && inputChar <= '\uDFFF') {
- badInputLength = 1;
- throw new MalformedInputException();
- }
-
- // Not part of a surrogate
- else if (inputChar >= 0x0000 && inputChar <= 0x007F) {
- if (byteOff >= outEnd) {
- throw new ConversionBufferFullException();
- }
- currentState = GB18030_SINGLE_BYTE;
- output[byteOff++] = (byte) inputChar;
- }
- else if (inputChar <= 0xA4C6 || inputChar >= 0xE000) {
- int outByteVal = getGB18030(index1, index2, inputChar);
-
- if (outByteVal == 0xFFFD ) {
- if (subMode) {
- if (byteOff >= outEnd) {
- throw new ConversionBufferFullException();
- } else {
- output[byteOff++] = subBytes[0];
- continue;
- }
- } else {
- badInputLength = 1;
- throw new UnknownCharacterException();
- }
- }
-
- hiByte = (outByteVal & 0xFF00) >> 8;
- loByte = (outByteVal & 0xFF);
-
- linearDiffValue = (hiByte - 0x20) * 256 + loByte;
-
- if (inputChar >= 0xE000 && inputChar < 0xF900)
- linearDiffValue += 0x82BD;
- else if (inputChar >= 0xF900)
- linearDiffValue += 0x93A9;
-
- if (hiByte > 0x80)
- currentState = GB18030_DOUBLE_BYTE;
- else
- currentState = GB18030_FOUR_BYTE;
- }
- else if (inputChar >= 0xA4C7 && inputChar <= 0xD7FF) {
- linearDiffValue = inputChar - 0x5543;
- currentState = GB18030_FOUR_BYTE;
- }
- else {
- badInputLength = 1;
- throw new MalformedInputException();
- }
-
- if (currentState == GB18030_SINGLE_BYTE)
- continue;
-
- if (currentState == GB18030_DOUBLE_BYTE) {
- if (byteOff + 2 > outEnd) {
- throw new ConversionBufferFullException();
- }
- output[byteOff++] = (byte)hiByte;
- output[byteOff++] = (byte)loByte;
- }
- else { // Four Byte encoding
- if (byteOff + 4 > outEnd) {
- throw new ConversionBufferFullException();
- }
-
- byte b1, b2, b3, b4;
-
- b4 = (byte)((linearDiffValue % 10) + 0x30);
- linearDiffValue /= 10;
- b3 = (byte)((linearDiffValue % 126) + 0x81);
- linearDiffValue /= 126;
- b2 = (byte)((linearDiffValue % 10) + 0x30);
- b1 = (byte)((linearDiffValue / 10) + 0x81);
- output[byteOff++] = b1;
- output[byteOff++] = b2;
- output[byteOff++] = b3;
- output[byteOff++] = b4;
- }
- }
- // Return number of bytes written to the output buffer.
- return byteOff - outOff;
- }
-
-
- /**
- * returns the maximum number of bytes needed to convert a char
- */
- public int getMaxBytesPerChar() {
- return 4;
- }
-
-
- /**
- * Return the character set ID
- */
- public String getCharacterEncoding() {
- return "GB18030";
- }
-
- private int getGB18030(short[] outerIndex, String[] innerIndex, char ch) {
- int offset = outerIndex[((ch & 0xff00) >> 8 )] << 8;
-
- return innerIndex[offset >> 12].charAt((offset & 0xfff) + (ch & 0xff));
- }
-
-}
--- a/jdk/src/share/classes/sun/io/CharToByteGBK.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class CharToByteGBK extends CharToByteDBCS_ASCII {
-
- private static DoubleByte.Encoder enc =
- (DoubleByte.Encoder)new GBK().newEncoder();
-
- public String getCharacterEncoding() {
- return "GBK";
- }
-
- public CharToByteGBK() {
- super(enc);
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteISCII91.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,200 +0,0 @@
-/*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.ISCII91;
-
-/*
- * Copyright (c) 1998 International Business Machines.
- * All Rights Reserved.
- *
- * Author : Sunanda Bera, C. Thirumalesh
- * Last Modified : 11,December,1998
- *
- * Purpose : Defines class CharToByteISCII91.
- *
- *
- * Revision History
- * ======== =======
- *
- * Date By Description
- * ---- -- -----------
- * March 29, 1999 John Raley Removed MalformedInputException; modified substitution logic
- *
- */
-
-/**
- * Converter class. Converts between ISCII91 encoding and Unicode encoding.
- * ISCII91 is the character encoding as defined in Indian Standard document
- * IS 13194:1991 ( Indian Script Code for Information Interchange ).
- *
- * @see sun.io.CharToByteConverter
- */
-
-/*
- * {jbr} I am not sure this class adheres to code converter conventions.
- * Need to investigate.
- * Might should recode as a subclass of CharToByteSingleByte.
- */
-
-public class CharToByteISCII91 extends CharToByteConverter {
-
- private static final byte NO_CHAR = (byte)255;
-
- //private final static ISCII91 nioCoder = new ISCII91();
- private final static byte[] directMapTable = ISCII91.getEncoderMappingTable();
-
- private static final char NUKTA_CHAR = '\u093c';
- private static final char HALANT_CHAR = '\u094d';
-
-
-/**
- * @return true for Devanagari and ASCII range and for the special characters
- * Zero Width Joiner and Zero Width Non-Joiner
- * @see sun.io.CharToByteConverter#canConvert
- *
- */
- public boolean canConvert(char ch) {
- //check for Devanagari range,ZWJ,ZWNJ and ASCII range.
- return ((ch >= 0x0900 && ch <= 0x097f) || (ch == 0x200d || ch == 0x200c)
- || (ch >= 0x0000 && ch <= 0x007f) );
- } //canConvert()
-/**
- * Converts both Devanagari and ASCII range of characters.
- * @see sun.io.CharToByteConverter#convert
- */
- public int convert(char[] input, int inStart, int inEnd, byte[] output, int outStart, int outEnd) throws MalformedInputException, UnknownCharacterException, ConversionBufferFullException {
-
- charOff = inStart;
- byteOff = outStart;
-
- for (;charOff < inEnd; charOff++) {
-
- char inputChar = input[charOff];
- int index = Integer.MIN_VALUE;
- boolean isSurrogatePair = false;
-
- //check if input is in ASCII RANGE
- if (inputChar >= 0x0000 && inputChar <= 0x007f) {
- if (byteOff >= outEnd) {
- throw new ConversionBufferFullException();
- }
- output[byteOff++] = (byte) inputChar;
- continue;
- }
-
- // if inputChar == ZWJ replace it with halant
- // if inputChar == ZWNJ replace it with Nukta
- if (inputChar == 0x200c) {
- inputChar = HALANT_CHAR;
- }
- else if (inputChar == 0x200d) {
- inputChar = NUKTA_CHAR;
- }
-
- if (inputChar >= 0x0900 && inputChar <= 0x097f) {
- index = ((int)(inputChar) - 0x0900)*2;
- }
-
- // If input char is a high surrogate, ensure that the following
- // char is a low surrogate. If not, throw a MalformedInputException.
- // Leave index untouched so substitution or an UnknownCharacterException
- // will result.
- else if (inputChar >= 0xd800 && inputChar <= 0xdbff) {
- if (charOff < inEnd-1) {
- char nextChar = input[charOff];
- if (nextChar >= 0xdc00 && nextChar <= 0xdfff) {
- charOff++;
- isSurrogatePair = true;
- }
- }
- if (!isSurrogatePair) {
- badInputLength = 1;
- throw new MalformedInputException();
- }
- }
- else if (inputChar >= 0xdc00 && inputChar <= 0xdfff) {
- badInputLength = 1;
- throw new MalformedInputException();
- }
-
- if (index == Integer.MIN_VALUE || directMapTable[index] == NO_CHAR) {
- if (subMode) {
- if (byteOff + subBytes.length >= outEnd) {
- throw new ConversionBufferFullException();
- }
- System.arraycopy(subBytes, 0, output, byteOff, subBytes.length);
- byteOff += subBytes.length;
- } else {
- badInputLength = isSurrogatePair? 2 : 1;
- throw new UnknownCharacterException();
- }
- }
- else {
- if(byteOff >= outEnd) {
- throw new ConversionBufferFullException();
- }
- output[byteOff++] = directMapTable[index++];
- if(directMapTable[index] != NO_CHAR) {
- if(byteOff >= outEnd) {
- throw new ConversionBufferFullException();
- }
- output[byteOff++] = directMapTable[index];
- }
- }
-
- } //end for
-
- return byteOff - outStart;
- } //end of routine convert.
-
-/**
-* @see sun.io.CharToByteConverter#flush
-*/
- public int flush( byte[] output, int outStart, int outEnd )
- throws MalformedInputException, ConversionBufferFullException {
- byteOff = charOff = 0;
- return 0;
- }//flush()
-/**
- * @return The character encoding as a String.
- */
- public String getCharacterEncoding() {
- return "ISCII91";
- }//getCharacterEncoding
-/**
- * @see sun.io.CharToByteConverter#getMaxBytesPerChar
- */
- public int getMaxBytesPerChar() {
- return 2;
- }//getMaxBytesPerChar()
-/**
- * @see sun.io.CharToByteConverter#reset
- */
- public void reset() {
- byteOff = charOff = 0;
- }
-} //end of class definition
--- a/jdk/src/share/classes/sun/io/CharToByteISO2022.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,221 +0,0 @@
-/*
- * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-/**
-* @author Tom Zhou
-*/
-
-public abstract class CharToByteISO2022 extends CharToByteConverter
-{
- private final byte ISO_ESC = 0x1b;
- private final byte ISO_SI = 0x0f;
- private final byte ISO_SO = 0x0e;
- private final byte ISO_SS2_7 = 0x4e;
- private final byte ISO_SS3_7 = 0x4f;
- private final byte SS2 = (byte)0x8e;
- private final byte P2 = (byte)0xA2;
- private final byte P3 = (byte)0xA3;
- private final byte MSB = (byte)0x80;
-
- protected final byte maximumDesignatorLength = 4;
-
- protected String SODesignator,
- SS2Designator = null,
- SS3Designator = null;
-
- protected CharToByteConverter codeConverter;
-
- private boolean shiftout = false;
- private boolean SODesDefined = false;
- private boolean SS2DesDefined = false;
- private boolean SS3DesDefined = false;
-
- private boolean newshiftout = false;
- private boolean newSODesDefined = false;
- private boolean newSS2DesDefined = false;
- private boolean newSS3DesDefined = false;
-
- public int flush(byte[] output, int outStart, int outEnd)
- throws MalformedInputException
- {
- reset();
- return 0;
- }
-
- public void reset() {
- shiftout = false;
- SODesDefined = false;
- SS2DesDefined = false;
- SS3DesDefined = false;
- byteOff = charOff = 0;
- }
-
- public boolean canConvert(char ch)
- {
- if (ch<0x80)
- return true;
- return codeConverter.canConvert(ch);
- }
-
- private int unicodeToNative(char unicode, byte ebyte[])
- {
- int index = 0;
- byte tmpByte[];
- byte convByte[] = new byte[codeConverter.getMaxBytesPerChar()];
- char convChar[] = {unicode};
- int converted;
-
- try{
- converted = codeConverter.convert(convChar, 0, 1, convByte, 0,
- codeConverter.getMaxBytesPerChar());
- } catch(Exception e) {
- return -1;
- }
-
- if (converted == 2) {
- if (!SODesDefined) {
- newSODesDefined = true;
- ebyte[0] = ISO_ESC;
- tmpByte = SODesignator.getBytes();
- System.arraycopy(tmpByte,0,ebyte,1,tmpByte.length);
- index = tmpByte.length+1;
- }
- if (!shiftout) {
- newshiftout = true;
- ebyte[index++] = ISO_SO;
- }
- ebyte[index++] = (byte)(convByte[0]&0x7f);
- ebyte[index++] = (byte)(convByte[1]&0x7f);
- } else {
- if((convByte[0] == SS2)&&(convByte[1] == P2)) {
- if (!SS2DesDefined) {
- newSS2DesDefined = true;
- ebyte[0] = ISO_ESC;
- tmpByte = SS2Designator.getBytes();
- System.arraycopy(tmpByte,0,ebyte,1,tmpByte.length);
- index = tmpByte.length+1;
- }
- ebyte[index++] = ISO_ESC;
- ebyte[index++] = ISO_SS2_7;
- ebyte[index++] = (byte)(convByte[2]&0x7f);
- ebyte[index++] = (byte)(convByte[3]&0x7f);
- }
- if((convByte[0] == SS2)&&(convByte[1] == 0xA3))
- {
- if(!SS3DesDefined){
- newSS3DesDefined = true;
- ebyte[0] = ISO_ESC;
- tmpByte = SS3Designator.getBytes();
- System.arraycopy(tmpByte,0,ebyte,1,tmpByte.length);
- index = tmpByte.length+1;
- }
- ebyte[index++] = ISO_ESC;
- ebyte[index++] = ISO_SS3_7;
- ebyte[index++] = (byte)(convByte[2]&0x7f);
- ebyte[index++] = (byte)(convByte[3]&0x7f);
- }
- }
- return index;
- }
-
- /**
- * Character conversion
- */
- public int convert(char[] input, int inOff, int inEnd,
- byte[] output, int outOff, int outEnd)
- throws UnknownCharacterException, MalformedInputException,
- ConversionBufferFullException
- {
- int outputSize;
- byte [] tmpbuf = new byte[this.getMaxBytesPerChar()];
- byte [] outputByte;
-
- byteOff = outOff;
-
- newshiftout = shiftout;
- newSODesDefined = SODesDefined;
- newSS2DesDefined = SS2DesDefined;
- newSS3DesDefined = SS3DesDefined;
-
- //Fixed 4122961 by bringing the charOff++ out to this
- // loop where it belongs, changing the loop from
- // while(){} to for(){}.
- for (charOff = inOff; charOff < inEnd; charOff++) {
- outputByte = tmpbuf;
- if (input[charOff] < 0x80) { // ASCII
- if (shiftout){
- newshiftout = false;
- outputSize = 2;
- outputByte[0] = ISO_SI;
- outputByte[1] = (byte)(input[charOff] & 0x7f);
- } else {
- outputSize = 1;
- outputByte[0] = (byte)(input[charOff] & 0x7f);
- }
- if(input[charOff] == '\n'){
- newSODesDefined = false;
- newSS2DesDefined = false;
- newSS3DesDefined = false;
- }
- } else {
- outputSize = unicodeToNative(input[charOff], outputByte);
- }
-
- if (outputSize == -1) {
- if (subMode) {
- if(!newSODesDefined){
- newSODesDefined = !newSODesDefined;
- outputByte[0] = ISO_SO;
- outputByte[1] = (byte)'?';
- outputSize = 2;
- } else {
- outputByte = subBytes;
- outputSize = subBytes.length;
- }
- } else {
- badInputLength = 1;
- throw new UnknownCharacterException();
- }
- }
-
- if (outEnd - byteOff < outputSize)
- throw new ConversionBufferFullException();
-
- for (int i = 0; i < outputSize; i++)
- output[byteOff++] = outputByte[i];
-
- // Bug 4266772. Update statuses only when output buffer has been
- // updated. When ConversionBufferFullException() has been throwed
- // we want to keep old statuses for next call.
- shiftout = newshiftout;
- SODesDefined = newSODesDefined;
- SS2DesDefined = newSS2DesDefined;
- SS3DesDefined = newSS3DesDefined;
- }
- return byteOff - outOff;
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteISO2022CN_CNS.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-/**
-* @author Tom Zhou
-*/
-
-public class CharToByteISO2022CN_CNS extends CharToByteISO2022
-{
- public CharToByteISO2022CN_CNS()
- {
- SODesignator = "$)G";
- SS2Designator = "$*H";
- SS3Designator = "$+I";
- try {
- codeConverter = CharToByteConverter.getConverter("CNS11643");
- } catch (Exception e) {};
- }
-
- /**
- * returns the maximum number of bytes needed to convert a char
- */
- public int getMaxBytesPerChar()
- {
- return maximumDesignatorLength+4;
- }
-
- /**
- * Return the character set ID
- */
- public String getCharacterEncoding()
- {
- return "ISO2022CN_CNS";
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteISO2022CN_GB.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-/**
-* @author Tom Zhou
-*/
-
-public class CharToByteISO2022CN_GB extends CharToByteISO2022
-{
- public CharToByteISO2022CN_GB()
- {
- SODesignator = "$)A";
- try {
- codeConverter = CharToByteConverter.getConverter("GB2312");
- } catch (Exception e) {};
- }
-
- /**
- * returns the maximum number of bytes needed to convert a char
- */
- public int getMaxBytesPerChar()
- {
- return maximumDesignatorLength+4;
- }
-
- /**
- * Return the character set ID
- */
- public String getCharacterEncoding()
- {
- return "ISO2022CN_GB";
- }
-
-}
--- a/jdk/src/share/classes/sun/io/CharToByteISO2022JP.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,319 +0,0 @@
-/*
- * Copyright (c) 1996, 1999, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-import java.io.*;
-
-public class CharToByteISO2022JP extends CharToByteJIS0208 {
-
- private static final int ASCII = 0; // ESC ( B
- private static final int JISX0201_1976 = 1; // ESC ( J
- private static final int JISX0208_1978 = 2; // ESC $ @
- private static final int JISX0208_1983 = 3; // ESC $ B
- private static final int JISX0201_1976_KANA = 4; // ESC ( I
-
- private char highHalfZoneCode;
- private boolean flushed = true;
-
- // JIS is state full encoding, so currentMode keep the
- // current codeset
- private int currentMode = ASCII;
-
- /**
- * Bytes for substitute for unmappable input.
- */
- // XXX: Assumes subBytes are ASCII string. Need to change Escape sequence
- // for other character sets.
- protected byte[] subBytesEscape = { (byte)0x1b, (byte)0x28, (byte)0x42 }; // ESC ( B
- protected int subBytesMode = ASCII;
-
- public int flush(byte[] output, int outStart, int outEnd)
- throws MalformedInputException, ConversionBufferFullException
- {
- if (highHalfZoneCode != 0) {
- highHalfZoneCode = 0;
- badInputLength = 0;
- throw new MalformedInputException();
- }
-
- if (!flushed && (currentMode != ASCII)) {
- if (outEnd - outStart < 3) {
- throw new ConversionBufferFullException();
- }
- output[outStart] = (byte)0x1b;
- output[outStart + 1] = (byte)0x28;
- output[outStart + 2] = (byte)0x42;
- byteOff += 3;
- byteOff = charOff = 0;
- flushed = true;
- currentMode = ASCII;
- return 3;
- }
- return 0;
- }
-
- public int convert(char[] input, int inOff, int inEnd,
- byte[] output, int outOff, int outEnd)
- throws MalformedInputException, UnknownCharacterException,
- ConversionBufferFullException
-
- {
- char inputChar; // Input character to be converted
- int inputSize; // Size of the input
- int outputSize; // Size of the output
-
- // Buffer for output bytes
- byte[] tmpArray = new byte[6];
- byte[] outputByte;
-
- flushed = false;
-
- // Make copies of input and output indexes
- charOff = inOff;
- byteOff = outOff;
-
- if (highHalfZoneCode != 0) {
- inputChar = highHalfZoneCode;
- highHalfZoneCode = 0;
- if (input[inOff] >= 0xdc00 && input[inOff] <= 0xdfff) {
- // This is legal UTF16 sequence.
- badInputLength = 1;
- throw new UnknownCharacterException();
- } else {
- // This is illegal UTF16 sequence.
- badInputLength = 0;
- throw new MalformedInputException();
- }
- }
-
- // Loop until we run out of input
- while(charOff < inEnd) {
- outputByte = tmpArray;
- int newMode = currentMode; // Trace character mode changing
-
- // Get the input character
- inputChar = input[charOff];
- inputSize = 1;
- outputSize = 1;
-
- // Is this a high surrogate?
- if(inputChar >= '\uD800' && inputChar <= '\uDBFF') {
- // Is this the last character of the input?
- if (charOff + 1 >= inEnd) {
- highHalfZoneCode = inputChar;
- break;
- }
-
- // Is there a low surrogate following?
- inputChar = input[charOff + 1];
- if (inputChar >= '\uDC00' && inputChar <= '\uDFFF') {
- // We have a valid surrogate pair. Too bad we don't do
- // surrogates. Is substitution enabled?
- if (subMode) {
- if (currentMode != subBytesMode) {
- System.arraycopy(subBytesEscape, 0, outputByte, 0,
- subBytesEscape.length);
- outputSize = subBytesEscape.length;
- System.arraycopy(subBytes, 0, outputByte,
- outputSize, subBytes.length);
- outputSize += subBytes.length;
- newMode = subBytesMode;
- } else {
- outputByte = subBytes;
- outputSize = subBytes.length;
- }
- inputSize = 2;
- } else {
- badInputLength = 2;
- throw new UnknownCharacterException();
- }
- } else {
- // We have a malformed surrogate pair
- badInputLength = 1;
- throw new MalformedInputException();
- }
- }
-
- // Is this an unaccompanied low surrogate?
- else if (inputChar >= '\uDC00' && inputChar <= '\uDFFF') {
- badInputLength = 1;
- throw new MalformedInputException();
- } else {
- // Not part of a surrogate
-
- // Does this map to the Roman range?
- if (inputChar <= '\u007F') {
- if (currentMode != ASCII) {
- outputByte[0] = (byte)0x1b;
- outputByte[1] = (byte)0x28;
- outputByte[2] = (byte)0x42;
- outputByte[3] = (byte)inputChar;
- outputSize = 4;
- newMode = ASCII;
- } else {
- outputByte[0] = (byte)inputChar;
- outputSize = 1;
- }
- }
- // Is it a single byte kana?
- else if (inputChar >= 0xFF61 && inputChar <= 0xFF9F) {
- if (currentMode != JISX0201_1976_KANA) {
- outputByte[0] = (byte)0x1b;
- outputByte[1] = (byte)0x28;
- outputByte[2] = (byte)0x49;
- outputByte[3] = (byte)(inputChar - 0xff40);
- outputSize = 4;
- newMode = JISX0201_1976_KANA;
- } else {
- outputByte[0] = (byte)(inputChar - 0xff40);
- outputSize = 1;
- }
- }
- // Is it a yen sign?
- else if (inputChar == '\u00A5') {
- if (currentMode != JISX0201_1976) {
- outputByte[0] = (byte)0x1b;
- outputByte[1] = (byte)0x28;
- outputByte[2] = (byte)0x4a;
- outputByte[3] = (byte)0x5c;
- outputSize = 4;
- newMode = JISX0201_1976;
- } else {
- outputByte[0] = (byte)0x5C;
- outputSize = 1;
- }
- }
- // Is it a tilde?
- else if (inputChar == '\u203E')
- {
- if (currentMode != JISX0201_1976) {
- outputByte[0] = (byte)0x1b;
- outputByte[1] = (byte)0x28;
- outputByte[2] = (byte)0x4a;
- outputByte[3] = (byte)0x7e;
- outputSize = 4;
- newMode = JISX0201_1976;
- } else {
- outputByte[0] = (byte)0x7e;
- outputSize = 1;
- }
- }
- // Is it a JIS-X-0208 character?
- else {
- int index = getNative(inputChar);
- if (index != 0) {
- if (currentMode != JISX0208_1983) {
- outputByte[0] = (byte)0x1b;
- outputByte[1] = (byte)0x24;
- outputByte[2] = (byte)0x42;
- outputByte[3] = (byte)(index >> 8);
- outputByte[4] = (byte)(index & 0xff);
- outputSize = 5;
- newMode = JISX0208_1983;
- } else {
- outputByte[0] = (byte)(index >> 8);
- outputByte[1] = (byte)(index & 0xff);
- outputSize = 2;
- }
- }
- // It doesn't map to JIS-0208!
- else {
- if (subMode) {
- if (currentMode != subBytesMode) {
- System.arraycopy(subBytesEscape, 0, outputByte, 0,
- subBytesEscape.length);
- outputSize = subBytesEscape.length;
- System.arraycopy(subBytes, 0, outputByte,
- outputSize, subBytes.length);
- outputSize += subBytes.length;
- newMode = subBytesMode;
- } else {
- outputByte = subBytes;
- outputSize = subBytes.length;
- }
- } else {
- badInputLength = 1;
- throw new UnknownCharacterException();
- }
- }
- }
- }
-
- // Is there room in the output buffer?
- // XXX: The code assumes output buffer can hold at least 5 bytes,
- // in this coverter case. However, there is no way for apps to
- // see how many bytes will be necessary for next call.
- // getMaxBytesPerChar() should be overriden in every subclass of
- // CharToByteConverter and reflect real value (5 for this).
- if (byteOff + outputSize > outEnd)
- throw new ConversionBufferFullException();
-
- // Put the output into the buffer
- for ( int i = 0 ; i < outputSize ; i++ )
- output[byteOff++] = outputByte[i];
-
- // Advance the input pointer
- charOff += inputSize;
-
- // We can successfuly output the characters, changes
- // current mode. Fix for 4251646.
- currentMode = newMode;
- }
-
- // return mode ASCII at the end
- if (currentMode != ASCII){
- if (byteOff + 3 > outEnd)
- throw new ConversionBufferFullException();
-
- output[byteOff++] = 0x1b;
- output[byteOff++] = 0x28;
- output[byteOff++] = 0x42;
- currentMode = ASCII;
- }
-
- // Return the length written to the output buffer
- return byteOff-outOff;
- }
-
- // Reset
- public void reset() {
- highHalfZoneCode = 0;
- byteOff = charOff = 0;
- currentMode = ASCII;
- }
-
- /**
- * returns the maximum number of bytes needed to convert a char
- */
- public int getMaxBytesPerChar() {
- return 8;
- }
-
- // Return the character set ID
- public String getCharacterEncoding() {
- return "ISO2022JP";
- }
-
-}
--- a/jdk/src/share/classes/sun/io/CharToByteISO2022KR.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-public class CharToByteISO2022KR extends CharToByteISO2022
-{
- public CharToByteISO2022KR()
- {
- SODesignator = "$)C";
- try {
- codeConverter = CharToByteConverter.getConverter("KSC5601");
- } catch (Exception e) {};
- }
-
- /**
- * returns the maximum number of bytes needed to convert a char
- */
- public int getMaxBytesPerChar()
- {
- return maximumDesignatorLength+4;
- }
-
- /**
- * Return the character set ID
- */
- public String getCharacterEncoding()
- {
- return "ISO2022KR";
- }
-
-}
--- a/jdk/src/share/classes/sun/io/CharToByteISO8859_1.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,195 +0,0 @@
-/*
- * Copyright (c) 1996, 1998, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-public class CharToByteISO8859_1 extends CharToByteConverter {
-
- // Return the character set ID
- public String getCharacterEncoding()
- {
- return "ISO8859_1";
- }
-
- private char highHalfZoneCode;
-
- public int flush(byte[] output, int outStart, int outEnd)
- throws MalformedInputException
- {
- if (highHalfZoneCode != 0) {
- highHalfZoneCode = 0;
- throw new MalformedInputException
- ("String ends with <High Half Zone code> of UTF16");
- }
- byteOff = charOff = 0;
- return 0;
- }
-
- /*
- * Character conversion
- */
- public int convert(char[] input, int inOff, int inEnd,
- byte[] output, int outOff, int outEnd)
- throws MalformedInputException,
- UnknownCharacterException,
- ConversionBufferFullException
-
- {
-
- char inputChar; // Input character to be converted
- byte[] outputByte; // Output byte written to output
- byte[] tmpArray = new byte[1];
- int inputSize; // Size of input
- int outputSize; // Size of output
-
- // Record beginning offsets
- charOff = inOff;
- byteOff = outOff;
-
- if (highHalfZoneCode != 0) {
- inputChar = highHalfZoneCode;
- highHalfZoneCode = 0;
- if (input[inOff] >= 0xdc00 && input[inOff] <= 0xdfff) {
- // This is legal UTF16 sequence.
- if (subMode) {
- outputSize = subBytes.length;
- if (byteOff + outputSize > outEnd)
- throw new ConversionBufferFullException();
- for(int i = 0; i < outputSize; i++)
- output[byteOff++] = subBytes[i];
- charOff += 1;
- } else {
- badInputLength = 1;
- throw new UnknownCharacterException();
- }
- } else {
- // This is illegal UTF16 sequence.
- badInputLength = 0;
- throw new MalformedInputException
- ("Previous converted string ends with " +
- "<High Half Zone Code> of UTF16 " +
- ", but this string is not begin with <Low Half Zone>");
- }
- }
-
- // Loop until we hit the end of the input
- while(charOff < inEnd) {
- outputByte = tmpArray;
-
- // Get the input character
- inputChar = input[charOff];
-
- // default outputSize
- outputSize = 1;
-
- // Assume this is a simple character
- inputSize = 1;
-
- // Is this a high surrogate?
- if(inputChar >= '\uD800' && inputChar <= '\uDBFF') {
- // Is this the last character in the input?
- if (charOff + 1 == inEnd) {
- highHalfZoneCode = inputChar;
- break;
- }
-
- // Is there a low surrogate following?
- inputChar = input[charOff + 1];
- if (inputChar >= '\uDC00' && inputChar <= '\uDFFF') {
- // We have a valid surrogate pair. Too bad we don't map
- // surrogates. Is substitution enabled?
- if (subMode) {
- outputByte = subBytes;
- outputSize = subBytes.length;
- inputSize = 2;
- } else {
- badInputLength = 2;
- throw new UnknownCharacterException();
- }
- } else {
- // We have a malformed surrogate pair
- badInputLength = 1;
- throw new MalformedInputException();
- }
- }
- // Is this an unaccompanied low surrogate?
- else if (inputChar >= '\uDC00' && inputChar <= '\uDFFF') {
- badInputLength = 1;
- throw new MalformedInputException();
- }
- // Not part of a surrogate, so try to convert
- else {
- // Is this character mappable?
- if (inputChar <= '\u00FF') {
- outputByte[0] = (byte)inputChar;
- } else {
- // Is substitution enabled?
- if (subMode) {
- outputByte = subBytes;
- outputSize = subBytes.length;
- } else {
- badInputLength = 1;
- throw new UnknownCharacterException();
- }
- }
- }
-
- // If we don't have room for the output, throw an exception
- if (byteOff + outputSize > outEnd)
- throw new ConversionBufferFullException();
-
- // Put the byte in the output buffer
- for (int i = 0; i < outputSize; i++) {
- output[byteOff++] = outputByte[i];
- }
- charOff += inputSize;
- }
-
- // Return the length written to the output buffer
- return byteOff-outOff;
- }
-
- // Determine if a character is mappable or not
- public boolean canConvert(char ch)
- {
- return (ch <= '\u00FF');
- }
-
- // Reset the converter
- public void reset()
- {
- byteOff = charOff = 0;
- highHalfZoneCode = 0;
- }
-
- /**
- * returns the maximum number of bytes needed to convert a char
- */
- public int getMaxBytesPerChar()
- {
- return 1;
- }
-
-
-}
--- a/jdk/src/share/classes/sun/io/CharToByteISO8859_13.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ISO_8859_13;
-
-/**
- * Tables and data to convert Unicode to ISO8859_13
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteISO8859_13 extends CharToByteSingleByte {
-
- private final static ISO_8859_13 nioCoder = new ISO_8859_13();
-
- public String getCharacterEncoding() {
- return "ISO8859_13";
- }
-
- public CharToByteISO8859_13() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteISO8859_15.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * (C) Copyright IBM Corp. 1998 - All Rights Reserved
- *
- */
-
-package sun.io;
-
-import sun.nio.cs.ISO_8859_15;
-
-/**
- * Tables and data to convert Unicode to ISO8859_15
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteISO8859_15 extends CharToByteSingleByte {
-
- private final static ISO_8859_15 nioCoder = new ISO_8859_15();
-
- public String getCharacterEncoding() {
- return "ISO8859_15";
- }
-
- public CharToByteISO8859_15() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteISO8859_2.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ISO_8859_2;
-
-/**
- * Tables and data to convert Unicode to ISO8859_2
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteISO8859_2 extends CharToByteSingleByte {
-
- private final static ISO_8859_2 nioCoder = new ISO_8859_2();
-
- public String getCharacterEncoding() {
- return "ISO8859_2";
- }
-
- public CharToByteISO8859_2() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteISO8859_3.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.ISO_8859_3;
-
-/**
- * Tables and data to convert Unicode to ISO8859_3
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteISO8859_3 extends CharToByteSingleByte {
-
- private final static ISO_8859_3 nioCoder = new ISO_8859_3();
-
- public String getCharacterEncoding() {
- return "ISO8859_3";
- }
-
- public CharToByteISO8859_3() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteISO8859_4.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ISO_8859_4;
-
-/**
- * Tables and data to convert Unicode to ISO8859_4
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteISO8859_4 extends CharToByteSingleByte {
-
- private final static ISO_8859_4 nioCoder = new ISO_8859_4();
-
- public String getCharacterEncoding() {
- return "ISO8859_4";
- }
-
- public CharToByteISO8859_4() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteISO8859_5.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ISO_8859_5;
-
-/**
- * Tables and data to convert Unicode to ISO8859_5
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteISO8859_5 extends CharToByteSingleByte {
-
- private final static ISO_8859_5 nioCoder = new ISO_8859_5();
-
- public String getCharacterEncoding() {
- return "ISO8859_5";
- }
-
- public CharToByteISO8859_5() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteISO8859_6.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.ISO_8859_6;
-
-/**
- * Tables and data to convert Unicode to ISO8859_6
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteISO8859_6 extends CharToByteSingleByte {
-
- private final static ISO_8859_6 nioCoder = new ISO_8859_6();
-
- public String getCharacterEncoding() {
- return "ISO8859_6";
- }
-
- public CharToByteISO8859_6() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteISO8859_7.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ISO_8859_7;
-
-
-/**
- * Tables and data to convert Unicode to ISO8859_7
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteISO8859_7 extends CharToByteSingleByte {
-
- public String getCharacterEncoding() {
- return "ISO8859_7";
- }
-
- private final static ISO_8859_7 nioCoder = new ISO_8859_7();
-
- public CharToByteISO8859_7() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteISO8859_8.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.ISO_8859_8;
-
-/**
- * Tables and data to convert Unicode to ISO8859_8
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteISO8859_8 extends CharToByteSingleByte {
-
- private final static ISO_8859_8 nioCoder = new ISO_8859_8();
-
- public String getCharacterEncoding() {
- return "ISO8859_8";
- }
-
- public CharToByteISO8859_8() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteISO8859_9.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ISO_8859_9;
-
-/**
- * Tables and data to convert Unicode to ISO8859_9
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteISO8859_9 extends CharToByteSingleByte {
-
- private final static ISO_8859_9 nioCoder = new ISO_8859_9();
-
- public String getCharacterEncoding() {
- return "ISO8859_9";
- }
-
- public CharToByteISO8859_9() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteJIS0201.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,181 +0,0 @@
-/*
- * Copyright (c) 1996, 2008, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-/**
- * Tables and data to convert Unicode to JIS0201
- *
- * @author ConverterGenerator tool
- * @version >= JDK1.1.6
- */
-
-class CharToByteJIS0201 extends CharToByteSingleByte {
-
- public String getCharacterEncoding() {
- return "JIS0201";
- }
-
- public CharToByteJIS0201() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- /*
- super.index1 = index1;
- super.index2 = index2;
- */
- }
-
- public byte getNative(char inputChar) {
- return (byte)index2.charAt(index1[(inputChar & mask1) >> shift]
- + (inputChar & mask2));
- }
-
- public boolean canConvert(char ch) {
- if (index2.charAt(index1[((ch & mask1) >> shift)] + (ch & mask2)) != '\u0000')
- return true;
- return (ch == '\u0000');
- }
-
- private final static String index2 =
-
- "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007" +
- "\b\t\n\u000B\f\r\u000E\u000F" +
- "\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017" +
- "\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F" +
- "\u0020\u0021\"\u0023\u0024\u0025\u0026\'" +
- "\u0028\u0029\u002A\u002B\u002C\u002D\u002E\u002F" +
- "\u0030\u0031\u0032\u0033\u0034\u0035\u0036\u0037" +
- "\u0038\u0039\u003A\u003B\u003C\u003D\u003E\u003F" +
- "\u0040\u0041\u0042\u0043\u0044\u0045\u0046\u0047" +
- "\u0048\u0049\u004A\u004B\u004C\u004D\u004E\u004F" +
- "\u0050\u0051\u0052\u0053\u0054\u0055\u0056\u0057" +
- "\u0058\u0059\u005A\u005B\\\u005D\u005E\u005F" +
- "\u0060\u0061\u0062\u0063\u0064\u0065\u0066\u0067" +
- "\u0068\u0069\u006A\u006B\u006C\u006D\u006E\u006F" +
- "\u0070\u0071\u0072\u0073\u0074\u0075\u0076\u0077" +
- "\u0078\u0079\u007A\u007B\u007C\u007D\u007E\u007F" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\\\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u007E\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u00A1\u00A2\u00A3\u00A4\u00A5\u00A6\u00A7\u00A8" +
- "\u00A9\u00AA\u00AB\u00AC\u00AD\u00AE\u00AF\u00B0" +
- "\u00B1\u00B2\u00B3\u00B4\u00B5\u00B6\u00B7\u00B8" +
- "\u00B9\u00BA\u00BB\u00BC\u00BD\u00BE\u00BF\u00C0" +
- "\u00C1\u00C2\u00C3\u00C4\u00C5\u00C6\u00C7\u00C8" +
- "\u00C9\u00CA\u00CB\u00CC\u00CD\u00CE\u00CF\u00D0" +
- "\u00D1\u00D2\u00D3\u00D4\u00D5\u00D6\u00D7\u00D8" +
- "\u00D9\u00DA\u00DB\u00DC\u00DD\u00DE\u00DF\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
- "\u0000\u0000\u0000\u0000\u0000\u0000\u0000";
-
- private final static short index1[] = {
- 0, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166,
- 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166,
- 360, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166,
- 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166,
- 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166,
- 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166,
- 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166,
- 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166,
- 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166,
- 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166,
- 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166,
- 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166,
- 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166,
- 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166,
- 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166,
- 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 519,
- };
-
-}
--- a/jdk/src/share/classes/sun/io/CharToByteJIS0208.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.JIS_X_0208_Encoder;
-
-/**
- * Tables and data to convert Unicode to JIS0208
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteJIS0208 extends CharToByteDoubleByte {
-
- public String getCharacterEncoding() {
- return "JIS0208";
- }
-
- public CharToByteJIS0208() {
- super.index1 = JIS_X_0208_Encoder.getIndex1();
- super.index2 = JIS_X_0208_Encoder.getIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteJIS0208_Solaris.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.JIS_X_0208_Solaris_Encoder;
-
-/**
- * Tables and data to convert Unicode to JIS0208_Solaris
- *
- *
- * Vendor defined chars added for benefit of vendor defined character
- * supplemented mappings for EUC-JP-Solaris/PCK Solaris variants of EUC-JP
- * and SJIS/Shift_JIS (4765370)
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteJIS0208_Solaris extends CharToByteDoubleByte {
-
- public String getCharacterEncoding() {
- return "JIS0208_Solaris";
- }
-
- public CharToByteJIS0208_Solaris() {
- super.index1 = JIS_X_0208_Solaris_Encoder.getIndex1();
- super.index2 = JIS_X_0208_Solaris_Encoder.getIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteJIS0212.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-import sun.nio.cs.ext.JIS_X_0212_Encoder;
-
-/**
- * Tables and data to convert Unicode to JIS0212
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteJIS0212 extends CharToByteDoubleByte {
- public String getCharacterEncoding() {
- return "JIS0212";
- }
-
- public CharToByteJIS0212() {
- super.index1 = JIS_X_0212_Encoder.getIndex1();
- super.index2 = JIS_X_0212_Encoder.getIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteJIS0212_Solaris.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.JIS_X_0212_Solaris_Encoder;
-
-/**
- * Tables and data to convert Unicode to JIS0212_Solaris
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteJIS0212_Solaris extends CharToByteDoubleByte {
-
- public String getCharacterEncoding() {
- return "JIS0212_Solaris";
- }
-
- public CharToByteJIS0212_Solaris() {
- super.index1 = JIS_X_0212_Solaris_Encoder.getIndex1();
- super.index2 = JIS_X_0212_Solaris_Encoder.getIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteJohab.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class CharToByteJohab extends CharToByteDBCS_ASCII {
-
- private static DoubleByte.Encoder enc =
- (DoubleByte.Encoder)new Johab().newEncoder();
-
- public String getCharacterEncoding() {
- return "Johab";
- }
-
- public CharToByteJohab() {
- super(enc);
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteKOI8_R.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.KOI8_R;
-
-/**
- * Tables and data to convert Unicode to KOI8_R
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteKOI8_R extends CharToByteSingleByte {
-
- private final static KOI8_R nioCoder = new KOI8_R();
-
- public String getCharacterEncoding() {
- return "KOI8_R";
- }
-
- public CharToByteKOI8_R() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteMS874.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.MS874;
-
-/**
- * Tables and data to convert Unicode to MS874
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteMS874 extends CharToByteSingleByte {
-
- private final static MS874 nioCoder = new MS874();
-
- public String getCharacterEncoding() {
- return "MS874";
- }
-
- public CharToByteMS874() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteMS932.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class CharToByteMS932 extends CharToByteDBCS_ASCII {
-
- private static DoubleByte.Encoder enc =
- (DoubleByte.Encoder)new MS932().newEncoder();
-
- public String getCharacterEncoding() {
- return "MS932";
- }
-
- public CharToByteMS932() {
- super(enc);
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteMS936.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class CharToByteMS936 extends CharToByteDBCS_ASCII {
-
- private static DoubleByte.Encoder enc =
- (DoubleByte.Encoder)new MS936().newEncoder();
-
- public String getCharacterEncoding() {
- return "MS936";
- }
-
- public CharToByteMS936() {
- super(enc);
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteMS949.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class CharToByteMS949 extends CharToByteDBCS_ASCII {
-
- private static DoubleByte.Encoder enc =
- (DoubleByte.Encoder)new MS949().newEncoder();
-
- public String getCharacterEncoding() {
- return "MS949";
- }
-
- public CharToByteMS949() {
- super(enc);
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteMS950.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.io;
-
-import sun.nio.cs.ext.*;
-
-public class CharToByteMS950 extends CharToByteDBCS_ASCII {
-
- private static DoubleByte.Encoder enc =
- (DoubleByte.Encoder)new MS950().newEncoder();
-
- public String getCharacterEncoding() {
- return "MS950";
- }
-
- public CharToByteMS950() {
- super(enc);
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteMS950_HKSCS.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.DoubleByte;
-import sun.nio.cs.ext.MS950_HKSCS;
-
-public class CharToByteMS950_HKSCS extends CharToByteDBCS_ASCII {
-
- private static DoubleByte.Encoder enc =
- (DoubleByte.Encoder)new MS950_HKSCS().newEncoder();
-
- public String getCharacterEncoding() {
- return "MS950_HKSCS";
- }
-
- public CharToByteMS950_HKSCS() {
- super(enc);
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteMacArabic.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.MacArabic;
-
-/**
- * Tables and data to convert Unicode to MacArabic
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteMacArabic extends CharToByteSingleByte {
-
- private final static MacArabic nioCoder = new MacArabic();
-
- public String getCharacterEncoding() {
- return "MacArabic";
- }
-
- public CharToByteMacArabic() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteMacCentralEurope.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.MacCentralEurope;
-
-/**
- * Tables and data to convert Unicode to MacCentralEurope
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteMacCentralEurope extends CharToByteSingleByte {
-
- private final static MacCentralEurope nioCoder = new MacCentralEurope();
-
- public String getCharacterEncoding() {
- return "MacCentralEurope";
- }
-
- public CharToByteMacCentralEurope() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteMacCroatian.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.MacCroatian;
-
-/**
- * Tables and data to convert Unicode to MacCroatian
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteMacCroatian extends CharToByteSingleByte {
-
- private final static MacCroatian nioCoder = new MacCroatian();
-
- public String getCharacterEncoding() {
- return "MacCroatian";
- }
-
- public CharToByteMacCroatian() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteMacCyrillic.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.MacCyrillic;
-
-/**
- * Tables and data to convert Unicode to MacCyrillic
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteMacCyrillic extends CharToByteSingleByte {
-
- private final static MacCyrillic nioCoder = new MacCyrillic();
-
- public String getCharacterEncoding() {
- return "MacCyrillic";
- }
-
- public CharToByteMacCyrillic() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteMacDingbat.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.MacDingbat;
-
-/**
- * Tables and data to convert Unicode to MacDingbat
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteMacDingbat extends CharToByteSingleByte {
-
- private final static MacDingbat nioCoder = new MacDingbat();
-
- public String getCharacterEncoding() {
- return "MacDingbat";
- }
-
- public CharToByteMacDingbat() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteMacGreek.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.MacGreek;
-
-/**
- * Tables and data to convert Unicode to MacGreek
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteMacGreek extends CharToByteSingleByte {
-
- private final static MacGreek nioCoder = new MacGreek();
-
- public String getCharacterEncoding() {
- return "MacGreek";
- }
-
- public CharToByteMacGreek() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteMacHebrew.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.MacHebrew;
-
-/**
- * Tables and data to convert Unicode to MacHebrew
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteMacHebrew extends CharToByteSingleByte {
-
- private final static MacHebrew nioCoder = new MacHebrew();
-
- public String getCharacterEncoding() {
- return "MacHebrew";
- }
-
- public CharToByteMacHebrew() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteMacIceland.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.MacIceland;
-
-/**
- * Tables and data to convert Unicode to MacIceland
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteMacIceland extends CharToByteSingleByte {
-
- private final static MacIceland nioCoder = new MacIceland();
-
- public String getCharacterEncoding() {
- return "MacIceland";
- }
-
- public CharToByteMacIceland() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteMacRoman.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.MacRoman;
-
-/**
- * Tables and data to convert Unicode to MacRoman
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteMacRoman extends CharToByteSingleByte {
-
- private final static MacRoman nioCoder = new MacRoman();
-
- public String getCharacterEncoding() {
- return "MacRoman";
- }
-
- public CharToByteMacRoman() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteMacRomania.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.MacRomania;
-
-/**
- * Tables and data to convert Unicode to MacRomania
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteMacRomania extends CharToByteSingleByte {
-
- private final static MacRomania nioCoder = new MacRomania();
-
- public String getCharacterEncoding() {
- return "MacRomania";
- }
-
- public CharToByteMacRomania() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteMacSymbol.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.MacSymbol;
-
-/**
- * Tables and data to convert Unicode to MacSymbol
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteMacSymbol extends CharToByteSingleByte {
-
- private final static MacSymbol nioCoder = new MacSymbol();
-
- public String getCharacterEncoding() {
- return "MacSymbol";
- }
-
- public CharToByteMacSymbol() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteMacThai.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.MacThai;
-
-/**
- * Tables and data to convert Unicode to MacThai
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteMacThai extends CharToByteSingleByte {
-
- private final static MacThai nioCoder = new MacThai();
-
- public String getCharacterEncoding() {
- return "MacThai";
- }
-
- public CharToByteMacThai() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteMacTurkish.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.MacTurkish;
-
-/**
- * Tables and data to convert Unicode to MacTurkish
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteMacTurkish extends CharToByteSingleByte {
-
- private final static MacTurkish nioCoder = new MacTurkish();
-
- public String getCharacterEncoding() {
- return "MacTurkish";
- }
-
- public CharToByteMacTurkish() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteMacUkraine.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.MacUkraine;
-
-/**
- * Tables and data to convert Unicode to MacUkraine
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteMacUkraine extends CharToByteSingleByte {
-
- private final static MacUkraine nioCoder = new MacUkraine();
-
- public String getCharacterEncoding() {
- return "MacUkraine";
- }
-
- public CharToByteMacUkraine() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToBytePCK.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.JIS_X_0208_Solaris_Encoder;
-
-/**
- * @author Limin Shi
- * @author Mark Son-Bell
- * @author Ian Little
- *
- * PCK char->byte converter for Solaris platform containing additional
- * mappings for vendor defined chars (NEC row 13 & IBM extension chars)
- * (bugID 4765370)
- */
-public class CharToBytePCK extends CharToByteSJIS {
- CharToByteJIS0201 cbJIS0201 = new CharToByteJIS0201();
- short[] j0208Index1 = JIS_X_0208_Solaris_Encoder.getIndex1();
- String[] j0208Index2 = JIS_X_0208_Solaris_Encoder.getIndex2();
-
- public String getCharacterEncoding() {
- return "PCK";
- }
-
- protected int convSingleByte(char inputChar, byte[] outputByte) {
- byte b;
-
- // \u0000 - \u007F map straight through
- if ((inputChar & 0xFF80) == 0) {
- outputByte[0] = (byte)inputChar;
- return 1;
- }
-
- if ((b = cbJIS0201.getNative(inputChar)) == 0)
- return 0;
-
- outputByte[0] = b;
- return 1;
- }
-
- protected int getNative(char ch) {
- int result = 0;
-
- switch (ch) {
- case '\u2015':
- return 0x815C;
- case '\u2014':
- return 0;
- default:
- break;
- }
-
- if ((result = super.getNative(ch)) != 0) {
- return result;
- } else {
- int offset = j0208Index1[ch >> 8] << 8;
- int pos = j0208Index2[offset >> 12].charAt((offset & 0xfff) + (ch & 0xff));
-
- if (pos != 0) {
- /*
- * This algorithm for converting from JIS to SJIS comes from Ken Lunde's
- * "Understanding Japanese Information Processing", pg 163.
- */
- int c1 = (pos >> 8) & 0xff;
- int c2 = pos & 0xff;
- int rowOffset = c1 < 0x5F ? 0x70 : 0xB0;
- int cellOffset = (c1 % 2 == 1) ? (c2 > 0x5F ? 0x20 : 0x1F) : 0x7E;
- result = ((((c1 + 1 ) >> 1) + rowOffset) << 8) | (c2 + cellOffset);
- }
- }
- return result;
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteSJIS.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 1996, 1998, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-/**
- * @author Limin Shi
- * @author Mark Son-Bell
- */
-
-public class CharToByteSJIS extends CharToByteJIS0208 {
- CharToByteJIS0201 cbJIS0201 = new CharToByteJIS0201();
-
- public String getCharacterEncoding() {
- return "SJIS";
- }
-
- protected int convSingleByte(char inputChar, byte[] outputByte) {
- byte b;
-
- // \u0000 - \u007F map straight through
- if ((inputChar & 0xFF80) == 0) {
- outputByte[0] = (byte)inputChar;
- return 1;
- }
-
- if ((b = cbJIS0201.getNative(inputChar)) == 0)
- return 0;
-
- outputByte[0] = b;
- return 1;
- }
-
- protected int getNative(char ch) {
- int offset = index1[ch >> 8] << 8;
- int pos = index2[offset >> 12].charAt((offset & 0xfff) + (ch & 0xff));
- if (pos == 0) {
- /* Zero value indicates this Unicode has no mapping to JIS0208.
- * We bail here because the JIS -> SJIS algorithm produces
- * bogus SJIS values for invalid JIS input. Zero should be the
- * only invalid JIS value in our table.
- */
- return 0;
- }
- /*
- * This algorithm for converting from JIS to SJIS comes from Ken Lunde's
- * "Understanding Japanese Information Processing", pg 163.
- */
- int c1 = (pos >> 8) & 0xff;
- int c2 = pos & 0xff;
- int rowOffset = c1 < 0x5F ? 0x70 : 0xB0;
- int cellOffset = (c1 % 2 == 1) ? (c2 > 0x5F ? 0x20 : 0x1F) : 0x7E;
- return ((((c1 + 1 ) >> 1) + rowOffset) << 8) | (c2 + cellOffset);
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteSingleByte.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,265 +0,0 @@
-/*
- * Copyright (c) 1996, 2008, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import static sun.nio.cs.CharsetMapping.*;
-
-/**
-* A table driven conversion from char to byte for single byte
-* character sets. Tables will reside in the class CharToByteYYYYY,
-* where YYYYY is a unique character set identifier
-
- < TBD: Tables are of the form... >
-
-*
-* @author Lloyd Honomichl
-* @author Asmus Freytag
-* @version 8/28/96
-*/
-
-public abstract class CharToByteSingleByte extends CharToByteConverter {
-
- /*
- * 1st level index, provided by subclass
- */
- protected char[] index1;
-
- /*
- * 2nd level index, provided by subclass
- */
- protected char[] index2;
-
- /*
- * Mask to isolate bits for 1st level index, from subclass
- */
- protected int mask1;
-
- /*
- * Mask to isolate bits for 2nd level index, from subclass
- */
- protected int mask2;
-
- /*
- * Shift to isolate bits for 1st level index, from subclass
- */
- protected int shift;
-
- private char highHalfZoneCode;
-
- public char[] getIndex1() {
- return index1;
- }
-
- public char[] getIndex2() {
- return index2;
- }
- public int flush(byte[] output, int outStart, int outEnd)
- throws MalformedInputException
- {
- if (highHalfZoneCode != 0) {
- highHalfZoneCode = 0;
- badInputLength = 0;
- throw new MalformedInputException();
- }
- byteOff = charOff = 0;
- return 0;
- }
-
- /**
- * Converts characters to sequences of bytes.
- * Conversions that result in Exceptions can be restarted by calling
- * convert again, with appropriately modified parameters.
- * @return the characters written to output.
- * @param input char array containing text in Unicode
- * @param inStart offset in input array
- * @param inEnd offset of last byte to be converted
- * @param output byte array to receive conversion result
- * @param outStart starting offset
- * @param outEnd offset of last byte to be written to
- * @throw MalformedInputException for any sequence of chars that is
- * illegal in Unicode (principally unpaired surrogates
- * and \uFFFF or \uFFFE), including any partial surrogate pair
- * which occurs at the end of an input buffer.
- * @throw UnsupportedCharacterException for any character that
- * that cannot be converted to the external character set.
- */
- public int convert(char[] input, int inOff, int inEnd,
- byte[] output, int outOff, int outEnd)
- throws MalformedInputException,
- UnknownCharacterException,
- ConversionBufferFullException
- {
- char inputChar; // Input character to be converted
- byte[] outputByte; // Output byte written to output
- int inputSize; // Size of input
- int outputSize; // Size of output
-
- byte[] tmpArray = new byte[1];
-
- // Record beginning offsets
- charOff = inOff;
- byteOff = outOff;
-
- if (highHalfZoneCode != 0) {
- inputChar = highHalfZoneCode;
- highHalfZoneCode = 0;
- if (input[inOff] >= 0xdc00 && input[inOff] <= 0xdfff) {
- // This is legal UTF16 sequence.
- badInputLength = 1;
- throw new UnknownCharacterException();
- } else {
- // This is illegal UTF16 sequence.
- badInputLength = 0;
- throw new MalformedInputException();
- }
- }
-
- // Loop until we hit the end of the input
- while(charOff < inEnd) {
-
- outputByte = tmpArray;
-
- // Get the input character
- inputChar = input[charOff];
-
- // Default output size
- outputSize = 1;
-
- // Assume this is a simple character
- inputSize = 1;
-
- // Is this a high surrogate?
- if(inputChar >= '\uD800' && inputChar <= '\uDBFF') {
- // Is this the last character in the input?
- if (charOff + 1 >= inEnd) {
- highHalfZoneCode = inputChar;
- break;
- }
-
- // Is there a low surrogate following?
- inputChar = input[charOff + 1];
- if (inputChar >= '\uDC00' && inputChar <= '\uDFFF') {
- // We have a valid surrogate pair. Too bad we don't map
- // surrogates. Is substitution enabled?
- if (subMode) {
- outputByte = subBytes;
- outputSize = subBytes.length;
- inputSize = 2;
- } else {
- badInputLength = 2;
- throw new UnknownCharacterException();
- }
- } else {
- // We have a malformed surrogate pair
- badInputLength = 1;
- throw new MalformedInputException();
- }
- }
-
- // Is this an unaccompanied low surrogate?
- else if (inputChar >= '\uDC00' && inputChar <= '\uDFFF') {
- badInputLength = 1;
- throw new MalformedInputException();
- }
-
- // Not part of a surrogate, so look it up
- else {
- // Get output using two level lookup
- outputByte[0] = getNative(inputChar);
-
- // Might this character be unmappable?
- if (outputByte[0] == 0) {
- // If outputByte is zero because the input was zero
- // then this character is actually mappable
- if (input[charOff] != '\u0000') {
- // We have an unmappable character
- // Is substitution enabled?
- if (subMode) {
- outputByte = subBytes;
- outputSize = subBytes.length;
- } else {
- badInputLength = 1;
- throw new UnknownCharacterException();
- }
- }
- }
- }
-
- // If we don't have room for the output, throw an exception
- if (byteOff + outputSize > outEnd)
- throw new ConversionBufferFullException();
-
- // Put the byte in the output buffer
- for (int i = 0; i < outputSize; i++) {
- output[byteOff++] = outputByte[i];
- }
- charOff += inputSize;
-
- }
-
- // Return the length written to the output buffer
- return byteOff - outOff;
- }
-
- /**
- * the maximum number of bytes needed to hold a converted char
- * @returns the maximum number of bytes needed for a converted char
- */
- public int getMaxBytesPerChar() {
- return 1;
- }
-
- int encodeChar(char ch) {
- char index = index1[ch >> 8];
- if (index == UNMAPPABLE_ENCODING)
- return UNMAPPABLE_ENCODING;
- return index2[index + (ch & 0xff)];
- }
-
- public byte getNative(char inputChar) {
- int b = encodeChar(inputChar);
- if (b == UNMAPPABLE_ENCODING)
- return 0;
- return (byte)b;
- }
-
- /**
- * Resets the converter.
- * Call this method to reset the converter to its initial state
- */
- public void reset() {
- byteOff = charOff = 0;
- highHalfZoneCode = 0;
- }
-
- /**
- * Return whether a character is mappable or not
- * @return true if a character is mappable
- */
- public boolean canConvert(char ch) {
- return encodeChar(ch) != UNMAPPABLE_ENCODING;
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteTIS620.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import sun.nio.cs.ext.TIS_620;
-
-/**
- * Tables and data to convert Unicode to TIS620
- *
- * @author ConverterGenerator tool
- */
-
-public class CharToByteTIS620 extends CharToByteSingleByte {
-
- private final static TIS_620 nioCoder = new TIS_620();
-
- public String getCharacterEncoding() {
- return "TIS620";
- }
-
- public CharToByteTIS620() {
- super.mask1 = 0xFF00;
- super.mask2 = 0x00FF;
- super.shift = 8;
- super.index1 = nioCoder.getEncoderIndex1();
- super.index2 = nioCoder.getEncoderIndex2();
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteUTF16.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-
-/**
- * Convert arrays containing Unicode characters into arrays of bytes, using
- * big-endian byte order and writing an initial byte-order mark.
- */
-
-public class CharToByteUTF16 extends CharToByteUnicode {
-
- public CharToByteUTF16() {
- super(BIG, true);
- }
-
- public String getCharacterEncoding() {
- return "UTF-16";
- }
-
-}
--- a/jdk/src/share/classes/sun/io/CharToByteUTF8.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,159 +0,0 @@
-/*
- * Copyright (c) 1996, 1997, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.io;
-
-
-/**
- * UCS2 (UTF16) -> UCS Transformation Format 8 (UTF-8) converter
- * It's represented like below.
- *
- * # Bits Bit pattern
- * 1 7 0xxxxxxx
- * 2 11 110xxxxx 10xxxxxx
- * 3 16 1110xxxx 10xxxxxx 10xxxxxx
- * 4 21 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
- * 5 26 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
- * 6 31 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
- *
- * UCS2 uses 1-3 / UTF16 uses 1-4 / UCS4 uses 1-6
- */
-
-public class CharToByteUTF8 extends CharToByteConverter {
-
- private char highHalfZoneCode;
-
- public int flush(byte[] output, int outStart, int outEnd)
- throws MalformedInputException
- {
- if (highHalfZoneCode != 0) {
- highHalfZoneCode = 0;
- badInputLength = 0;
- throw new MalformedInputException();
- }
- byteOff = charOff = 0;
- return 0;
- }
-
- /**
- * Character conversion
- */
- public int convert(char[] input, int inOff, int inEnd,
- byte[] output, int outOff, int outEnd)
- throws ConversionBufferFullException, MalformedInputException
- {
- char inputChar;
- byte[] outputByte = new byte[6];
- int inputSize;
- int outputSize;
-
- charOff = inOff;
- byteOff = outOff;
-
- if (highHalfZoneCode != 0) {
- inputChar = highHalfZoneCode;
- highHalfZoneCode = 0;
- if (input[inOff] >= 0xdc00 && input[inOff] <= 0xdfff) {
- // This is legal UTF16 sequence.
- int ucs4 = (highHalfZoneCode - 0xd800) * 0x400
- + (input[inOff] - 0xdc00) + 0x10000;
- output[0] = (byte)(0xf0 | ((ucs4 >> 18)) & 0x07);
- output[1] = (byte)(0x80 | ((ucs4 >> 12) & 0x3f));
- output[2] = (byte)(0x80 | ((ucs4 >> 6) & 0x3f));
- output[3] = (byte)(0x80 | (ucs4 & 0x3f));
- charOff++;
- highHalfZoneCode = 0;
- } else {
- // This is illegal UTF16 sequence.
- badInputLength = 0;
- throw new MalformedInputException();
- }
- }
-
- while(charOff < inEnd) {
- inputChar = input[charOff];
- if (inputChar < 0x80) {
- outputByte[0] = (byte)inputChar;
- inputSize = 1;
- outputSize = 1;
- } else if (inputChar < 0x800) {
- outputByte[0] = (byte)(0xc0 | ((inputChar >> 6) & 0x1f));
- outputByte[1] = (byte)(0x80 | (inputChar & 0x3f));
- inputSize = 1;
- outputSize = 2;
- } else if (inputChar >= 0xd800 && inputChar <= 0xdbff) {
- // this is <high-half zone code> in UTF-16
- if (charOff + 1 >= inEnd) {
- highHalfZoneCode = inputChar;
- break;
- }
- // check next char is valid <low-half zone code>
- char lowChar = input[charOff + 1];
- if (lowChar < 0xdc00 || lowChar > 0xdfff) {
- badInputLength = 1;
- throw new MalformedInputException();
- }
- int ucs4 = (inputChar - 0xd800) * 0x400 + (lowChar - 0xdc00)
- + 0x10000;
- outputByte[0] = (byte)(0xf0 | ((ucs4 >> 18)) & 0x07);
- outputByte[1] = (byte)(0x80 | ((ucs4 >> 12) & 0x3f));
- outputByte[2] = (byte)(0x80 | ((ucs4 >> 6) & 0x3f));
- outputByte[3] = (byte)(0x80 | (ucs4 & 0x3f));
- outputSize = 4;
- inputSize = 2;
- } else {
- outputByte[0] = (byte)(0xe0 | ((inputChar >> 12)) & 0x0f);
- outputByte[1] = (byte)(0x80 | ((inputChar >> 6) & 0x3f));
- outputByte[2] = (byte)(0x80 | (inputChar & 0x3f));
- inputSize = 1;
- outputSize = 3;
- }
- if (byteOff + outputSize > outEnd) {
- throw new ConversionBufferFullException();
- }
- for (int i = 0; i < outputSize; i++) {
- output[byteOff++] = outputByte[i];
- }
- charOff += inputSize;
- }
- return byteOff - outOff;
- }
-
- public boolean canConvert(char ch) {
- return true;
- }
-
- public int getMaxBytesPerChar() {
- return 3;
- }
-
- public void reset() {
- byteOff = charOff = 0;
- highHalfZoneCode = 0;
- }
-
- public String getCharacterEncoding() {
- return "UTF8";
- }
-}
--- a/jdk/src/share/classes/sun/io/CharToByteUnicode.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,153 +0,0 @@
-/*
- * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-import java.io.*;
-
-
-/**
- * Convert arrays containing Unicode characters into arrays of bytes, using the
- * platform-default byte order.
- *
- * @author Mark Reinhold
- */
-
-public class CharToByteUnicode extends CharToByteConverter {
-
- static final char BYTE_ORDER_MARK = (char) 0xfeff;
- protected boolean usesMark = true; /* A mark should be written */
- private boolean markWritten = false; /* A mark has been written */
-
- static final int UNKNOWN = 0;
- static final int BIG = 1;
- static final int LITTLE = 2;
- protected int byteOrder = UNKNOWN;
-
- public CharToByteUnicode() {
- String enc = java.security.AccessController.doPrivileged(
- new sun.security.action.GetPropertyAction("sun.io.unicode.encoding",
- "UnicodeBig"));
- if (enc.equals("UnicodeBig"))
- byteOrder = BIG;
- else if (enc.equals("UnicodeLittle"))
- byteOrder = LITTLE;
- else
- byteOrder = BIG;
- }
-
- public CharToByteUnicode(int byteOrder, boolean usesMark) {
- this.byteOrder = byteOrder;
- this.usesMark = usesMark;
- }
-
- public CharToByteUnicode(boolean usesMark) {
- this();
- this.usesMark = usesMark;
- }
-
- public String getCharacterEncoding() {
- switch (byteOrder) {
- case BIG:
- return usesMark ? "UnicodeBig" : "UnicodeBigUnmarked";
- case LITTLE:
- return usesMark ? "UnicodeLittle" : "UnicodeLittleUnmarked";
- default:
- return "UnicodeUnknown";
- }
- }
-
- public int convert(char in[], int inOff, int inEnd,
- byte out[], int outOff, int outEnd)
- throws ConversionBufferFullException, MalformedInputException
- {
- charOff = inOff;
- byteOff = outOff;
-
- if (inOff >= inEnd)
- return 0;
-
- int inI = inOff,
- outI = outOff,
- outTop = outEnd - 2;
-
- if (usesMark && !markWritten) {
- if (outI > outTop)
- throw new ConversionBufferFullException();
- if (byteOrder == BIG) {
- out[outI++] = (byte) (BYTE_ORDER_MARK >> 8);
- out[outI++] = (byte) (BYTE_ORDER_MARK & 0xff);
- }
- else {
- out[outI++] = (byte) (BYTE_ORDER_MARK & 0xff);
- out[outI++] = (byte) (BYTE_ORDER_MARK >> 8);
- }
- markWritten = true;
- }
-
- if (byteOrder == BIG) {
- while (inI < inEnd) {
- if (outI > outTop) {
- charOff = inI;
- byteOff = outI;
- throw new ConversionBufferFullException();
- }
- char c = in[inI++];
- out[outI++] = (byte) (c >> 8);
- out[outI++] = (byte) (c & 0xff);
- }
- }
- else {
- while (inI < inEnd) {
- if (outI > outTop) {
- charOff = inI;
- byteOff = outI;
- throw new ConversionBufferFullException();
- }
- char c = in[inI++];
- out[outI++] = (byte) (c & 0xff);
- out[outI++] = (byte) (c >> 8);
- }
- }
-
- charOff = inI;
- byteOff = outI;
- return outI - outOff;
- }
-
- public int flush(byte in[], int inOff, int inEnd) {
- byteOff = charOff = 0;
- return 0;
- }
-
- public void reset () {
- byteOff = charOff = 0;
- markWritten = false;
- }
-
- public int getMaxBytesPerChar() {
- return 4; /* To allow for writing the byte-order mark */
- }
-
-}
--- a/jdk/src/share/classes/sun/io/CharToByteUnicodeBig.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 1996, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-
-/**
- * Convert arrays containing Unicode characters into arrays of bytes, using
- * big-endian byte order.
- *
- * @author Mark Reinhold
- */
-
-public class CharToByteUnicodeBig extends CharToByteUnicode {
-
- public CharToByteUnicodeBig () {
- byteOrder = BIG;
- }
-
-}
--- a/jdk/src/share/classes/sun/io/CharToByteUnicodeBigUnmarked.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 1996, 1999, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-
-/**
- * Convert arrays containing Unicode characters into arrays of bytes, using
- * big-endian byte order; do not write a byte-order mark before the first
- * converted character.
- *
- * @author Mark Reinhold
- */
-
-public class CharToByteUnicodeBigUnmarked extends CharToByteUnicode {
-
- public CharToByteUnicodeBigUnmarked () {
- byteOrder = BIG;
- usesMark = false;
- }
-
-}
--- a/jdk/src/share/classes/sun/io/CharToByteUnicodeLittle.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 1996, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-
-/**
- * Convert arrays containing Unicode characters into arrays of bytes, using
- * little-endian byte order.
- *
- * @author Mark Reinhold
- */
-
-public class CharToByteUnicodeLittle extends CharToByteUnicode {
-
- public CharToByteUnicodeLittle () {
- byteOrder = LITTLE;
- }
-
-}
--- a/jdk/src/share/classes/sun/io/CharToByteUnicodeLittleUnmarked.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 1996, 1999, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-
-/**
- * Convert arrays containing Unicode characters into arrays of bytes, using
- * little-endian byte order; do not write a byte-order mark before the first
- * converted character.
- *
- * @author Mark Reinhold
- */
-
-public class CharToByteUnicodeLittleUnmarked extends CharToByteUnicode {
-
- public CharToByteUnicodeLittleUnmarked () {
- byteOrder = LITTLE;
- usesMark = false;
- }
-
-}
--- a/jdk/src/share/classes/sun/io/CharacterEncoding.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,900 +0,0 @@
-/*
- * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import sun.security.action.GetPropertyAction;
-
-/*
- * This class is public in sun.io, so other sun.* packages (such as
- * HotJava) can use it, without exposing it to java.*.
- * Translates IANA encoding name to the string which is the part of
- * converter class.
- */
-
-/**
- * @deprecated Replaced by {@link java.nio.charset}. THIS API WILL BE
- * REMOVED IN J2SE 1.6.
- */
-@Deprecated
-public class CharacterEncoding {
-
- private static boolean sjisIsMS932;
-
- private static Map<String,String> aliasTable;
- private static volatile boolean installedAll;
-
- static {
- aliasTable = new HashMap<>(460, 1.0f); /* MDA */
-
- aliasTable.put("us-ascii", "ASCII");
- aliasTable.put("ascii", "ASCII");
- aliasTable.put("646", "ASCII"); // Solaris POSIX locale
- aliasTable.put("iso_646.irv:1983", "ASCII"); // Linux POSIX locale
- aliasTable.put("ansi_x3.4-1968", "ASCII"); // Caldera linux
- aliasTable.put("iso646-us", "ASCII");
- aliasTable.put("default", "ASCII"); // compatibility with obsolete "Default" converters
- aliasTable.put("ascii7", "ASCII"); // compatibility with obsolete "Default" converters
-
- // Core encodings
- aliasTable.put("8859_1", "ISO8859_1");
- aliasTable.put("iso8859_1", "ISO8859_1");
- aliasTable.put("utf-8", "UTF8");
- aliasTable.put("utf8", "UTF8");
- aliasTable.put("utf-16le", "UnicodeLittleUnmarked");
-
- // Standard encodings used on Solaris and Linux
- aliasTable.put("iso8859-1", "ISO8859_1");
- aliasTable.put("iso8859-2", "ISO8859_2");
- aliasTable.put("iso8859-4", "ISO8859_4");
- aliasTable.put("iso8859-5", "ISO8859_5");
- aliasTable.put("iso8859-6", "ISO8859_6");
- aliasTable.put("iso8859-8", "ISO8859_8");
- aliasTable.put("iso8859-9", "ISO8859_9");
- aliasTable.put("iso8859-13", "ISO8859_13");
- aliasTable.put("iso8859-15", "ISO8859_15");
- aliasTable.put("5601", "EUC_KR");
- aliasTable.put("ansi-1251", "Cp1251");
- aliasTable.put("big5", "Big5");
- aliasTable.put("big5hk", "Big5_HKSCS");
- aliasTable.put("eucjp", "EUC_JP");
- aliasTable.put("cns11643", "EUC_TW");
- aliasTable.put("gb2312", "EUC_CN");
- aliasTable.put("gb18030", "GB18030");
- aliasTable.put("gbk", "GBK");
- aliasTable.put("koi8-r", "KOI8_R");
- aliasTable.put("tis620.2533", "TIS620");
-
- // Windows encodings
- aliasTable.put("cp1250", "Cp1250");
- aliasTable.put("cp1251", "Cp1251");
- aliasTable.put("cp1252", "Cp1252");
- aliasTable.put("cp1253", "Cp1253");
- aliasTable.put("cp1254", "Cp1254");
- aliasTable.put("cp1255", "Cp1255");
- aliasTable.put("cp1256", "Cp1256");
- aliasTable.put("cp1257", "Cp1257");
- aliasTable.put("cp1258", "Cp1258");
- aliasTable.put("ms874", "MS874");
- aliasTable.put("ms932", "MS932");
- aliasTable.put("ms949", "MS949");
- aliasTable.put("ms950", "MS950");
- aliasTable.put("ms1361", "MS1361");
- }
-
- public static String aliasName(String name){
-
- if (name.startsWith("\1")) {
- // Emergency access to old converters
- name = name.substring(1);
- }
- // need to use Locale.US so we can load ISO converters in tr_TR locale
- String lower = name.toLowerCase(Locale.US);
- String val = aliasTable.get(lower);
-
- if (val == null && !installedAll) {
- installAll();
- val = aliasTable.get(lower);
- }
- return val;
- }
-
- private static synchronized void installAll() {
- if (!installedAll) {
- GetPropertyAction a = new GetPropertyAction("sun.nio.cs.map");
- String map = AccessController.doPrivileged(a);
- if (map != null) {
- sjisIsMS932 = map.equalsIgnoreCase("Windows-31J/Shift_JIS");
- } else {
- sjisIsMS932 = false;
- }
-
- // MIBenum: 4
- aliasTable.put("8859_1", "ISO8859_1");
- aliasTable.put("iso_8859-1:1987", "ISO8859_1");
- aliasTable.put("iso-ir-100", "ISO8859_1");
- aliasTable.put("iso_8859-1", "ISO8859_1");
- aliasTable.put("iso-8859-1", "ISO8859_1");
- aliasTable.put("iso8859-1", "ISO8859_1");
- aliasTable.put("latin1", "ISO8859_1");
- aliasTable.put("l1", "ISO8859_1");
- aliasTable.put("ibm819", "ISO8859_1");
- aliasTable.put("ibm-819", "ISO8859_1");
- aliasTable.put("cp819", "ISO8859_1");
- aliasTable.put("819", "ISO8859_1");
- aliasTable.put("csisolatin1", "ISO8859_1");
-
- // MIBenum: 5
- aliasTable.put("8859_2", "ISO8859_2");
- aliasTable.put("iso_8859-2:1987", "ISO8859_2");
- aliasTable.put("iso-ir-101", "ISO8859_2");
- aliasTable.put("iso_8859-2", "ISO8859_2");
- aliasTable.put("iso-8859-2", "ISO8859_2");
- aliasTable.put("iso8859-2", "ISO8859_2");
- aliasTable.put("latin2", "ISO8859_2");
- aliasTable.put("l2", "ISO8859_2");
- aliasTable.put("ibm912", "ISO8859_2");
- aliasTable.put("ibm-912", "ISO8859_2");
- aliasTable.put("cp912", "ISO8859_2");
- aliasTable.put("912", "ISO8859_2");
- aliasTable.put("csisolatin2", "ISO8859_2");
-
- // MIBenum: 6
- aliasTable.put("8859_3", "ISO8859_3");
- aliasTable.put("iso_8859-3:1988", "ISO8859_3");
- aliasTable.put("iso-ir-109", "ISO8859_3");
- aliasTable.put("iso_8859-3", "ISO8859_3");
- aliasTable.put("iso-8859-3", "ISO8859_3");
- aliasTable.put("iso8859-3", "ISO8859_3");
- aliasTable.put("latin3", "ISO8859_3");
- aliasTable.put("l3", "ISO8859_3");
- aliasTable.put("ibm913", "ISO8859_3");
- aliasTable.put("ibm-913", "ISO8859_3");
- aliasTable.put("cp913", "ISO8859_3");
- aliasTable.put("913", "ISO8859_3");
- aliasTable.put("csisolatin3", "ISO8859_3");
-
- // MIBenum: 7
- aliasTable.put("8859_4", "ISO8859_4");
- aliasTable.put("iso_8859-4:1988", "ISO8859_4");
- aliasTable.put("iso-ir-110", "ISO8859_4");
- aliasTable.put("iso_8859-4", "ISO8859_4");
- aliasTable.put("iso-8859-4", "ISO8859_4");
- aliasTable.put("iso8859-4", "ISO8859_4");
- aliasTable.put("latin4", "ISO8859_4");
- aliasTable.put("l4", "ISO8859_4");
- aliasTable.put("ibm914", "ISO8859_4");
- aliasTable.put("ibm-914", "ISO8859_4");
- aliasTable.put("cp914", "ISO8859_4");
- aliasTable.put("914", "ISO8859_4");
- aliasTable.put("csisolatin4", "ISO8859_4");
-
- // MIBenum: 8
- aliasTable.put("8859_5", "ISO8859_5");
- aliasTable.put("iso_8859-5:1988", "ISO8859_5");
- aliasTable.put("iso-ir-144", "ISO8859_5");
- aliasTable.put("iso_8859-5", "ISO8859_5");
- aliasTable.put("iso-8859-5", "ISO8859_5");
- aliasTable.put("iso8859-5", "ISO8859_5");
- aliasTable.put("cyrillic", "ISO8859_5");
- aliasTable.put("csisolatincyrillic", "ISO8859_5");
- aliasTable.put("ibm915", "ISO8859_5");
- aliasTable.put("ibm-915", "ISO8859_5");
- aliasTable.put("cp915", "ISO8859_5");
- aliasTable.put("915", "ISO8859_5");
-
- // MIBenum: 9
- aliasTable.put("8859_6", "ISO8859_6");
- aliasTable.put("iso_8859-6:1987", "ISO8859_6");
- aliasTable.put("iso-ir-127", "ISO8859_6");
- aliasTable.put("iso_8859-6", "ISO8859_6");
- aliasTable.put("iso-8859-6", "ISO8859_6");
- aliasTable.put("iso8859-6", "ISO8859_6");
- aliasTable.put("ecma-114", "ISO8859_6");
- aliasTable.put("asmo-708", "ISO8859_6");
- aliasTable.put("arabic", "ISO8859_6");
- aliasTable.put("csisolatinarabic", "ISO8859_6");
- aliasTable.put("ibm1089", "ISO8859_6");
- aliasTable.put("ibm-1089", "ISO8859_6");
- aliasTable.put("cp1089", "ISO8859_6");
- aliasTable.put("1089", "ISO8859_6");
-
- // MIBenum: 10
- aliasTable.put("8859_7", "ISO8859_7");
- aliasTable.put("iso_8859-7:1987", "ISO8859_7");
- aliasTable.put("iso-ir-126", "ISO8859_7");
- aliasTable.put("iso_8859-7", "ISO8859_7");
- aliasTable.put("iso-8859-7", "ISO8859_7");
- aliasTable.put("iso8859-7", "ISO8859_7");
- aliasTable.put("elot_928", "ISO8859_7");
- aliasTable.put("ecma-118", "ISO8859_7");
- aliasTable.put("greek", "ISO8859_7");
- aliasTable.put("greek8", "ISO8859_7");
- aliasTable.put("csisolatingreek", "ISO8859_7");
- aliasTable.put("ibm813", "ISO8859_7");
- aliasTable.put("ibm-813", "ISO8859_7");
- aliasTable.put("cp813", "ISO8859_7");
- aliasTable.put("813", "ISO8859_7");
- aliasTable.put("sun_eu_greek", "ISO8859_7");
-
- // MIBenum: 11
- aliasTable.put("8859_8", "ISO8859_8");
- aliasTable.put("iso_8859-8:1988", "ISO8859_8");
- aliasTable.put("iso-ir-138", "ISO8859_8");
- aliasTable.put("iso_8859-8", "ISO8859_8");
- aliasTable.put("iso-8859-8", "ISO8859_8");
- aliasTable.put("iso8859-8", "ISO8859_8");
- aliasTable.put("hebrew", "ISO8859_8");
- aliasTable.put("csisolatinhebrew", "ISO8859_8");
- aliasTable.put("ibm916", "ISO8859_8");
- aliasTable.put("ibm-916", "ISO8859_8");
- aliasTable.put("cp916", "ISO8859_8");
- aliasTable.put("916", "ISO8859_8");
-
- // MIBenum: 12
- aliasTable.put("8859_9", "ISO8859_9");
- aliasTable.put("iso-ir-148", "ISO8859_9");
- aliasTable.put("iso_8859-9", "ISO8859_9");
- aliasTable.put("iso-8859-9", "ISO8859_9");
- aliasTable.put("iso8859-9", "ISO8859_9");
- aliasTable.put("latin5", "ISO8859_9");
- aliasTable.put("l5", "ISO8859_9");
- aliasTable.put("ibm920", "ISO8859_9");
- aliasTable.put("ibm-920", "ISO8859_9");
- aliasTable.put("cp920", "ISO8859_9");
- aliasTable.put("920", "ISO8859_9");
- aliasTable.put("csisolatin5", "ISO8859_9");
-
- // MIBenum: ???
- aliasTable.put("8859_13", "ISO8859_13");
- aliasTable.put("iso_8859-13", "ISO8859_13");
- aliasTable.put("iso-8859-13", "ISO8859_13");
- aliasTable.put("iso8859-13", "ISO8859_13");
-
-
- // MIBenum: ????
- aliasTable.put("8859_15", "ISO8859_15");
- aliasTable.put("iso-8859-15", "ISO8859_15");
- aliasTable.put("iso_8859-15", "ISO8859_15");
- aliasTable.put("iso8859-15", "ISO8859_15");
- aliasTable.put("ibm923", "ISO8859_15");
- aliasTable.put("ibm-923", "ISO8859_15");
- aliasTable.put("cp923", "ISO8859_15");
- aliasTable.put("923", "ISO8859_15");
- aliasTable.put("latin0", "ISO8859_15");
- aliasTable.put("latin9", "ISO8859_15");
- aliasTable.put("csisolatin0", "ISO8859_15");
- aliasTable.put("csisolatin9", "ISO8859_15");
-
- //For compatibility purpose
- aliasTable.put("iso8859_15_fdis", "ISO8859_15");
-
- // MIBenum: 106
- aliasTable.put("utf-8", "UTF8");
-
- // Alias recommended in RFC 1641
- aliasTable.put("unicode-1-1-utf-8", "UTF8");
-
- // MIBenum: 1010
- aliasTable.put("unicode-1-1", "UnicodeBigUnmarked");
-
- // MIBenum: 1000
- aliasTable.put("iso-10646-ucs-2", "UnicodeBigUnmarked");
-
- // Per Unicode standard
- aliasTable.put("utf-16be", "UnicodeBigUnmarked");
- aliasTable.put("utf-16le", "UnicodeLittleUnmarked");
- aliasTable.put("utf-16", "UTF16");
-
- // Used by drag-and-drop subsystem
- aliasTable.put("x-utf-16be", "UnicodeBigUnmarked");
- aliasTable.put("x-utf-16le", "UnicodeLittleUnmarked");
-
- aliasTable.put("unicode", "Unicode");
-
- // MIBenum: ????
- aliasTable.put("ibm037", "Cp037");
- aliasTable.put("ibm-037", "Cp037");
- aliasTable.put("cp037", "Cp037");
- aliasTable.put("037", "Cp037");
-
- // MIBenum: ????
- aliasTable.put("ibm273", "Cp273");
- aliasTable.put("ibm-273", "Cp273");
- aliasTable.put("cp273", "Cp273");
- aliasTable.put("273", "Cp273");
-
- // MIBenum: ????
- aliasTable.put("ibm277", "Cp277");
- aliasTable.put("ibm-277", "Cp277");
- aliasTable.put("cp277", "Cp277");
- aliasTable.put("277", "Cp277");
-
- // MIBenum: ????
- aliasTable.put("ibm278", "Cp278");
- aliasTable.put("ibm-278", "Cp278");
- aliasTable.put("cp278", "Cp278");
- aliasTable.put("278", "Cp278");
-
- // MIBenum: ????
- aliasTable.put("ibm280", "Cp280");
- aliasTable.put("ibm-280", "Cp280");
- aliasTable.put("cp280", "Cp280");
- aliasTable.put("280", "Cp280");
-
- // MIBenum: ????
- aliasTable.put("ibm284", "Cp284");
- aliasTable.put("ibm-284", "Cp284");
- aliasTable.put("cp284", "Cp284");
- aliasTable.put("284", "Cp284");
-
- // MIBenum: ????
- aliasTable.put("ibm285", "Cp285");
- aliasTable.put("ibm-285", "Cp285");
- aliasTable.put("cp285", "Cp285");
- aliasTable.put("285", "Cp285");
-
- // MIBenum: ????
- aliasTable.put("ibm297", "Cp297");
- aliasTable.put("ibm-297", "Cp297");
- aliasTable.put("cp297", "Cp297");
- aliasTable.put("297", "Cp297");
-
- // MIBenum: ????
- aliasTable.put("ibm420", "Cp420");
- aliasTable.put("ibm-420", "Cp420");
- aliasTable.put("cp420", "Cp420");
- aliasTable.put("420", "Cp420");
-
- // MIBenum: ????
- aliasTable.put("ibm424", "Cp424");
- aliasTable.put("ibm-424", "Cp424");
- aliasTable.put("cp424", "Cp424");
- aliasTable.put("424", "Cp424");
-
- // MIBenum: 2011
- aliasTable.put("ibm437", "Cp437");
- aliasTable.put("ibm-437", "Cp437");
- aliasTable.put("cp437", "Cp437");
- aliasTable.put("437", "Cp437");
- aliasTable.put("cspc8codepage437", "Cp437");
-
- // MIBenum: ????
- aliasTable.put("ibm500", "Cp500");
- aliasTable.put("ibm-500", "Cp500");
- aliasTable.put("cp500", "Cp500");
- aliasTable.put("500", "Cp500");
-
- // MIBenum: ????
- aliasTable.put("ibm737", "Cp737");
- aliasTable.put("ibm-737", "Cp737");
- aliasTable.put("cp737", "Cp737");
- aliasTable.put("737", "Cp737");
-
- // MIBenum: ????
- aliasTable.put("ibm775", "Cp775");
- aliasTable.put("ibm-775", "Cp775");
- aliasTable.put("cp775", "Cp775");
- aliasTable.put("775", "Cp775");
-
- aliasTable.put("ibm833", "Cp833");
- aliasTable.put("ibm-833", "Cp833");
- aliasTable.put("cp833", "Cp833");
- aliasTable.put("833", "Cp833");
-
- aliasTable.put("ibm834", "Cp834");
- aliasTable.put("ibm-834", "Cp834");
- aliasTable.put("cp834", "Cp834");
- aliasTable.put("834", "Cp834");
-
- // MIBenum: ????
- aliasTable.put("ibm838", "Cp838"); /* MDA */
- aliasTable.put("ibm-838", "Cp838"); /* MDA */
- aliasTable.put("cp838", "Cp838"); /* MDA */
- aliasTable.put("838", "Cp838"); /* MDA */
-
- // "Cp850"
- // MIBenum: 2009
- aliasTable.put("ibm850", "Cp850");
- aliasTable.put("ibm-850", "Cp850");
- aliasTable.put("cp850", "Cp850");
- aliasTable.put("850", "Cp850");
- aliasTable.put("cspc850multilingual", "Cp850");
-
- // "Cp852"
- // MIBenum: 2010
- aliasTable.put("ibm852", "Cp852");
- aliasTable.put("ibm-852", "Cp852");
- aliasTable.put("cp852", "Cp852");
- aliasTable.put("852", "Cp852");
- aliasTable.put("cspcp852", "Cp852");
-
- // "Cp855"
- // MIBenum: 2046
- aliasTable.put("ibm855", "Cp855");
- aliasTable.put("ibm-855", "Cp855");
- aliasTable.put("cp855", "Cp855");
- aliasTable.put("855", "Cp855");
- aliasTable.put("cspcp855", "Cp855");
-
- // "Cp855"
- // MIBenum: ???
- aliasTable.put("ibm856", "Cp856");
- aliasTable.put("ibm-856", "Cp856");
- aliasTable.put("cp856", "Cp856");
- aliasTable.put("856", "Cp856");
-
- // "Cp857"
- // MIBenum: 2047
- aliasTable.put("ibm857", "Cp857");
- aliasTable.put("ibm-857", "Cp857");
- aliasTable.put("cp857", "Cp857");
- aliasTable.put("857", "Cp857");
- aliasTable.put("csibm857", "Cp857");
-
- // "Cp860"
- // MIBenum: 2048
- aliasTable.put("ibm860", "Cp860");
- aliasTable.put("ibm-860", "Cp860");
- aliasTable.put("cp860", "Cp860");
- aliasTable.put("860", "Cp860");
- aliasTable.put("csibm860", "Cp860");
-
- // MIBenum: 2049
- aliasTable.put("ibm861", "Cp861");
- aliasTable.put("ibm-861", "Cp861");
- aliasTable.put("cp861", "Cp861");
- aliasTable.put("cp-is", "Cp861");
- aliasTable.put("861", "Cp861");
- aliasTable.put("csibm861", "Cp861");
-
- // MIBenum: 2013
- aliasTable.put("ibm862", "Cp862");
- aliasTable.put("ibm-862", "Cp862");
- aliasTable.put("cp862", "Cp862");
- aliasTable.put("862", "Cp862");
- aliasTable.put("cspc862latinhebrew", "Cp862");
-
- // MIBenum: 2050
- aliasTable.put("ibm863", "Cp863");
- aliasTable.put("ibm-863", "Cp863");
- aliasTable.put("cp863", "Cp863");
- aliasTable.put("863", "Cp863");
- aliasTable.put("csibm863", "Cp863");
-
- // MIBenum: 2051
- aliasTable.put("ibm864", "Cp864");
- aliasTable.put("ibm-864", "Cp864");
- aliasTable.put("cp864", "Cp864");
- aliasTable.put("csibm864", "Cp864");
-
- // MIBenum: 2052
- aliasTable.put("ibm865", "Cp865");
- aliasTable.put("ibm-865", "Cp865");
- aliasTable.put("cp865", "Cp865");
- aliasTable.put("865", "Cp865");
- aliasTable.put("csibm865", "Cp865");
-
- // MIBenum: ????
- aliasTable.put("ibm866", "Cp866");
- aliasTable.put("ibm-866", "Cp866");
- aliasTable.put("cp866", "Cp866");
- aliasTable.put("866", "Cp866");
- aliasTable.put("csibm866", "Cp866");
-
- // MIBenum: ????
- aliasTable.put("ibm868", "Cp868");
- aliasTable.put("ibm-868", "Cp868");
- aliasTable.put("cp868", "Cp868");
- aliasTable.put("868", "Cp868");
-
- // MIBenum: 2054
- aliasTable.put("ibm869", "Cp869");
- aliasTable.put("ibm-869", "Cp869");
- aliasTable.put("cp869", "Cp869");
- aliasTable.put("869", "Cp869");
- aliasTable.put("cp-gr", "Cp869");
- aliasTable.put("csibm869", "Cp869");
-
- // MIBenum: ????
- aliasTable.put("ibm870", "Cp870");
- aliasTable.put("ibm-870", "Cp870");
- aliasTable.put("cp870", "Cp870");
- aliasTable.put("870", "Cp870");
-
- // MIBenum: ????
- aliasTable.put("ibm871", "Cp871");
- aliasTable.put("ibm-871", "Cp871");
- aliasTable.put("cp871", "Cp871");
- aliasTable.put("871", "Cp871");
-
- // MIBenum: ????
- aliasTable.put("ibm874", "Cp874");
- aliasTable.put("ibm-874", "Cp874");
- aliasTable.put("cp874", "Cp874");
- aliasTable.put("874", "Cp874");
-
- // MIBenum: ????
- aliasTable.put("ibm875", "Cp875");
- aliasTable.put("ibm-875", "Cp875");
- aliasTable.put("cp875", "Cp875");
- aliasTable.put("875", "Cp875");
-
- // MIBenum: ????
- aliasTable.put("ibm918", "Cp918");
- aliasTable.put("ibm-918", "Cp918");
- aliasTable.put("cp918", "Cp918");
- aliasTable.put("918", "Cp918");
-
- // MIBenum: ????
- aliasTable.put("ibm921", "Cp921");
- aliasTable.put("ibm-921", "Cp921");
- aliasTable.put("cp921", "Cp921");
- aliasTable.put("921", "Cp921");
-
- // MIBenum: ????
- aliasTable.put("ibm922", "Cp922");
- aliasTable.put("ibm-922", "Cp922");
- aliasTable.put("cp922", "Cp922");
- aliasTable.put("922", "Cp922");
-
- // MIBenum: ????
- aliasTable.put("ibm930", "Cp930"); /* MDA */
- aliasTable.put("ibm-930", "Cp930"); /* MDA */
- aliasTable.put("cp930", "Cp930"); /* MDA */
- aliasTable.put("930", "Cp930"); /* MDA */
-
- // MIBenum: ????
- aliasTable.put("ibm933", "Cp933"); /* MDA */
- aliasTable.put("ibm-933", "Cp933"); /* MDA */
- aliasTable.put("cp933", "Cp933"); /* MDA */
- aliasTable.put("933", "Cp933"); /* MDA */
-
- // MIBenum: ????
- aliasTable.put("ibm935", "Cp935"); /* MDA */
- aliasTable.put("ibm-935", "Cp935"); /* MDA */
- aliasTable.put("cp935", "Cp935"); /* MDA */
- aliasTable.put("935", "Cp935"); /* MDA */
-
- // MIBenum: ????
- aliasTable.put("ibm937", "Cp937"); /* MDA */
- aliasTable.put("ibm-937", "Cp937"); /* MDA */
- aliasTable.put("cp937", "Cp937"); /* MDA */
- aliasTable.put("937", "Cp937"); /* MDA */
-
- // MIBenum: ????
- aliasTable.put("ibm939", "Cp939"); /* MDA */
- aliasTable.put("ibm-939", "Cp939"); /* MDA */
- aliasTable.put("cp939", "Cp939"); /* MDA */
- aliasTable.put("939", "Cp939"); /* MDA */
-
- // MIBenum: ????
- aliasTable.put("ibm942", "Cp942"); /* MDA */
- aliasTable.put("ibm-942", "Cp942"); /* MDA */
- aliasTable.put("cp942", "Cp942"); /* MDA */
- aliasTable.put("942", "Cp942"); /* MDA */
-
- // MIBenum: ????
- aliasTable.put("ibm943", "Cp943"); /* ibm.3158 */
- aliasTable.put("ibm-943", "Cp943"); /* ibm.3158 */
- aliasTable.put("cp943", "Cp943"); /* ibm.3158 */
- aliasTable.put("943", "Cp943"); /* ibm.3158 */
-
- // MIBenum: ????
- aliasTable.put("ibm948", "Cp948"); /* MDA */
- aliasTable.put("ibm-948", "Cp948"); /* MDA */
- aliasTable.put("cp948", "Cp948"); /* MDA */
- aliasTable.put("948", "Cp948"); /* MDA */
-
- // MIBenum: ????
- aliasTable.put("ibm949", "Cp949"); /* MDA */
- aliasTable.put("ibm-949", "Cp949"); /* MDA */
- aliasTable.put("cp949", "Cp949"); /* MDA */
- aliasTable.put("949", "Cp949"); /* MDA */
-
- // MIBenum: ????
- aliasTable.put("ibm950", "Cp950"); /* MDA */
- aliasTable.put("ibm-950", "Cp950"); /* MDA */
- aliasTable.put("cp950", "Cp950"); /* MDA */
- aliasTable.put("950", "Cp950"); /* MDA */
-
- // MIBenum: ????
- aliasTable.put("ibm964", "Cp964"); /* MDA */
- aliasTable.put("ibm-964", "Cp964"); /* MDA */
- aliasTable.put("cp964", "Cp964"); /* MDA */
- aliasTable.put("964", "Cp964"); /* MDA */
-
- // MIBenum: ????
- aliasTable.put("ibm970", "Cp970"); /* MDA */
- aliasTable.put("ibm-970", "Cp970"); /* MDA */
- aliasTable.put("cp970", "Cp970"); /* MDA */
- aliasTable.put("970", "Cp970"); /* MDA */
-
- // MIBenum: ????
- aliasTable.put("ibm1006", "Cp1006");
- aliasTable.put("ibm-1006", "Cp1006");
- aliasTable.put("cp1006", "Cp1006");
- aliasTable.put("1006", "Cp1006");
-
- // MIBenum: ????
- aliasTable.put("ibm1025", "Cp1025");
- aliasTable.put("ibm-1025", "Cp1025");
- aliasTable.put("cp1025", "Cp1025");
- aliasTable.put("1025", "Cp1025");
-
- // MIBenum: ????
- aliasTable.put("ibm1026", "Cp1026");
- aliasTable.put("ibm-1026", "Cp1026");
- aliasTable.put("cp1026", "Cp1026");
- aliasTable.put("1026", "Cp1026");
-
- // MIBenum: ????
- aliasTable.put("ibm1097", "Cp1097");
- aliasTable.put("ibm-1097", "Cp1097");
- aliasTable.put("cp1097", "Cp1097");
- aliasTable.put("1097", "Cp1097");
-
- // MIBenum: ????
- aliasTable.put("ibm1098", "Cp1098");
- aliasTable.put("ibm-1098", "Cp1098");
- aliasTable.put("cp1098", "Cp1098");
- aliasTable.put("1098", "Cp1098");
-
- // MIBenum: ????
- aliasTable.put("ibm1112", "Cp1112");
- aliasTable.put("ibm-1112", "Cp1112");
- aliasTable.put("cp1112", "Cp1112");
- aliasTable.put("1112", "Cp1112");
-
- // MIBenum: ????
- aliasTable.put("ibm1122", "Cp1122");
- aliasTable.put("ibm-1122", "Cp1122");
- aliasTable.put("cp1122", "Cp1122");
- aliasTable.put("1122", "Cp1122");
-
- // MIBenum: ????
- aliasTable.put("ibm1123", "Cp1123");
- aliasTable.put("ibm-1123", "Cp1123");
- aliasTable.put("cp1123", "Cp1123");
- aliasTable.put("1123", "Cp1123");
-
- // MIBenum: ????
- aliasTable.put("ibm1124", "Cp1124");
- aliasTable.put("ibm-1124", "Cp1124");
- aliasTable.put("cp1124", "Cp1124");
- aliasTable.put("1124", "Cp1124");
-
- // MIBenum: ????
- aliasTable.put("ibm1381", "Cp1381"); /* MDA */
- aliasTable.put("ibm-1381", "Cp1381"); /* MDA */
- aliasTable.put("cp1381", "Cp1381"); /* MDA */
- aliasTable.put("1381", "Cp1381"); /* MDA */
-
- // MIBenum: ????
- aliasTable.put("ibm1383", "Cp1383"); /* MDA */
- aliasTable.put("ibm-1383", "Cp1383"); /* MDA */
- aliasTable.put("cp1383", "Cp1383"); /* MDA */
- aliasTable.put("1383", "Cp1383"); /* MDA */
-
- // Specialized auto-detection for Japanese charsets
- aliasTable.put("jis auto detect", "JISAutoDetect");
-
- // MIBenum: 16/39
- aliasTable.put("jis", "ISO2022JP");
- aliasTable.put("iso-2022-jp", "ISO2022JP");
- aliasTable.put("csiso2022jp", "ISO2022JP");
- aliasTable.put("jis_encoding", "ISO2022JP");
- aliasTable.put("csjisencoding", "ISO2022JP");
-
- // MIBenum: 17/2024
- aliasTable.put("windows-31j", "MS932");
- aliasTable.put("cswindows31j", "MS932");
-
- // JIS-defined Shift JIS
- aliasTable.put("\u30b7\u30d5\u30c8\u7b26\u53f7\u5316\u8868\u73fe",
- "SJIS"); // JIS name
- aliasTable.put("pck", "PCK"); // Case independent PCK alias
-
- if (sjisIsMS932) {
- aliasTable.put("shift_jis", "MS932"); // IANA shift jis aliases
- aliasTable.put("csshiftjis", "MS932"); // updated per 4556882
- aliasTable.put("x-sjis", "MS932");
- aliasTable.put("ms_kanji", "MS932");
- } else {
- aliasTable.put("shift_jis", "SJIS"); // IANA shift jis aliases
- aliasTable.put("csshiftjis", "SJIS");
- aliasTable.put("x-sjis", "SJIS");
- aliasTable.put("ms_kanji", "SJIS");
- }
-
- // MIBenum: 18
- // Japanese EUC
- aliasTable.put("eucjis", "EUC_JP");
- aliasTable.put("euc-jp", "EUC_JP");
- aliasTable.put("eucjp", "EUC_JP");
- aliasTable.put("extended_unix_code_packed_format_for_japanese",
- "EUC_JP");
- aliasTable.put("cseucpkdfmtjapanese", "EUC_JP");
- aliasTable.put("x-euc-jp", "EUC_JP");
- aliasTable.put("x-eucjp", "EUC_JP");
- aliasTable.put("eucjp-open", "EUC_JP_Solaris"); // 1.3.1_x compatibility
-
- // For handing only JIS0202 and JIS0208 in linux
- aliasTable.put("euc-jp-linux", "EUC_JP_LINUX");
-
- // MIBenum: 874
- aliasTable.put("windows-874", "MS874");
-
- // MIBenum: 2250
- aliasTable.put("windows-1250", "Cp1250");
-
- // MIBenum: 2251
- aliasTable.put("windows-1251", "Cp1251");
- aliasTable.put("ansi-1251", "Cp1251"); // Solaris ru_RU.ANSI1251 locale
-
- // MIBenum: 2252
- aliasTable.put("windows-1252", "Cp1252");
-
- // MIBenum: 2253
- aliasTable.put("windows-1253", "Cp1253");
-
- // MIBenum: 2254
- aliasTable.put("windows-1254", "Cp1254");
-
- // MIBenum: 2255
- aliasTable.put("windows-1255", "Cp1255");
-
- // MIBenum: 2256
- aliasTable.put("windows-1256", "Cp1256");
-
- // MIBenum: 2257
- aliasTable.put("windows-1257", "Cp1257");
-
- // MIBenum: 2258
- aliasTable.put("windows-1258", "Cp1258");
-
- // MIBenum: ????
- aliasTable.put("ibm33722", "Cp33722"); /* MDA */
- aliasTable.put("ibm-33722", "Cp33722"); /* MDA */
- aliasTable.put("cp33722", "Cp33722"); /* MDA */
- aliasTable.put("33722", "Cp33722"); /* MDA */
-
- // Russian KOI8-R
- aliasTable.put("koi8-r", "KOI8_R");
- aliasTable.put("koi8", "KOI8_R");
- aliasTable.put("cskoi8r", "KOI8_R");
-
- // Simplified Chinese
- aliasTable.put("gb2312", "EUC_CN");
- aliasTable.put("gb2312-80", "EUC_CN");
- aliasTable.put("gb2312-1980", "EUC_CN");
- aliasTable.put("euc-cn", "EUC_CN");
- aliasTable.put("euccn", "EUC_CN");
-
- aliasTable.put("big5", "Big5");
- aliasTable.put("big5hk", "Big5_HKSCS");
- aliasTable.put("big5-hkscs", "Big5_HKSCS");
- // Added for future compatibility, explicit mapping to Unicode 3.0
- aliasTable.put("big5-hkscs:unicode3.0", "Big5_HKSCS");
- aliasTable.put("big5_solaris", "Big5_Solaris");
-
- // Traditional Chinese
- aliasTable.put("cns11643", "EUC_TW");
- aliasTable.put("euc-tw", "EUC_TW");
- aliasTable.put("euctw", "EUC_TW");
-
- // Korean
- aliasTable.put("ksc5601", "EUC_KR");
- aliasTable.put("euc-kr", "EUC_KR");
- aliasTable.put("euckr", "EUC_KR");
- aliasTable.put("ks_c_5601-1987", "EUC_KR");
- aliasTable.put("ksc5601-1987", "EUC_KR");
- aliasTable.put("ksc5601_1987", "EUC_KR");
- aliasTable.put("ksc_5601", "EUC_KR");
- aliasTable.put("5601", "EUC_KR");
-
- aliasTable.put("ksc5601-1992", "Johab");
- aliasTable.put("ksc5601_1992", "Johab");
- aliasTable.put("ms1361", "Johab");
-
- aliasTable.put("windows-949", "MS949");
-
- //MIBenum: 37
- aliasTable.put("iso-2022-kr", "ISO2022KR");
- aliasTable.put("csiso2022kr", "ISO2022KR");
-
- // Thai
- aliasTable.put("tis620.2533", "TIS620");
- aliasTable.put("tis-620", "TIS620"); // Linux name
-
- // X11 Compound Text
- aliasTable.put("x-compound-text", "COMPOUND_TEXT");
- aliasTable.put("x11-compound_text", "COMPOUND_TEXT");
-
- // Variants
- aliasTable.put("cp942c", "Cp942C");
- aliasTable.put("cp943c", "Cp943C");
- aliasTable.put("cp949c", "Cp949C");
- aliasTable.put("iscii", "ISCII91");
-
- installedAll = true;
- }
- }
-
- /**
- * For Solaris:
- * always returns "PCK"
- *
- * For other platforms:
- * method returns "MS932" if the file.encoding property value is "MS932"
- * or an alias of "MS932"
- * otherwise, "SJIS", regardless of its
- * actual file.encoding value. This method is called from the JIS
- * Auto Detect converter.
- */
- static String getSJISName() {
- String encodeName = AccessController.doPrivileged(
- new PrivilegedAction<String>() {
- public String run() {
- String osName = System.getProperty("os.name");
- if (osName.equals("Solaris") || osName.equals("SunOS")){
- return "PCK";
- }
- else {
- return System.getProperty("file.encoding", null);
- }
- }
- });
-
- if (encodeName != null) {
- if (encodeName.equals("MS932"))
- return encodeName;
- encodeName = aliasName(encodeName);
- }
- return (encodeName != null && encodeName.equals("MS932")) ? encodeName : "SJIS";
- }
-
-
- static String getEUCJPName() {
- String encodeName = AccessController.doPrivileged(
- new PrivilegedAction<String>() {
- public String run() {
- String osName = System.getProperty("os.name");
- if (osName.equals("Solaris") || osName.equals("SunOS"))
- return "eucJP-open";
- else
- return "EUC_JP";
- }
- });
- return encodeName;
- }
-}
--- a/jdk/src/share/classes/sun/io/ConversionBufferFullException.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 1996, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-
-/**
- * The output buffer for a character conversion is full, but additional
- * input remains to be converted
- *
- * @author Asmus Freytag
- *
- * @deprecated Replaced by {@link java.nio.charset}. THIS API WILL BE
- * REMOVED IN J2SE 1.6.
- */
-@Deprecated
-public class ConversionBufferFullException
- extends java.io.CharConversionException
-{
- private static final long serialVersionUID = -6537318994265003622L;
-
- /**
- * Constructs a BufferFullException with no detail message.
- * A detail message is a String that describes this particular exception.
- */
- public ConversionBufferFullException() {
- super();
- }
-
- /**
- * Constructs a BufferFullException with the specified detail message.
- * A detail message is a String that describes this particular exception.
- * @param s the String containing a detail message
- */
- public ConversionBufferFullException(String s) {
- super(s);
- }
-}
--- a/jdk/src/share/classes/sun/io/Converters.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,341 +0,0 @@
-/*
- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-import java.io.UnsupportedEncodingException;
-import java.lang.ref.SoftReference;
-import java.util.Properties;
-
-/**
- * Package-private utility class that caches the default converter classes and
- * provides other logic common to both the ByteToCharConverter and
- * CharToByteConverter classes.
- *
- * @author Mark Reinhold
- * @since 1.2
- *
- * @deprecated Replaced by {@link java.nio.charset}. THIS API WILL BE
- * REMOVED IN J2SE 1.6.
- */
-@Deprecated
-public class Converters {
-
- private Converters() { } /* To prevent instantiation */
-
- /* Lock for all static fields in this class */
- private static Object lock = Converters.class;
-
- /* Cached values of system properties */
- private static String converterPackageName = null; /* file.encoding.pkg */
- private static String defaultEncoding = null; /* file.encoding */
-
- /* Converter type constants and names */
- public static final int BYTE_TO_CHAR = 0;
- public static final int CHAR_TO_BYTE = 1;
- private static final String[] converterPrefix = { "ByteToChar",
- "CharToByte" };
-
-
- // -- Converter class cache --
-
- private static final int CACHE_SIZE = 3;
-
- /* For the default charset, whatever it turns out to be */
- private static final Object DEFAULT_NAME = new Object();
-
- /* Cached converter classes, CACHE_SIZE per converter type. Each cache
- * entry is a soft reference to a two-object array; the first element of
- * the array is the converter class, the second is an object (typically a
- * string) representing the encoding name that was used to request the
- * converter, e.g.,
- *
- * ((Object[])classCache[CHAR_TO_BYTE][i].get())[0]
- *
- * will be a CharToByteConverter and
- *
- * ((Object[])classCache[CHAR_TO_BYTE][i].get())[1]
- *
- * will be the string encoding name used to request it, assuming that cache
- * entry i is valid.
- *
- * Ordinarily we'd do this with a private static utility class, but since
- * this code can be involved in the startup sequence it's important to keep
- * the footprint down.
- */
- @SuppressWarnings("unchecked")
- private static SoftReference<Object[]>[][] classCache
- = (SoftReference<Object[]>[][]) new SoftReference<?>[][] {
- new SoftReference<?>[CACHE_SIZE],
- new SoftReference<?>[CACHE_SIZE]
- };
-
- private static void moveToFront(Object[] oa, int i) {
- Object ob = oa[i];
- for (int j = i; j > 0; j--)
- oa[j] = oa[j - 1];
- oa[0] = ob;
- }
-
- private static Class<?> cache(int type, Object encoding) {
- SoftReference<Object[]>[] srs = classCache[type];
- for (int i = 0; i < CACHE_SIZE; i++) {
- SoftReference<Object[]> sr = srs[i];
- if (sr == null)
- continue;
- Object[] oa = sr.get();
- if (oa == null) {
- srs[i] = null;
- continue;
- }
- if (oa[1].equals(encoding)) {
- moveToFront(srs, i);
- return (Class<?>)oa[0];
- }
- }
- return null;
- }
-
- private static Class<?> cache(int type, Object encoding, Class<?> c) {
- SoftReference<Object[]>[] srs = classCache[type];
- srs[CACHE_SIZE - 1] = new SoftReference<>(new Object[] { c, encoding });
- moveToFront(srs, CACHE_SIZE - 1);
- return c;
- }
-
- /* Used to avoid doing expensive charset lookups for charsets that are not
- * yet directly supported by NIO.
- */
- public static boolean isCached(int type, String encoding) {
- synchronized (lock) {
- SoftReference<Object[]>[] srs = classCache[type];
- for (int i = 0; i < CACHE_SIZE; i++) {
- SoftReference<Object[]> sr = srs[i];
- if (sr == null)
- continue;
- Object[] oa = sr.get();
- if (oa == null) {
- srs[i] = null;
- continue;
- }
- if (oa[1].equals(encoding))
- return true;
- }
- return false;
- }
- }
-
-
-
- /** Get the name of the converter package */
- private static String getConverterPackageName() {
- String cp = converterPackageName;
- if (cp != null) return cp;
- java.security.PrivilegedAction<String> pa =
- new sun.security.action.GetPropertyAction("file.encoding.pkg");
- cp = java.security.AccessController.doPrivileged(pa);
- if (cp != null) {
- /* Property is set, so take it as the true converter package */
- converterPackageName = cp;
- } else {
- /* Fall back to sun.io */
- cp = "sun.io";
- }
- return cp;
- }
-
- public static String getDefaultEncodingName() {
- synchronized (lock) {
- if (defaultEncoding == null) {
- java.security.PrivilegedAction<String> pa =
- new sun.security.action.GetPropertyAction("file.encoding");
- defaultEncoding = java.security.AccessController.doPrivileged(pa);
- }
- }
- return defaultEncoding;
- }
-
- public static void resetDefaultEncodingName() {
- // This method should only be called during VM initialization.
- if (sun.misc.VM.isBooted())
- return;
-
- synchronized (lock) {
- defaultEncoding = "ISO-8859-1";
- Properties p = System.getProperties();
- p.setProperty("file.encoding", defaultEncoding);
- System.setProperties(p);
- }
- }
-
- /**
- * Get the class that implements the given type of converter for the named
- * encoding, or throw an UnsupportedEncodingException if no such class can
- * be found
- */
- private static Class<?> getConverterClass(int type, String encoding)
- throws UnsupportedEncodingException
- {
- String enc = null;
-
- /* "ISO8859_1" is the canonical name for the ISO-Latin-1 encoding.
- Native code in the JDK commonly uses the alias "8859_1" instead of
- "ISO8859_1". We hardwire this alias here in order to avoid loading
- the full alias table just for this case. */
- if (!encoding.equals("ISO8859_1")) {
- if (encoding.equals("8859_1")) {
- enc = "ISO8859_1";
- /*
- * On Solaris with nl_langinfo() called in GetJavaProperties():
- *
- * locale undefined -> NULL -> hardcoded default
- * "C" locale -> "" -> hardcoded default (on 2.6)
- * "C" locale -> "646" (on 2.7)
- * "en_US" locale -> "ISO8859-1"
- * "en_GB" locale -> "ISO8859-1" (on 2.7)
- * "en_UK" locale -> "ISO8859-1" (on 2.6)
- */
- } else if (encoding.equals("ISO8859-1")) {
- enc = "ISO8859_1";
- } else if (encoding.equals("646")) {
- enc = "ASCII";
- } else {
- enc = CharacterEncoding.aliasName(encoding);
- }
- }
- if (enc == null) {
- enc = encoding;
- }
-
- try {
- return Class.forName(getConverterPackageName()
- + "." + converterPrefix[type] + enc);
- } catch(ClassNotFoundException e) {
- throw new UnsupportedEncodingException(enc);
- }
-
- }
-
- /**
- * Instantiate the given converter class, or throw an
- * UnsupportedEncodingException if it cannot be instantiated
- */
- private static Object newConverter(String enc, Class<?> c)
- throws UnsupportedEncodingException
- {
- try {
- return c.newInstance();
- } catch(InstantiationException e) {
- throw new UnsupportedEncodingException(enc);
- } catch(IllegalAccessException e) {
- throw new UnsupportedEncodingException(enc);
- }
- }
-
- /**
- * Create a converter object that implements the given type of converter
- * for the given encoding, or throw an UnsupportedEncodingException if no
- * appropriate converter class can be found and instantiated
- */
- static Object newConverter(int type, String enc)
- throws UnsupportedEncodingException
- {
- Class<?> c;
- synchronized (lock) {
- c = cache(type, enc);
- if (c == null) {
- c = getConverterClass(type, enc);
- if (!c.getName().equals("sun.io.CharToByteUTF8"))
- cache(type, enc, c);
- }
- }
- return newConverter(enc, c);
- }
-
- /**
- * Find the class that implements the given type of converter for the
- * default encoding. If the default encoding cannot be determined or is
- * not yet defined, return a class that implements the fallback default
- * encoding, which is just ISO 8859-1.
- */
- private static Class<?> getDefaultConverterClass(int type) {
- boolean fillCache = false;
- Class<?> c;
-
- /* First check the class cache */
- c = cache(type, DEFAULT_NAME);
- if (c != null)
- return c;
-
- /* Determine the encoding name */
- String enc = getDefaultEncodingName();
- if (enc != null) {
- /* file.encoding has been set, so cache the converter class */
- fillCache = true;
- } else {
- /* file.encoding has not been set, so use a default encoding which
- will not be cached */
- enc = "ISO8859_1";
- }
-
- /* We have an encoding name; try to find its class */
- try {
- c = getConverterClass(type, enc);
- if (fillCache) {
- cache(type, DEFAULT_NAME, c);
- }
- } catch (UnsupportedEncodingException x) {
- /* Can't find the default class, so fall back to ISO 8859-1 */
- try {
- c = getConverterClass(type, "ISO8859_1");
- } catch (UnsupportedEncodingException y) {
- throw new InternalError("Cannot find default "
- + converterPrefix[type]
- + " converter class");
- }
- }
- return c;
-
- }
-
- /**
- * Create a converter object that implements the given type of converter
- * for the default encoding, falling back to ISO 8859-1 if the default
- * encoding cannot be determined.
- */
- static Object newDefaultConverter(int type) {
- Class<?> c;
- synchronized (lock) {
- c = getDefaultConverterClass(type);
- }
- try {
- return newConverter("", c);
- } catch (UnsupportedEncodingException x) {
- throw new InternalError("Cannot instantiate default converter"
- + " class " + c.getName());
- }
- }
-
-}
--- a/jdk/src/share/classes/sun/io/MalformedInputException.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 1996, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-
-/**
-* The input string or input byte array to a character conversion
-* contains a malformed sequence of characters or bytes.
-*
-* @author Asmus Freytag
-*
-* @deprecated Replaced by {@link java.nio.charset}. THIS API WILL BE
-* REMOVED IN J2SE 1.6.
-*/
-@Deprecated
-public class MalformedInputException
- extends java.io.CharConversionException
-{
- private static final long serialVersionUID = 2585413228493157652L;
-
- /**
- * Constructs a MalformedInputException with no detail message.
- * A detail message is a String that describes this particular exception.
- */
- public MalformedInputException() {
- super();
- }
-
- /**
- * Constructs a MalformedInputException with the specified detail message.
- * A detail message is a String that describes this particular exception.
- * @param s the String containing a detail message
- */
- public MalformedInputException(String s) {
- super(s);
- }
-}
--- a/jdk/src/share/classes/sun/io/UnknownCharacterException.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 1996, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.io;
-
-
-/**
-* A character conversion encountered a character
-* that does not have an assigned mapping, and automatic
-* substitution is not selected
-*
-* @author Asmus Freytag
-* @deprecated Replaced by {@link java.nio.charset}. THIS API WILL BE
-* REMOVED IN J2SE 1.6.
-*/
-@Deprecated
-public class UnknownCharacterException
- extends java.io.CharConversionException
-{
- private static final long serialVersionUID = -8563196502398436986L;
-
- /**
- * Constructs a UnknownCharacterException with no detail message.
- * A detail message is a String that describes this particular exception.
- */
- public UnknownCharacterException() {
- super();
- }
-
- /**
- * Constructs a UnknownCharacterException with the specified detail message.
- * A detail message is a String that describes this particular exception.
- * @param s the String containing a detail message
- */
- public UnknownCharacterException(String s) {
- super(s);
- }
-}
--- a/jdk/src/share/classes/sun/management/ManagementFactoryHelper.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/management/ManagementFactoryHelper.java Wed Jul 05 17:49:56 2017 +0200
@@ -171,7 +171,8 @@
ObjectName result = objname;
if (result == null) {
synchronized (this) {
- if (objname == null) {
+ result = objname;
+ if (result == null) {
result = Util.newObjectName(LOGGING_MXBEAN_NAME);
objname = result;
}
@@ -228,7 +229,8 @@
ObjectName result = objname;
if (result == null) {
synchronized (this) {
- if (objname == null) {
+ result = objname;
+ if (result == null) {
result = Util.newObjectName(BUFFER_POOL_MXBEAN_NAME +
",name=" + pool.getName());
objname = result;
--- a/jdk/src/share/classes/sun/misc/JavaNioAccess.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/misc/JavaNioAccess.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -25,6 +25,9 @@
package sun.misc;
+import java.nio.Buffer;
+import java.nio.ByteBuffer;
+
public interface JavaNioAccess {
/**
* Provides access to information on buffer usage.
@@ -36,4 +39,18 @@
long getMemoryUsed();
}
BufferPool getDirectBufferPool();
+
+ /**
+ * Constructs a direct ByteBuffer referring to the block of memory starting
+ * at the given memory address and and extending {@code cap} bytes.
+ * The {@code ob} parameter is an arbitrary object that is attached
+ * to the resulting buffer.
+ */
+ ByteBuffer newDirectByteBuffer(long addr, int cap, Object ob);
+
+ /**
+ * Truncates a buffer by changing its capacity to 0.
+ */
+ void truncate(Buffer buf);
+
}
--- a/jdk/src/share/classes/sun/misc/URLClassPath.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/misc/URLClassPath.java Wed Jul 05 17:49:56 2017 +0200
@@ -717,7 +717,7 @@
try {
ensureOpen();
} catch (IOException e) {
- throw (InternalError) new InternalError().initCause(e);
+ throw new InternalError(e);
}
return index;
}
@@ -812,7 +812,7 @@
try {
ensureOpen();
} catch (IOException e) {
- throw (InternalError) new InternalError().initCause(e);
+ throw new InternalError(e);
}
final JarEntry entry = jar.getJarEntry(name);
if (entry != null)
@@ -900,7 +900,7 @@
try {
newLoader.ensureOpen();
} catch (IOException e) {
- throw (InternalError) new InternalError().initCause(e);
+ throw new InternalError(e);
}
final JarEntry entry = newLoader.jar.getJarEntry(name);
if (entry != null) {
--- a/jdk/src/share/classes/sun/nio/ch/DirectBuffer.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/nio/ch/DirectBuffer.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -32,7 +32,7 @@
public long address();
- public Object viewedBuffer();
+ public Object attachment();
public Cleaner cleaner();
--- a/jdk/src/share/classes/sun/nio/cs/ext/GB18030.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/nio/cs/ext/GB18030.java Wed Jul 05 17:49:56 2017 +0200
@@ -47,30 +47,6 @@
super("GB18030", ExtendedCharsets.aliasesFor("GB18030"));
}
- public short[] getDecoderIndex1() {
- return decoderIndex1;
- }
-
- public String[] getDecoderIndex2() {
- return decoderIndex2;
- }
-
- public short[] getSubDecoderIndex1() {
- return index1;
- }
-
- public String[] getSubDecoderIndex2() {
- return index2;
- }
-
- public short[] getEncoderIndex1() {
- return encoderIndex1;
- }
-
- public String[] getEncoderIndex2() {
- return encoderIndex2;
- }
-
public boolean contains(Charset cs) {
return ((cs.name().equals("US-ASCII"))
|| (cs.name().equals("GBK"))
--- a/jdk/src/share/classes/sun/nio/cs/ext/IBM33722.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/nio/cs/ext/IBM33722.java Wed Jul 05 17:49:56 2017 +0200
@@ -62,47 +62,6 @@
return new Encoder(this);
}
-
- /**
- * These accessors are temporarily supplied while sun.io
- * converters co-exist with the sun.nio.cs.{ext} charset coders
- * These facilitate sharing of conversion tables between the
- * two co-existing implementations. When sun.io converters
- * are made extinct these will be unncessary and should be removed
- */
-
- public String getDecoderSingleByteMappings() {
- return Decoder.byteToCharTable;
- }
-
- public String getDecoderMappingTableG1() {
- return Decoder.mappingTableG1;
- }
-
- public String getDecoderMappingTableG2() {
- return Decoder.mappingTableG2;
- }
-
- public String getDecoderMappingTableG3() {
- return Decoder.mappingTableG3;
- }
-
- public short[] getEncoderIndex1() {
- return Encoder.index1;
-
- }
- public String getEncoderIndex2() {
- return Encoder.index2;
- }
-
- public String getEncoderIndex2a() {
- return Encoder.index2a;
- }
-
- public String getEncoderIndex2b() {
- return Encoder.index2b;
- }
-
protected static class Decoder extends CharsetDecoder {
private final int G0 = 0;
--- a/jdk/src/share/classes/sun/nio/cs/ext/IBM964.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/nio/cs/ext/IBM964.java Wed Jul 05 17:49:56 2017 +0200
@@ -62,54 +62,6 @@
return new Encoder(this);
}
-
- /**
- * These accessors are temporarily supplied while sun.io
- * converters co-exist with the sun.nio.cs.{ext} charset coders
- * These facilitate sharing of conversion tables between the
- * two co-existing implementations. When sun.io converters
- * are made extinct these will be unncessary and should be removed
- */
-
- public String getDecoderSingleByteMappings() {
- return Decoder.byteToCharTable;
- }
-
- public String getDecoderMappingTableG1() {
- return Decoder.mappingTableG1;
- }
-
- public String getDecoderMappingTableG2a2() {
- return Decoder.mappingTableG2a2;
- }
-
- public String getDecoderMappingTableG2ac() {
- return Decoder.mappingTableG2ac;
- }
-
- public String getDecoderMappingTableG2ad() {
- return Decoder.mappingTableG2ad;
- }
-
- public short[] getEncoderIndex1() {
- return Encoder.index1;
-
- }
- public String getEncoderIndex2() {
- return Encoder.index2;
-
- }
- public String getEncoderIndex2a() {
- return Encoder.index2a;
- }
-
- public String getEncoderIndex2b() {
- return Encoder.index2b;
- }
-
- public String getEncoderIndex2c() {
- return Encoder.index2c;
- }
protected static class Decoder extends CharsetDecoder {
private final int SS2 = 0x8E;
private final int SS3 = 0x8F;
--- a/jdk/src/share/classes/sun/nio/cs/ext/ISCII91.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/nio/cs/ext/ISCII91.java Wed Jul 05 17:49:56 2017 +0200
@@ -331,18 +331,6 @@
'\uffff' // ff -- This position shall not be used
}; //end of table definition
- /**
- * This accessor is temporarily supplied while sun.io
- * converters co-exist with the sun.nio.cs.{ext} charset coders
- * These facilitate sharing of conversion tables between the
- * two co-existing implementations. When sun.io converters
- * are made extinct these will be unnecessary and should be removed
- */
-
- public static char[] getDirectMapTable() {
- return directMapTable;
- }
-
private static final byte[] encoderMappingTable = {
NO_CHAR,NO_CHAR, //0900 <reserved>
(byte)161,NO_CHAR, //0901 -- DEVANAGARI SIGN CANDRABINDU = anunasika
@@ -474,20 +462,6 @@
NO_CHAR,NO_CHAR //097f -- reserved
}; //end of table definition
-
- /**
- * This accessor is temporarily supplied while sun.io
- * converters co-exist with the sun.nio.cs.{ext} charset coders
- * These facilitate sharing of conversion tables between the
- * two co-existing implementations. When sun.io converters
- * are made extinct these will be unnecessary and should be removed
- */
-
- public static byte[] getEncoderMappingTable() {
- return encoderMappingTable;
- }
-
-
private static class Decoder extends CharsetDecoder {
private static final char ZWNJ_CHAR = '\u200c';
--- a/jdk/src/share/classes/sun/nio/cs/ext/JIS_X_0208_Decoder.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/nio/cs/ext/JIS_X_0208_Decoder.java Wed Jul 05 17:49:56 2017 +0200
@@ -1000,18 +1000,11 @@
return REPLACE_CHAR;
}
- /**
- * These accessors are temporarily supplied while sun.io
- * converters co-exist with the sun.nio.cs.{ext} charset coders
- * These facilitate sharing of conversion tables between the
- * two co-existing implementations. When sun.io converters
- * are made extinct these will be unncessary and should be removed
- */
- public static short[] getIndex1() {
+ static short[] getIndex1() {
return index1;
}
- public static String[] getIndex2() {
+ static String[] getIndex2() {
return index2;
}
}
--- a/jdk/src/share/classes/sun/nio/cs/ext/JIS_X_0208_Encoder.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/nio/cs/ext/JIS_X_0208_Encoder.java Wed Jul 05 17:49:56 2017 +0200
@@ -65,19 +65,11 @@
return -1;
}
- /**
- * These accessors are temporarily supplied while sun.io
- * converters co-exist with the sun.nio.cs.{ext} charset coders
- * These facilitate sharing of conversion tables between the
- * two co-existing implementations. When sun.io converters
- * are made extinct these will be unncessary and should be removed
- */
-
- public static short[] getIndex1() {
+ static short[] getIndex1() {
return index1;
}
- public static String[] getIndex2() {
+ static String[] getIndex2() {
return index2;
}
--- a/jdk/src/share/classes/sun/nio/cs/ext/JIS_X_0208_Solaris_Decoder.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/nio/cs/ext/JIS_X_0208_Solaris_Decoder.java Wed Jul 05 17:49:56 2017 +0200
@@ -201,19 +201,11 @@
}
- /**
- * These accessors are temporarily supplied while sun.io
- * converters co-exist with the sun.nio.cs.{ext} charset coders
- * These facilitate sharing of conversion tables between the
- * two co-existing implementations. When sun.io converters
- * are made extinct these will be unncessary and should be removed
- */
-
- public static short[] getIndex1() {
+ static short[] getIndex1() {
return index1;
}
- public static String[] getIndex2() {
+ static String[] getIndex2() {
return index2;
}
}
--- a/jdk/src/share/classes/sun/nio/cs/ext/JIS_X_0212_Decoder.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/nio/cs/ext/JIS_X_0212_Decoder.java Wed Jul 05 17:49:56 2017 +0200
@@ -42,21 +42,6 @@
0x7E);
}
- /**
- * These accessors are temporarily supplied while sun.io
- * converters co-exist with the sun.nio.cs.{ext} charset coders
- * These facilitate sharing of conversion tables between the
- * two co-existing implementations. When sun.io converters
- * are made extinct these will be unncessary and should be removed
- */
-
- public static short[] getIndex1() {
- return index1;
- }
- public static String[] getIndex2() {
- return index2;
- }
-
private final static String innerIndex0=
"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
--- a/jdk/src/share/classes/sun/nio/cs/ext/JIS_X_0212_Encoder.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/nio/cs/ext/JIS_X_0212_Encoder.java Wed Jul 05 17:49:56 2017 +0200
@@ -58,20 +58,6 @@
return -1;
}
- /**
- * These accessors are temporarily supplied while sun.io
- * converters co-exist with the sun.nio.cs.{ext} charset coders
- * These facilitate sharing of conversion tables between the
- * two co-existing implementations. When sun.io converters
- * are made extinct these will be unncessary and should be removed
- */
- public static short[] getIndex1() {
- return index1;
- }
- public static String[] getIndex2() {
- return index2;
- }
-
private final static String innerIndex0=
"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
--- a/jdk/src/share/classes/sun/nio/cs/ext/JIS_X_0212_Solaris_Decoder.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/nio/cs/ext/JIS_X_0212_Solaris_Decoder.java Wed Jul 05 17:49:56 2017 +0200
@@ -41,21 +41,6 @@
0x7E);
}
- /**
- * These accessors are temporarily supplied while sun.io
- * converters co-exist with the sun.nio.cs.{ext} charset coders
- * These facilitate sharing of conversion tables between the
- * two co-existing implementations. When sun.io converters
- * are made extinct these will be unncessary and should be removed
- */
-
- public static short[] getIndex1() {
- return index1;
- }
- public static String[] getIndex2() {
- return index2;
- }
-
private final static String innerIndex0=
"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
--- a/jdk/src/share/classes/sun/nio/cs/ext/JIS_X_0212_Solaris_Encoder.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/nio/cs/ext/JIS_X_0212_Solaris_Encoder.java Wed Jul 05 17:49:56 2017 +0200
@@ -48,21 +48,6 @@
return -1;
}
- /**
- * These accessors are temporarily supplied while sun.io
- * converters co-exist with the sun.nio.cs.{ext} charset coders
- * These facilitate sharing of conversion tables between the
- * two co-existing implementations. When sun.io converters
- * are made extinct these will be unncessary and should be removed
- */
-
- public static short[] getIndex1() {
- return index1;
- }
- public static String[] getIndex2() {
- return index2;
- }
-
private final static String innerIndex0=
"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
--- a/jdk/src/share/classes/sun/reflect/AccessorGenerator.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/reflect/AccessorGenerator.java Wed Jul 05 17:49:56 2017 +0200
@@ -382,7 +382,7 @@
/** Returns class name in "internal" form (i.e., '/' separators
instead of '.') */
protected static String getClassName
- (Class c, boolean addPrefixAndSuffixForNonPrimitiveTypes)
+ (Class<?> c, boolean addPrefixAndSuffixForNonPrimitiveTypes)
{
if (c.isPrimitive()) {
if (c == Boolean.TYPE) {
@@ -490,7 +490,7 @@
}
}
- protected short indexForPrimitiveType(Class type) {
+ protected short indexForPrimitiveType(Class<?> type) {
if (type == Boolean.TYPE) {
return booleanIdx;
} else if (type == Byte.TYPE) {
@@ -511,7 +511,7 @@
throw new InternalError("Should have found primitive type");
}
- protected short ctorIndexForPrimitiveType(Class type) {
+ protected short ctorIndexForPrimitiveType(Class<?> type) {
if (type == Boolean.TYPE) {
return booleanCtorIdx;
} else if (type == Byte.TYPE) {
@@ -534,7 +534,7 @@
/** Returns true for widening or identity conversions for primitive
types only */
- protected static boolean canWidenTo(Class type, Class otherType) {
+ protected static boolean canWidenTo(Class<?> type, Class<?> otherType) {
if (!type.isPrimitive()) {
return false;
}
@@ -609,8 +609,8 @@
called and returned true. */
protected static void emitWideningBytecodeForPrimitiveConversion
(ClassFileAssembler cb,
- Class fromType,
- Class toType)
+ Class<?> fromType,
+ Class<?> toType)
{
// Note that widening conversions for integral types (i.e., "b2s",
// "s2i") are no-ops since values on the Java stack are
@@ -650,7 +650,7 @@
// Otherwise, was identity or no-op conversion. Fall through.
}
- protected short unboxingMethodForPrimitiveType(Class primType) {
+ protected short unboxingMethodForPrimitiveType(Class<?> primType) {
if (primType == Boolean.TYPE) {
return booleanUnboxIdx;
} else if (primType == Byte.TYPE) {
@@ -671,7 +671,7 @@
throw new InternalError("Illegal primitive type " + primType.getName());
}
- protected static final Class[] primitiveTypes = new Class[] {
+ protected static final Class<?>[] primitiveTypes = new Class<?>[] {
Boolean.TYPE,
Byte.TYPE,
Character.TYPE,
@@ -683,11 +683,11 @@
};
/** We don't consider "Void" to be a primitive type */
- protected static boolean isPrimitive(Class c) {
+ protected static boolean isPrimitive(Class<?> c) {
return (c.isPrimitive() && c != Void.TYPE);
}
- protected int typeSizeInStackSlots(Class c) {
+ protected int typeSizeInStackSlots(Class<?> c) {
if (c == Void.TYPE) {
return 0;
}
--- a/jdk/src/share/classes/sun/reflect/BootstrapConstructorAccessorImpl.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/reflect/BootstrapConstructorAccessorImpl.java Wed Jul 05 17:49:56 2017 +0200
@@ -32,9 +32,9 @@
bootstrapping. */
class BootstrapConstructorAccessorImpl extends ConstructorAccessorImpl {
- private Constructor constructor;
+ private Constructor<?> constructor;
- BootstrapConstructorAccessorImpl(Constructor c) {
+ BootstrapConstructorAccessorImpl(Constructor<?> c) {
this.constructor = c;
}
--- a/jdk/src/share/classes/sun/reflect/ClassDefiner.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/reflect/ClassDefiner.java Wed Jul 05 17:49:56 2017 +0200
@@ -51,8 +51,8 @@
than would otherwise be possible, decreasing run-time
footprint. </P>
*/
- static Class defineClass(String name, byte[] bytes, int off, int len,
- final ClassLoader parentClassLoader)
+ static Class<?> defineClass(String name, byte[] bytes, int off, int len,
+ final ClassLoader parentClassLoader)
{
ClassLoader newLoader = AccessController.doPrivileged(
new PrivilegedAction<ClassLoader>() {
--- a/jdk/src/share/classes/sun/reflect/ConstantPool.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/reflect/ConstantPool.java Wed Jul 05 17:49:56 2017 +0200
@@ -34,8 +34,8 @@
public class ConstantPool {
// Number of entries in this constant pool (= maximum valid constant pool index)
public int getSize() { return getSize0 (constantPoolOop); }
- public Class getClassAt (int index) { return getClassAt0 (constantPoolOop, index); }
- public Class getClassAtIfLoaded (int index) { return getClassAtIfLoaded0 (constantPoolOop, index); }
+ public Class<?> getClassAt (int index) { return getClassAt0 (constantPoolOop, index); }
+ public Class<?> getClassAtIfLoaded (int index) { return getClassAtIfLoaded0 (constantPoolOop, index); }
// Returns either a Method or Constructor.
// Static initializers are returned as Method objects.
public Member getMethodAt (int index) { return getMethodAt0 (constantPoolOop, index); }
@@ -64,8 +64,8 @@
private Object constantPoolOop;
private native int getSize0 (Object constantPoolOop);
- private native Class getClassAt0 (Object constantPoolOop, int index);
- private native Class getClassAtIfLoaded0 (Object constantPoolOop, int index);
+ private native Class<?> getClassAt0 (Object constantPoolOop, int index);
+ private native Class<?> getClassAtIfLoaded0 (Object constantPoolOop, int index);
private native Member getMethodAt0 (Object constantPoolOop, int index);
private native Member getMethodAtIfLoaded0(Object constantPoolOop, int index);
private native Field getFieldAt0 (Object constantPoolOop, int index);
--- a/jdk/src/share/classes/sun/reflect/Label.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/reflect/Label.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,7 +25,6 @@
package sun.reflect;
-import java.util.Iterator;
import java.util.List;
import java.util.ArrayList;
@@ -53,7 +52,7 @@
short patchBCI;
int stackDepth;
}
- private List/*<PatchInfo>*/ patches = new ArrayList();
+ private List<PatchInfo> patches = new ArrayList<>();
public Label() {
}
@@ -67,8 +66,7 @@
}
public void bind() {
- for (Iterator iter = patches.iterator(); iter.hasNext(); ) {
- PatchInfo patch = (PatchInfo) iter.next();
+ for (PatchInfo patch : patches){
short curBCI = patch.asm.getLength();
short offset = (short) (curBCI - patch.instrBCI);
patch.asm.emitShort(patch.patchBCI, offset);
--- a/jdk/src/share/classes/sun/reflect/MethodAccessorGenerator.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/reflect/MethodAccessorGenerator.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,10 +25,8 @@
package sun.reflect;
-import java.lang.reflect.*;
import java.security.AccessController;
import java.security.PrivilegedAction;
-import sun.misc.Unsafe;
/** Generator for sun.reflect.MethodAccessor and
sun.reflect.ConstructorAccessor objects using bytecodes to
@@ -50,11 +48,11 @@
private static volatile int constructorSymnum = 0;
private static volatile int serializationConstructorSymnum = 0;
- private Class declaringClass;
- private Class[] parameterTypes;
- private Class returnType;
- private boolean isConstructor;
- private boolean forSerialization;
+ private Class<?> declaringClass;
+ private Class<?>[] parameterTypes;
+ private Class<?> returnType;
+ private boolean isConstructor;
+ private boolean forSerialization;
private short targetMethodRef;
private short invokeIdx;
@@ -67,11 +65,11 @@
}
/** This routine is not thread-safe */
- public MethodAccessor generateMethod(Class declaringClass,
- String name,
- Class[] parameterTypes,
- Class returnType,
- Class[] checkedExceptions,
+ public MethodAccessor generateMethod(Class<?> declaringClass,
+ String name,
+ Class<?>[] parameterTypes,
+ Class<?> returnType,
+ Class<?>[] checkedExceptions,
int modifiers)
{
return (MethodAccessor) generate(declaringClass,
@@ -86,9 +84,9 @@
}
/** This routine is not thread-safe */
- public ConstructorAccessor generateConstructor(Class declaringClass,
- Class[] parameterTypes,
- Class[] checkedExceptions,
+ public ConstructorAccessor generateConstructor(Class<?> declaringClass,
+ Class<?>[] parameterTypes,
+ Class<?>[] checkedExceptions,
int modifiers)
{
return (ConstructorAccessor) generate(declaringClass,
@@ -104,11 +102,11 @@
/** This routine is not thread-safe */
public SerializationConstructorAccessorImpl
- generateSerializationConstructor(Class declaringClass,
- Class[] parameterTypes,
- Class[] checkedExceptions,
+ generateSerializationConstructor(Class<?> declaringClass,
+ Class<?>[] parameterTypes,
+ Class<?>[] checkedExceptions,
int modifiers,
- Class targetConstructorClass)
+ Class<?> targetConstructorClass)
{
return (SerializationConstructorAccessorImpl)
generate(declaringClass,
@@ -123,15 +121,15 @@
}
/** This routine is not thread-safe */
- private MagicAccessorImpl generate(final Class declaringClass,
+ private MagicAccessorImpl generate(final Class<?> declaringClass,
String name,
- Class[] parameterTypes,
- Class returnType,
- Class[] checkedExceptions,
+ Class<?>[] parameterTypes,
+ Class<?> returnType,
+ Class<?>[] checkedExceptions,
int modifiers,
boolean isConstructor,
boolean forSerialization,
- Class serializationTargetClass)
+ Class<?> serializationTargetClass)
{
ByteVector vec = ByteVectorFactory.create();
asm = new ClassFileAssembler(vec);
@@ -340,7 +338,7 @@
// Output class information for non-primitive parameter types
nonPrimitiveParametersBaseIdx = add(asm.cpi(), S2);
for (int i = 0; i < parameterTypes.length; i++) {
- Class c = parameterTypes[i];
+ Class<?> c = parameterTypes[i];
if (!isPrimitive(c)) {
asm.emitConstantPoolUTF8(getClassName(c, false));
asm.emitConstantPoolClass(asm.cpi());
@@ -403,12 +401,8 @@
0,
bytes.length,
declaringClass.getClassLoader()).newInstance();
- } catch (InstantiationException e) {
- throw (InternalError)
- new InternalError().initCause(e);
- } catch (IllegalAccessException e) {
- throw (InternalError)
- new InternalError().initCause(e);
+ } catch (InstantiationException | IllegalAccessException e) {
+ throw new InternalError(e);
}
}
});
@@ -530,7 +524,7 @@
byte count = 1; // both invokeinterface opcode's "count" as well as
// num args of other invoke bytecodes
for (int i = 0; i < parameterTypes.length; i++) {
- Class paramType = parameterTypes[i];
+ Class<?> paramType = parameterTypes[i];
count += (byte) typeSizeInStackSlots(paramType);
if (nextParamLabel != null) {
nextParamLabel.bind();
@@ -577,7 +571,7 @@
nextParamLabel = new Label();
for (int j = 0; j < primitiveTypes.length; j++) {
- Class c = primitiveTypes[j];
+ Class<?> c = primitiveTypes[j];
if (canWidenTo(c, paramType)) {
if (l != null) {
l.bind();
--- a/jdk/src/share/classes/sun/reflect/NativeConstructorAccessorImpl.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/reflect/NativeConstructorAccessorImpl.java Wed Jul 05 17:49:56 2017 +0200
@@ -31,11 +31,11 @@
afterward, switches to bytecode-based implementation */
class NativeConstructorAccessorImpl extends ConstructorAccessorImpl {
- private Constructor c;
+ private Constructor<?> c;
private DelegatingConstructorAccessorImpl parent;
private int numInvocations;
- NativeConstructorAccessorImpl(Constructor c) {
+ NativeConstructorAccessorImpl(Constructor<?> c) {
this.c = c;
}
@@ -61,7 +61,7 @@
this.parent = parent;
}
- private static native Object newInstance0(Constructor c, Object[] args)
+ private static native Object newInstance0(Constructor<?> c, Object[] args)
throws InstantiationException,
IllegalArgumentException,
InvocationTargetException;
--- a/jdk/src/share/classes/sun/reflect/Reflection.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/reflect/Reflection.java Wed Jul 05 17:49:56 2017 +0200
@@ -26,7 +26,6 @@
package sun.reflect;
import java.lang.reflect.*;
-import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@@ -39,17 +38,17 @@
view, where they are sensitive or they may contain VM-internal objects.
These Maps are updated very rarely. Rather than synchronize on
each access, we use copy-on-write */
- private static volatile Map<Class,String[]> fieldFilterMap;
- private static volatile Map<Class,String[]> methodFilterMap;
+ private static volatile Map<Class<?>,String[]> fieldFilterMap;
+ private static volatile Map<Class<?>,String[]> methodFilterMap;
static {
- Map<Class,String[]> map = new HashMap<Class,String[]>();
+ Map<Class<?>,String[]> map = new HashMap<Class<?>,String[]>();
map.put(Reflection.class,
new String[] {"fieldFilterMap", "methodFilterMap"});
map.put(System.class, new String[] {"security"});
fieldFilterMap = map;
- methodFilterMap = new HashMap<Class,String[]>();
+ methodFilterMap = new HashMap<>();
}
/** Returns the class of the method <code>realFramesToSkip</code>
@@ -61,7 +60,7 @@
java.lang.reflect.Method.invoke() and its implementation are
completely ignored and do not count toward the number of "real"
frames skipped. */
- public static native Class getCallerClass(int realFramesToSkip);
+ public static native Class<?> getCallerClass(int realFramesToSkip);
/** Retrieves the access flags written to the class file. For
inner classes these flags may differ from those returned by
@@ -71,18 +70,18 @@
to compatibility reasons; see 4471811. Only the values of the
low 13 bits (i.e., a mask of 0x1FFF) are guaranteed to be
valid. */
- private static native int getClassAccessFlags(Class c);
+ private static native int getClassAccessFlags(Class<?> c);
/** A quick "fast-path" check to try to avoid getCallerClass()
calls. */
- public static boolean quickCheckMemberAccess(Class memberClass,
+ public static boolean quickCheckMemberAccess(Class<?> memberClass,
int modifiers)
{
return Modifier.isPublic(getClassAccessFlags(memberClass) & modifiers);
}
- public static void ensureMemberAccess(Class currentClass,
- Class memberClass,
+ public static void ensureMemberAccess(Class<?> currentClass,
+ Class<?> memberClass,
Object target,
int modifiers)
throws IllegalAccessException
@@ -101,13 +100,13 @@
}
}
- public static boolean verifyMemberAccess(Class currentClass,
+ public static boolean verifyMemberAccess(Class<?> currentClass,
// Declaring class of field
// or method
- Class memberClass,
+ Class<?> memberClass,
// May be NULL in case of statics
- Object target,
- int modifiers)
+ Object target,
+ int modifiers)
{
// Verify that currentClass can access a field, method, or
// constructor of memberClass, where that member's access bits are
@@ -162,7 +161,7 @@
if (Modifier.isProtected(modifiers)) {
// Additional test for protected members: JLS 6.6.2
- Class targetClass = (target == null ? memberClass : target.getClass());
+ Class<?> targetClass = (target == null ? memberClass : target.getClass());
if (targetClass != currentClass) {
if (!gotIsSameClassPackage) {
isSameClassPackage = isSameClassPackage(currentClass, memberClass);
@@ -179,7 +178,7 @@
return true;
}
- private static boolean isSameClassPackage(Class c1, Class c2) {
+ private static boolean isSameClassPackage(Class<?> c1, Class<?> c2) {
return isSameClassPackage(c1.getClassLoader(), c1.getName(),
c2.getClassLoader(), c2.getName());
}
@@ -234,8 +233,8 @@
}
}
- static boolean isSubclassOf(Class queryClass,
- Class ofClass)
+ static boolean isSubclassOf(Class<?> queryClass,
+ Class<?> ofClass)
{
while (queryClass != null) {
if (queryClass == ofClass) {
@@ -247,31 +246,31 @@
}
// fieldNames must contain only interned Strings
- public static synchronized void registerFieldsToFilter(Class containingClass,
+ public static synchronized void registerFieldsToFilter(Class<?> containingClass,
String ... fieldNames) {
fieldFilterMap =
registerFilter(fieldFilterMap, containingClass, fieldNames);
}
// methodNames must contain only interned Strings
- public static synchronized void registerMethodsToFilter(Class containingClass,
+ public static synchronized void registerMethodsToFilter(Class<?> containingClass,
String ... methodNames) {
methodFilterMap =
registerFilter(methodFilterMap, containingClass, methodNames);
}
- private static Map<Class,String[]> registerFilter(Map<Class,String[]> map,
- Class containingClass, String ... names) {
+ private static Map<Class<?>,String[]> registerFilter(Map<Class<?>,String[]> map,
+ Class<?> containingClass, String ... names) {
if (map.get(containingClass) != null) {
throw new IllegalArgumentException
("Filter already registered: " + containingClass);
}
- map = new HashMap<Class,String[]>(map);
+ map = new HashMap<Class<?>,String[]>(map);
map.put(containingClass, names);
return map;
}
- public static Field[] filterFields(Class containingClass,
+ public static Field[] filterFields(Class<?> containingClass,
Field[] fields) {
if (fieldFilterMap == null) {
// Bootstrapping
@@ -280,7 +279,7 @@
return (Field[])filter(fields, fieldFilterMap.get(containingClass));
}
- public static Method[] filterMethods(Class containingClass, Method[] methods) {
+ public static Method[] filterMethods(Class<?> containingClass, Method[] methods) {
if (methodFilterMap == null) {
// Bootstrapping
return methods;
--- a/jdk/src/share/classes/sun/reflect/ReflectionFactory.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/reflect/ReflectionFactory.java Wed Jul 05 17:49:56 2017 +0200
@@ -161,7 +161,7 @@
}
}
- public ConstructorAccessor newConstructorAccessor(Constructor c) {
+ public ConstructorAccessor newConstructorAccessor(Constructor<?> c) {
checkInitted();
Class<?> declaringClass = c.getDeclaringClass();
@@ -250,14 +250,14 @@
/** Creates a new java.lang.reflect.Constructor. Access checks as
per java.lang.reflect.AccessibleObject are not overridden. */
- public Constructor newConstructor(Class<?> declaringClass,
- Class<?>[] parameterTypes,
- Class<?>[] checkedExceptions,
- int modifiers,
- int slot,
- String signature,
- byte[] annotations,
- byte[] parameterAnnotations)
+ public Constructor<?> newConstructor(Class<?> declaringClass,
+ Class<?>[] parameterTypes,
+ Class<?>[] checkedExceptions,
+ int modifiers,
+ int slot,
+ String signature,
+ byte[] annotations,
+ byte[] parameterAnnotations)
{
return langReflectAccess().newConstructor(declaringClass,
parameterTypes,
@@ -281,13 +281,13 @@
/** Gets the ConstructorAccessor object for a
java.lang.reflect.Constructor */
- public ConstructorAccessor getConstructorAccessor(Constructor c) {
+ public ConstructorAccessor getConstructorAccessor(Constructor<?> c) {
return langReflectAccess().getConstructorAccessor(c);
}
/** Sets the ConstructorAccessor object for a
java.lang.reflect.Constructor */
- public void setConstructorAccessor(Constructor c,
+ public void setConstructorAccessor(Constructor<?> c,
ConstructorAccessor accessor)
{
langReflectAccess().setConstructorAccessor(c, accessor);
@@ -320,8 +320,8 @@
//
//
- public Constructor newConstructorForSerialization
- (Class<?> classToInstantiate, Constructor constructorToCall)
+ public Constructor<?> newConstructorForSerialization
+ (Class<?> classToInstantiate, Constructor<?> constructorToCall)
{
// Fast path
if (constructorToCall.getDeclaringClass() == classToInstantiate) {
@@ -334,18 +334,18 @@
constructorToCall.getExceptionTypes(),
constructorToCall.getModifiers(),
constructorToCall.getDeclaringClass());
- Constructor c = newConstructor(constructorToCall.getDeclaringClass(),
- constructorToCall.getParameterTypes(),
- constructorToCall.getExceptionTypes(),
- constructorToCall.getModifiers(),
- langReflectAccess().
- getConstructorSlot(constructorToCall),
- langReflectAccess().
- getConstructorSignature(constructorToCall),
- langReflectAccess().
- getConstructorAnnotations(constructorToCall),
- langReflectAccess().
- getConstructorParameterAnnotations(constructorToCall));
+ Constructor<?> c = newConstructor(constructorToCall.getDeclaringClass(),
+ constructorToCall.getParameterTypes(),
+ constructorToCall.getExceptionTypes(),
+ constructorToCall.getModifiers(),
+ langReflectAccess().
+ getConstructorSlot(constructorToCall),
+ langReflectAccess().
+ getConstructorSignature(constructorToCall),
+ langReflectAccess().
+ getConstructorAnnotations(constructorToCall),
+ langReflectAccess().
+ getConstructorParameterAnnotations(constructorToCall));
setConstructorAccessor(c, acc);
return c;
}
@@ -393,9 +393,7 @@
try {
inflationThreshold = Integer.parseInt(val);
} catch (NumberFormatException e) {
- throw (RuntimeException)
- new RuntimeException("Unable to parse property sun.reflect.inflationThreshold").
- initCause(e);
+ throw new RuntimeException("Unable to parse property sun.reflect.inflationThreshold", e);
}
}
--- a/jdk/src/share/classes/sun/reflect/UnsafeFieldAccessorFactory.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/reflect/UnsafeFieldAccessorFactory.java Wed Jul 05 17:49:56 2017 +0200
@@ -30,7 +30,7 @@
class UnsafeFieldAccessorFactory {
static FieldAccessor newFieldAccessor(Field field, boolean override) {
- Class type = field.getType();
+ Class<?> type = field.getType();
boolean isStatic = Modifier.isStatic(field.getModifiers());
boolean isFinal = Modifier.isFinal(field.getModifiers());
boolean isVolatile = Modifier.isVolatile(field.getModifiers());
--- a/jdk/src/share/classes/sun/reflect/UnsafeFieldAccessorImpl.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/reflect/UnsafeFieldAccessorImpl.java Wed Jul 05 17:49:56 2017 +0200
@@ -40,12 +40,15 @@
static final Unsafe unsafe = Unsafe.getUnsafe();
protected final Field field;
- protected final int fieldOffset;
+ protected final long fieldOffset;
protected final boolean isFinal;
UnsafeFieldAccessorImpl(Field field) {
this.field = field;
- fieldOffset = unsafe.fieldOffset(field);
+ if (Modifier.isStatic(field.getModifiers()))
+ fieldOffset = unsafe.staticFieldOffset(field);
+ else
+ fieldOffset = unsafe.objectFieldOffset(field);
isFinal = Modifier.isFinal(field.getModifiers());
}
--- a/jdk/src/share/classes/sun/reflect/annotation/AnnotationInvocationHandler.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/reflect/annotation/AnnotationInvocationHandler.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -40,6 +40,7 @@
* @since 1.5
*/
class AnnotationInvocationHandler implements InvocationHandler, Serializable {
+ private static final long serialVersionUID = 6182022883658399397L;
private final Class<? extends Annotation> type;
private final Map<String, Object> memberValues;
--- a/jdk/src/share/classes/sun/reflect/annotation/AnnotationParser.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/reflect/annotation/AnnotationParser.java Wed Jul 05 17:49:56 2017 +0200
@@ -187,6 +187,7 @@
* TypeNotPresentException if a referenced annotation type is not
* available at runtime
*/
+ @SuppressWarnings("unchecked")
private static Annotation parseAnnotation(ByteBuffer buf,
ConstantPool constPool,
Class<?> container,
@@ -200,7 +201,7 @@
annotationClass = (Class<? extends Annotation>)parseSig(sig, container);
} catch (IllegalArgumentException ex) {
// support obsolete early jsr175 format class files
- annotationClass = constPool.getClassAt(typeIndex);
+ annotationClass = (Class<? extends Annotation>)constPool.getClassAt(typeIndex);
}
} catch (NoClassDefFoundError e) {
if (exceptionOnMissingAnnotationClass)
@@ -256,7 +257,7 @@
Class<? extends Annotation> type, Map<String, Object> memberValues)
{
return (Annotation) Proxy.newProxyInstance(
- type.getClassLoader(), new Class[] { type },
+ type.getClassLoader(), new Class<?>[] { type },
new AnnotationInvocationHandler(type, memberValues));
}
@@ -287,6 +288,7 @@
* The member must be of the indicated type. If it is not, this
* method returns an AnnotationTypeMismatchExceptionProxy.
*/
+ @SuppressWarnings("unchecked")
public static Object parseMemberValue(Class<?> memberType,
ByteBuffer buf,
ConstantPool constPool,
@@ -411,6 +413,7 @@
* u2 const_name_index;
* } enum_const_value;
*/
+ @SuppressWarnings({"rawtypes", "unchecked"})
private static Object parseEnumValue(Class<? extends Enum> enumType, ByteBuffer buf,
ConstantPool constPool,
Class<?> container) {
@@ -433,7 +436,7 @@
return Enum.valueOf(enumType, constName);
} catch(IllegalArgumentException e) {
return new EnumConstantNotPresentExceptionProxy(
- (Class<? extends Enum>)enumType, constName);
+ (Class<? extends Enum<?>>)enumType, constName);
}
}
@@ -451,6 +454,7 @@
* If the array values do not match arrayType, an
* AnnotationTypeMismatchExceptionProxy will be returned.
*/
+ @SuppressWarnings("unchecked")
private static Object parseArray(Class<?> arrayType,
ByteBuffer buf,
ConstantPool constPool,
@@ -479,7 +483,7 @@
} else if (componentType == Class.class) {
return parseClassArray(length, buf, constPool, container);
} else if (componentType.isEnum()) {
- return parseEnumArray(length, (Class<? extends Enum>)componentType, buf,
+ return parseEnumArray(length, (Class<? extends Enum<?>>)componentType, buf,
constPool, container);
} else {
assert componentType.isAnnotation();
@@ -679,7 +683,7 @@
return typeMismatch ? exceptionProxy(tag) : result;
}
- private static Object parseEnumArray(int length, Class<? extends Enum> enumType,
+ private static Object parseEnumArray(int length, Class<? extends Enum<?>> enumType,
ByteBuffer buf,
ConstantPool constPool,
Class<?> container) {
--- a/jdk/src/share/classes/sun/reflect/annotation/AnnotationTypeMismatchExceptionProxy.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/reflect/annotation/AnnotationTypeMismatchExceptionProxy.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * 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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -34,6 +34,7 @@
* @since 1.5
*/
class AnnotationTypeMismatchExceptionProxy extends ExceptionProxy {
+ private static final long serialVersionUID = 7844069490309503934L;
private Method member;
private String foundType;
--- a/jdk/src/share/classes/sun/reflect/annotation/EnumConstantNotPresentExceptionProxy.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/reflect/annotation/EnumConstantNotPresentExceptionProxy.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * 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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,6 @@
*/
package sun.reflect.annotation;
-import java.lang.annotation.*;
/**
* ExceptionProxy for EnumConstantNotPresentException.
@@ -33,10 +32,11 @@
* @since 1.5
*/
public class EnumConstantNotPresentExceptionProxy extends ExceptionProxy {
- Class<? extends Enum> enumType;
+ private static final long serialVersionUID = -604662101303187330L;
+ Class<? extends Enum<?>> enumType;
String constName;
- public EnumConstantNotPresentExceptionProxy(Class<? extends Enum> enumType,
+ public EnumConstantNotPresentExceptionProxy(Class<? extends Enum<?>> enumType,
String constName) {
this.enumType = enumType;
this.constName = constName;
--- a/jdk/src/share/classes/sun/reflect/annotation/TypeNotPresentExceptionProxy.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/reflect/annotation/TypeNotPresentExceptionProxy.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * 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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,7 @@
* @since 1.5
*/
public class TypeNotPresentExceptionProxy extends ExceptionProxy {
+ private static final long serialVersionUID = 5565925172427947573L;
String typeName;
Throwable cause;
--- a/jdk/src/share/classes/sun/reflect/generics/parser/SignatureParser.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/reflect/generics/parser/SignatureParser.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -25,17 +25,15 @@
package sun.reflect.generics.parser;
-
import java.lang.reflect.GenericSignatureFormatError;
import java.util.*;
import sun.reflect.generics.tree.*;
-
/**
* Parser for type signatures, as defined in the Java Virtual
-// Machine Specification (JVMS) chapter 4.
+ * Machine Specification (JVMS) chapter 4.
* Converts the signatures into an abstract syntax tree (AST) representation.
-// See the package sun.reflect.generics.tree for details of the AST.
+ * See the package sun.reflect.generics.tree for details of the AST.
*/
public class SignatureParser {
// The input is conceptually a character stream (though currently it's
@@ -58,8 +56,8 @@
// if (current != x {error("expected an x");
//
// where x is some character constant.
- // The assertion inidcates, that, as currently written,
- // the code should nver reach this point unless the input is an
+ // The assertion indicates, that, as currently written,
+ // the code should never reach this point unless the input is an
// x. On the other hand, the test is there to check the legality
// of the input wrt to a given production. It may be that at a later
// time the code might be called directly, and if the input is
@@ -68,7 +66,7 @@
private char[] input; // the input signature
private int index = 0; // index into the input
-// used to mark end of input
+ // used to mark end of input
private static final char EOI = ':';
private static final boolean DEBUG = false;
@@ -104,6 +102,11 @@
index++;
}
+ // For debugging, prints current character to the end of the input.
+ private String remainder() {
+ return new String(input, index, input.length-index);
+ }
+
// Match c against a "set" of characters
private boolean matches(char c, char... set) {
for (char e : set) {
@@ -117,8 +120,17 @@
// Currently throws a GenericSignatureFormatError.
private Error error(String errorMsg) {
- if (DEBUG) System.out.println("Parse error:" + errorMsg);
- return new GenericSignatureFormatError();
+ return new GenericSignatureFormatError("Signature Parse error: " + errorMsg +
+ "\n\tRemaining input: " + remainder());
+ }
+
+ /**
+ * Verify the parse has made forward progress; throw an exception
+ * if no progress.
+ */
+ private void progress(int startingPosition) {
+ if (index <= startingPosition)
+ throw error("Failure to make progress!");
}
/**
@@ -163,6 +175,7 @@
/**
* Parses a type signature
* and produces an abstract syntax tree representing it.
+ *
* @param s a string representing the input type signature
* @return An abstract syntax tree for a type signature
* corresponding to the input string
@@ -183,38 +196,58 @@
// and when it completes parsing, it leaves the input at the first
// character after the input parses.
- // parse a class signature based on the implicit input.
+ /*
+ * Note on grammar conventions: a trailing "*" matches zero or
+ * more occurrences, a trailing "+" matches one or more occurrences,
+ * "_opt" indicates an optional component.
+ */
+
+ /**
+ * ClassSignature:
+ * FormalTypeParameters_opt SuperclassSignature SuperinterfaceSignature*
+ */
private ClassSignature parseClassSignature() {
+ // parse a class signature based on the implicit input.
assert(index == 0);
return ClassSignature.make(parseZeroOrMoreFormalTypeParameters(),
- parseClassTypeSignature(),
+ parseClassTypeSignature(), // Only rule for SuperclassSignature
parseSuperInterfaces());
}
private FormalTypeParameter[] parseZeroOrMoreFormalTypeParameters(){
- if (current() == '<') { return parseFormalTypeParameters();}
- else {return new FormalTypeParameter[0];}
+ if (current() == '<') {
+ return parseFormalTypeParameters();
+ } else {
+ return new FormalTypeParameter[0];
+ }
}
-
+ /**
+ * FormalTypeParameters:
+ * "<" FormalTypeParameter+ ">"
+ */
private FormalTypeParameter[] parseFormalTypeParameters(){
- Collection<FormalTypeParameter> ftps =
- new ArrayList<FormalTypeParameter>(3);
+ List<FormalTypeParameter> ftps = new ArrayList<>(3);
assert(current() == '<'); // should not have been called at all
- if (current() != '<') { throw error("expected <");}
+ if (current() != '<') { throw error("expected '<'");}
advance();
ftps.add(parseFormalTypeParameter());
while (current() != '>') {
+ int startingPosition = index;
ftps.add(parseFormalTypeParameter());
+ progress(startingPosition);
}
advance();
- FormalTypeParameter[] ftpa = new FormalTypeParameter[ftps.size()];
- return ftps.toArray(ftpa);
+ return ftps.toArray(new FormalTypeParameter[ftps.size()]);
}
+ /**
+ * FormalTypeParameter:
+ * Identifier ClassBound InterfaceBound*
+ */
private FormalTypeParameter parseFormalTypeParameter(){
String id = parseIdentifier();
- FieldTypeSignature[] bs = parseZeroOrMoreBounds();
+ FieldTypeSignature[] bs = parseBounds();
return FormalTypeParameter.make(id, bs);
}
@@ -229,7 +262,8 @@
case '[':
case ':':
case '>':
- case '<': return result.toString();
+ case '<':
+ return result.toString();
default:{
result.append(c);
advance();
@@ -239,26 +273,42 @@
}
return result.toString();
}
+ /**
+ * FieldTypeSignature:
+ * ClassTypeSignature
+ * ArrayTypeSignature
+ * TypeVariableSignature
+ */
+ private FieldTypeSignature parseFieldTypeSignature() {
+ return parseFieldTypeSignature(true);
+ }
- private FieldTypeSignature parseFieldTypeSignature() {
+ private FieldTypeSignature parseFieldTypeSignature(boolean allowArrays) {
switch(current()) {
case 'L':
return parseClassTypeSignature();
case 'T':
return parseTypeVariableSignature();
case '[':
- return parseArrayTypeSignature();
+ if (allowArrays)
+ return parseArrayTypeSignature();
+ else
+ throw error("Array signature not allowed here.");
default: throw error("Expected Field Type Signature");
}
}
+ /**
+ * ClassTypeSignature:
+ * "L" PackageSpecifier_opt SimpleClassTypeSignature ClassTypeSignatureSuffix* ";"
+ */
private ClassTypeSignature parseClassTypeSignature(){
assert(current() == 'L');
if (current() != 'L') { throw error("expected a class type");}
advance();
- List<SimpleClassTypeSignature> scts =
- new ArrayList<SimpleClassTypeSignature>(5);
- scts.add(parseSimpleClassTypeSignature(false));
+ List<SimpleClassTypeSignature> scts = new ArrayList<>(5);
+ scts.add(parsePackageNameAndSimpleClassTypeSignature());
+
parseClassTypeSignatureSuffix(scts);
if (current() != ';')
throw error("expected ';' got '" + current() + "'");
@@ -267,25 +317,65 @@
return ClassTypeSignature.make(scts);
}
- private SimpleClassTypeSignature parseSimpleClassTypeSignature(boolean dollar){
- String id = parseIdentifier();
- char c = current();
- switch (c) {
- case ';':
- case '/':
- return SimpleClassTypeSignature.make(id, dollar, new TypeArgument[0]) ;
- case '<': {
- return SimpleClassTypeSignature.make(id, dollar, parseTypeArguments());
+ /**
+ * PackageSpecifier:
+ * Identifier "/" PackageSpecifier*
+ */
+ private SimpleClassTypeSignature parsePackageNameAndSimpleClassTypeSignature() {
+ // Parse both any optional leading PackageSpecifier as well as
+ // the following SimpleClassTypeSignature.
+
+ String id = parseIdentifier();
+
+ if (current() == '/') { // package name
+ StringBuilder idBuild = new StringBuilder(id);
+
+ while(current() == '/') {
+ advance();
+ idBuild.append(".");
+ idBuild.append(parseIdentifier());
}
- default: {throw error("expected < or ; or /");}
- }
+ id = idBuild.toString();
+ }
+
+ switch (current()) {
+ case ';':
+ return SimpleClassTypeSignature.make(id, false, new TypeArgument[0]); // all done!
+ case '<':
+ if (DEBUG) System.out.println("\t remainder: " + remainder());
+ return SimpleClassTypeSignature.make(id, false, parseTypeArguments());
+ default:
+ throw error("expected '<' or ';' but got " + current());
+ }
}
+ /**
+ * SimpleClassTypeSignature:
+ * Identifier TypeArguments_opt
+ */
+ private SimpleClassTypeSignature parseSimpleClassTypeSignature(boolean dollar){
+ String id = parseIdentifier();
+ char c = current();
+
+ switch (c) {
+ case ';':
+ case '.':
+ return SimpleClassTypeSignature.make(id, dollar, new TypeArgument[0]) ;
+ case '<':
+ return SimpleClassTypeSignature.make(id, dollar, parseTypeArguments());
+ default:
+ throw error("expected '<' or ';' or '.', got '" + c + "'.");
+ }
+ }
+
+ /**
+ * ClassTypeSignatureSuffix:
+ * "." SimpleClassTypeSignature
+ */
private void parseClassTypeSignatureSuffix(List<SimpleClassTypeSignature> scts) {
- while (current() == '/' || current() == '.') {
- boolean dollar = (current() == '.');
+ while (current() == '.') {
advance();
- scts.add(parseSimpleClassTypeSignature(dollar));
+ scts.add(parseSimpleClassTypeSignature(true));
}
}
@@ -294,10 +384,14 @@
else {return new TypeArgument[0];}
}
+ /**
+ * TypeArguments:
+ * "<" TypeArgument+ ">"
+ */
private TypeArgument[] parseTypeArguments() {
- Collection<TypeArgument> tas = new ArrayList<TypeArgument>(3);
+ List<TypeArgument> tas = new ArrayList<>(3);
assert(current() == '<');
- if (current() != '<') { throw error("expected <");}
+ if (current() != '<') { throw error("expected '<'");}
advance();
tas.add(parseTypeArgument());
while (current() != '>') {
@@ -305,10 +399,14 @@
tas.add(parseTypeArgument());
}
advance();
- TypeArgument[] taa = new TypeArgument[tas.size()];
- return tas.toArray(taa);
+ return tas.toArray(new TypeArgument[tas.size()]);
}
+ /**
+ * TypeArgument:
+ * WildcardIndicator_opt FieldTypeSignature
+ * "*"
+ */
private TypeArgument parseTypeArgument() {
FieldTypeSignature[] ub, lb;
ub = new FieldTypeSignature[1];
@@ -334,18 +432,20 @@
ub[0] = SimpleClassTypeSignature.make("java.lang.Object", false, ta);
return Wildcard.make(ub, lb);
}
- default: return parseFieldTypeSignature();
+ default:
+ return parseFieldTypeSignature();
}
}
- // TypeVariableSignature -> T identifier
-
- private TypeVariableSignature parseTypeVariableSignature(){
+ /**
+ * TypeVariableSignature:
+ * "T" Identifier ";"
+ */
+ private TypeVariableSignature parseTypeVariableSignature() {
assert(current() == 'T');
if (current() != 'T') { throw error("expected a type variable usage");}
advance();
- TypeVariableSignature ts =
- TypeVariableSignature.make(parseIdentifier());
+ TypeVariableSignature ts = TypeVariableSignature.make(parseIdentifier());
if (current() != ';') {
throw error("; expected in signature of type variable named" +
ts.getIdentifier());
@@ -354,16 +454,21 @@
return ts;
}
- // ArrayTypeSignature -> [ TypeSignature
-
+ /**
+ * ArrayTypeSignature:
+ * "[" TypeSignature
+ */
private ArrayTypeSignature parseArrayTypeSignature() {
if (current() != '[') {throw error("expected array type signature");}
advance();
return ArrayTypeSignature.make(parseTypeSignature());
}
- // TypeSignature -> BaseType | FieldTypeSignature
-
+ /**
+ * TypeSignature:
+ * FieldTypeSignature
+ * BaseType
+ */
private TypeSignature parseTypeSignature() {
switch (current()) {
case 'B':
@@ -373,8 +478,11 @@
case 'I':
case 'J':
case 'S':
- case 'Z':return parseBaseType();
- default: return parseFieldTypeSignature();
+ case 'Z':
+ return parseBaseType();
+
+ default:
+ return parseFieldTypeSignature();
}
}
@@ -408,12 +516,18 @@
assert(false);
throw error("expected primitive type");
}
- }
+ }
}
- private FieldTypeSignature[] parseZeroOrMoreBounds() {
- Collection<FieldTypeSignature> fts =
- new ArrayList<FieldTypeSignature>(3);
+ /**
+ * ClassBound:
+ * ":" FieldTypeSignature_opt
+ *
+ * InterfaceBound:
+ * ":" FieldTypeSignature
+ */
+ private FieldTypeSignature[] parseBounds() {
+ List<FieldTypeSignature> fts = new ArrayList<>(3);
if (current() == ':') {
advance();
@@ -430,24 +544,31 @@
advance();
fts.add(parseFieldTypeSignature());
}
- }
+ } else
+ error("Bound expected");
- FieldTypeSignature[] fta = new FieldTypeSignature[fts.size()];
- return fts.toArray(fta);
+ return fts.toArray(new FieldTypeSignature[fts.size()]);
}
+ /**
+ * SuperclassSignature:
+ * ClassTypeSignature
+ */
private ClassTypeSignature[] parseSuperInterfaces() {
- Collection<ClassTypeSignature> cts =
- new ArrayList<ClassTypeSignature>(5);
+ List<ClassTypeSignature> cts = new ArrayList<>(5);
while(current() == 'L') {
cts.add(parseClassTypeSignature());
}
- ClassTypeSignature[] cta = new ClassTypeSignature[cts.size()];
- return cts.toArray(cta);
+ return cts.toArray(new ClassTypeSignature[cts.size()]);
}
- // parse a method signature based on the implicit input.
+
+ /**
+ * MethodTypeSignature:
+ * FormalTypeParameters_opt "(" TypeSignature* ")" ReturnType ThrowsSignature*
+ */
private MethodTypeSignature parseMethodTypeSignature() {
+ // Parse a method signature based on the implicit input.
FieldTypeSignature[] ets;
assert(index == 0);
@@ -457,19 +578,19 @@
parseZeroOrMoreThrowsSignatures());
}
- // (TypeSignature*)
+ // "(" TypeSignature* ")"
private TypeSignature[] parseFormalParameters() {
- if (current() != '(') {throw error("expected (");}
+ if (current() != '(') {throw error("expected '('");}
advance();
TypeSignature[] pts = parseZeroOrMoreTypeSignatures();
- if (current() != ')') {throw error("expected )");}
+ if (current() != ')') {throw error("expected ')'");}
advance();
return pts;
}
- // TypeSignature*
+ // TypeSignature*
private TypeSignature[] parseZeroOrMoreTypeSignatures() {
- Collection<TypeSignature> ts = new ArrayList<TypeSignature>();
+ List<TypeSignature> ts = new ArrayList<>();
boolean stop = false;
while (!stop) {
switch(current()) {
@@ -484,47 +605,46 @@
case 'L':
case 'T':
case '[': {
- ts.add(parseTypeSignature());
- break;
- }
+ ts.add(parseTypeSignature());
+ break;
+ }
default: stop = true;
}
}
- /* while( matches(current(),
- 'B', 'C', 'D', 'F', 'I', 'J', 'S', 'Z', 'L', 'T', '[')
- ) {
- ts.add(parseTypeSignature());
- }*/
- TypeSignature[] ta = new TypeSignature[ts.size()];
- return ts.toArray(ta);
+ return ts.toArray(new TypeSignature[ts.size()]);
}
- // ReturnType -> V | TypeSignature
-
+ /**
+ * ReturnType:
+ * TypeSignature
+ * VoidDescriptor
+ */
private ReturnType parseReturnType(){
- if (current() == 'V') {
+ if (current() == 'V') {
advance();
return VoidDescriptor.make();
- } else return parseTypeSignature();
+ } else
+ return parseTypeSignature();
}
// ThrowSignature*
private FieldTypeSignature[] parseZeroOrMoreThrowsSignatures(){
- Collection<FieldTypeSignature> ets =
- new ArrayList<FieldTypeSignature>(3);
+ List<FieldTypeSignature> ets = new ArrayList<>(3);
while( current() == '^') {
ets.add(parseThrowsSignature());
}
- FieldTypeSignature[] eta = new FieldTypeSignature[ets.size()];
- return ets.toArray(eta);
+ return ets.toArray(new FieldTypeSignature[ets.size()]);
}
- // ThrowSignature -> ^ FieldTypeSignature
-
+ /**
+ * ThrowsSignature:
+ * "^" ClassTypeSignature
+ * "^" TypeVariableSignature
+ */
private FieldTypeSignature parseThrowsSignature() {
assert(current() == '^');
if (current() != '^') { throw error("expected throws signature");}
advance();
- return parseFieldTypeSignature();
+ return parseFieldTypeSignature(false);
}
}
--- a/jdk/src/share/classes/sun/reflect/generics/reflectiveObjects/TypeVariableImpl.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/reflect/generics/reflectiveObjects/TypeVariableImpl.java Wed Jul 05 17:49:56 2017 +0200
@@ -157,7 +157,7 @@
@Override
public boolean equals(Object o) {
if (o instanceof TypeVariable) {
- TypeVariable that = (TypeVariable) o;
+ TypeVariable<?> that = (TypeVariable<?>) o;
GenericDeclaration thatDecl = that.getGenericDeclaration();
String thatName = that.getName();
--- a/jdk/src/share/classes/sun/reflect/generics/repository/GenericDeclRepository.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/reflect/generics/repository/GenericDeclRepository.java Wed Jul 05 17:49:56 2017 +0200
@@ -69,7 +69,7 @@
// first, extract type parameter subtree(s) from AST
FormalTypeParameter[] ftps = getTree().getFormalTypeParameters();
// create array to store reified subtree(s)
- TypeVariable[] tps = new TypeVariable[ftps.length];
+ TypeVariable<?>[] tps = new TypeVariable<?>[ftps.length];
// reify all subtrees
for (int i = 0; i < ftps.length; i++) {
Reifier r = getReifier(); // obtain visitor
--- a/jdk/src/share/classes/sun/reflect/generics/scope/AbstractScope.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/reflect/generics/scope/AbstractScope.java Wed Jul 05 17:49:56 2017 +0200
@@ -83,8 +83,8 @@
* @return the requested type variable, if found
*/
public TypeVariable<?> lookup(String name) {
- TypeVariable[] tas = getRecvr().getTypeParameters();
- for (TypeVariable/*<?>*/ tv : tas) {
+ TypeVariable<?>[] tas = getRecvr().getTypeParameters();
+ for (TypeVariable<?> tv : tas) {
if (tv.getName().equals(name)) {return tv;}
}
return getEnclosingScope().lookup(name);
--- a/jdk/src/share/classes/sun/reflect/generics/scope/ConstructorScope.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/reflect/generics/scope/ConstructorScope.java Wed Jul 05 17:49:56 2017 +0200
@@ -32,10 +32,10 @@
* This class represents the scope containing the type variables of
* a constructor.
*/
-public class ConstructorScope extends AbstractScope<Constructor> {
+public class ConstructorScope extends AbstractScope<Constructor<?>> {
// constructor is private to enforce use of factory method
- private ConstructorScope(Constructor c){
+ private ConstructorScope(Constructor<?> c){
super(c);
}
@@ -61,7 +61,7 @@
* @param m - A Constructor whose scope we want to obtain
* @return The type-variable scope for the constructor m
*/
- public static ConstructorScope make(Constructor c) {
+ public static ConstructorScope make(Constructor<?> c) {
return new ConstructorScope(c);
}
}
--- a/jdk/src/share/classes/sun/reflect/generics/tree/ClassSignature.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/reflect/generics/tree/ClassSignature.java Wed Jul 05 17:49:56 2017 +0200
@@ -52,5 +52,5 @@
public ClassTypeSignature getSuperclass(){return superclass;}
public ClassTypeSignature[] getSuperInterfaces(){return superInterfaces;}
- public void accept(Visitor v){v.visitClassSignature(this);}
+ public void accept(Visitor<?> v){v.visitClassSignature(this);}
}
--- a/jdk/src/share/classes/sun/reflect/generics/tree/MethodTypeSignature.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/reflect/generics/tree/MethodTypeSignature.java Wed Jul 05 17:49:56 2017 +0200
@@ -57,5 +57,5 @@
public ReturnType getReturnType(){return returnType;}
public FieldTypeSignature[] getExceptionTypes(){return exceptionTypes;}
- public void accept(Visitor v){v.visitMethodTypeSignature(this);}
+ public void accept(Visitor<?> v){v.visitMethodTypeSignature(this);}
}
--- a/jdk/src/share/classes/sun/security/acl/AclEntryImpl.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/acl/AclEntryImpl.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,7 +25,6 @@
package sun.security.acl;
import java.util.*;
-import java.io.*;
import java.security.Principal;
import java.security.acl.*;
@@ -162,6 +161,7 @@
/**
* Clones an AclEntry.
*/
+ @SuppressWarnings("unchecked") // Safe casts assuming clone() works correctly
public synchronized Object clone() {
AclEntryImpl cloned;
cloned = new AclEntryImpl(user);
--- a/jdk/src/share/classes/sun/security/action/PutAllAction.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/action/PutAllAction.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -41,9 +41,9 @@
public class PutAllAction implements PrivilegedAction<Void> {
private final Provider provider;
- private final Map map;
+ private final Map<?, ?> map;
- public PutAllAction(Provider provider, Map map) {
+ public PutAllAction(Provider provider, Map<?, ?> map) {
this.provider = provider;
this.map = map;
}
--- a/jdk/src/share/classes/sun/security/ec/ECDSASignature.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/ec/ECDSASignature.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -25,10 +25,8 @@
package sun.security.ec;
-import java.io.IOException;
import java.nio.ByteBuffer;
import java.math.BigInteger;
-import java.util.Arrays;
import java.security.*;
import java.security.interfaces.*;
@@ -36,7 +34,6 @@
import sun.security.jca.JCAUtil;
import sun.security.util.*;
-import sun.security.x509.AlgorithmId;
/**
* ECDSA signature implementation. This class currently supports the
--- a/jdk/src/share/classes/sun/security/ec/ECKeyFactory.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/ec/ECKeyFactory.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -61,7 +61,9 @@
public final static Provider ecInternalProvider;
static {
- final Provider p = new Provider("SunEC-Internal", 1.0d, null) {};
+ final Provider p = new Provider("SunEC-Internal", 1.0d, null) {
+ private static final long serialVersionUID = 970685700309471261L;
+ };
AccessController.doPrivileged(new PrivilegedAction<Void>() {
public Void run() {
p.put("KeyFactory.EC", "sun.security.ec.ECKeyFactory");
@@ -262,12 +264,12 @@
if (key instanceof ECPublicKey) {
ECPublicKey ecKey = (ECPublicKey)key;
if (ECPublicKeySpec.class.isAssignableFrom(keySpec)) {
- return (T) new ECPublicKeySpec(
+ return keySpec.cast(new ECPublicKeySpec(
ecKey.getW(),
ecKey.getParams()
- );
+ ));
} else if (X509EncodedKeySpec.class.isAssignableFrom(keySpec)) {
- return (T) new X509EncodedKeySpec(key.getEncoded());
+ return keySpec.cast(new X509EncodedKeySpec(key.getEncoded()));
} else {
throw new InvalidKeySpecException
("KeySpec must be ECPublicKeySpec or "
@@ -275,13 +277,13 @@
}
} else if (key instanceof ECPrivateKey) {
if (PKCS8EncodedKeySpec.class.isAssignableFrom(keySpec)) {
- return (T) new PKCS8EncodedKeySpec(key.getEncoded());
+ return keySpec.cast(new PKCS8EncodedKeySpec(key.getEncoded()));
} else if (ECPrivateKeySpec.class.isAssignableFrom(keySpec)) {
ECPrivateKey ecKey = (ECPrivateKey)key;
- return (T) new ECPrivateKeySpec(
+ return keySpec.cast(new ECPrivateKeySpec(
ecKey.getS(),
ecKey.getParams()
- );
+ ));
} else {
throw new InvalidKeySpecException
("KeySpec must be ECPrivateKeySpec or "
--- a/jdk/src/share/classes/sun/security/ec/ECParameters.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/ec/ECParameters.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -326,9 +326,9 @@
protected <T extends AlgorithmParameterSpec> T engineGetParameterSpec(Class<T> spec)
throws InvalidParameterSpecException {
if (spec.isAssignableFrom(ECParameterSpec.class)) {
- return (T)paramSpec;
+ return spec.cast(paramSpec);
} else if (spec.isAssignableFrom(ECGenParameterSpec.class)) {
- return (T)new ECGenParameterSpec(getCurveName(paramSpec));
+ return spec.cast(new ECGenParameterSpec(getCurveName(paramSpec)));
} else {
throw new InvalidParameterSpecException
("Only ECParameterSpec and ECGenParameterSpec supported");
--- a/jdk/src/share/classes/sun/security/jca/GetInstance.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/jca/GetInstance.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -149,7 +149,7 @@
* There are overloaded methods for all the permutations.
*/
- public static Instance getInstance(String type, Class clazz,
+ public static Instance getInstance(String type, Class<?> clazz,
String algorithm) throws NoSuchAlgorithmException {
// in the almost all cases, the first service will work
// avoid taking long path if so
@@ -181,7 +181,7 @@
throw failure;
}
- public static Instance getInstance(String type, Class clazz,
+ public static Instance getInstance(String type, Class<?> clazz,
String algorithm, Object param) throws NoSuchAlgorithmException {
List<Service> services = getServices(type, algorithm);
NoSuchAlgorithmException failure = null;
@@ -200,25 +200,25 @@
}
}
- public static Instance getInstance(String type, Class clazz,
+ public static Instance getInstance(String type, Class<?> clazz,
String algorithm, String provider) throws NoSuchAlgorithmException,
NoSuchProviderException {
return getInstance(getService(type, algorithm, provider), clazz);
}
- public static Instance getInstance(String type, Class clazz,
+ public static Instance getInstance(String type, Class<?> clazz,
String algorithm, Object param, String provider)
throws NoSuchAlgorithmException, NoSuchProviderException {
return getInstance(getService(type, algorithm, provider), clazz, param);
}
- public static Instance getInstance(String type, Class clazz,
+ public static Instance getInstance(String type, Class<?> clazz,
String algorithm, Provider provider)
throws NoSuchAlgorithmException {
return getInstance(getService(type, algorithm, provider), clazz);
}
- public static Instance getInstance(String type, Class clazz,
+ public static Instance getInstance(String type, Class<?> clazz,
String algorithm, Object param, Provider provider)
throws NoSuchAlgorithmException {
return getInstance(getService(type, algorithm, provider), clazz, param);
@@ -231,14 +231,14 @@
* Signature class.
*/
- public static Instance getInstance(Service s, Class clazz)
+ public static Instance getInstance(Service s, Class<?> clazz)
throws NoSuchAlgorithmException {
Object instance = s.newInstance(null);
checkSuperClass(s, instance.getClass(), clazz);
return new Instance(s.getProvider(), instance);
}
- public static Instance getInstance(Service s, Class clazz,
+ public static Instance getInstance(Service s, Class<?> clazz,
Object param) throws NoSuchAlgorithmException {
Object instance = s.newInstance(param);
checkSuperClass(s, instance.getClass(), clazz);
@@ -249,8 +249,8 @@
* Check is subClass is a subclass of superClass. If not,
* throw a NoSuchAlgorithmException.
*/
- public static void checkSuperClass(Service s, Class subClass,
- Class superClass) throws NoSuchAlgorithmException {
+ public static void checkSuperClass(Service s, Class<?> subClass,
+ Class<?> superClass) throws NoSuchAlgorithmException {
if (superClass == null) {
return;
}
--- a/jdk/src/share/classes/sun/security/jca/ProviderList.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/jca/ProviderList.java Wed Jul 05 17:49:56 2017 +0200
@@ -69,6 +69,7 @@
// used to avoid explicit null checks in various places
private static final Provider EMPTY_PROVIDER =
new Provider("##Empty##", 1.0d, "initialization in progress") {
+ private static final long serialVersionUID = 1151354171352296389L;
// override getService() to return null slightly faster
public Service getService(String type, String algorithm) {
return null;
--- a/jdk/src/share/classes/sun/security/jca/Providers.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/jca/Providers.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,10 +25,7 @@
package sun.security.jca;
-import java.util.*;
-
import java.security.Provider;
-import java.security.Security;
/**
* Collection of methods to get and set provider list. Also includes
@@ -97,11 +94,11 @@
// sun.security.util.ManifestEntryVerifier and java.security.SecureRandom.
public static Provider getSunProvider() {
try {
- Class clazz = Class.forName(jarVerificationProviders[0]);
+ Class<?> clazz = Class.forName(jarVerificationProviders[0]);
return (Provider)clazz.newInstance();
} catch (Exception e) {
try {
- Class clazz = Class.forName(BACKUP_PROVIDER_CLASSNAME);
+ Class<?> clazz = Class.forName(BACKUP_PROVIDER_CLASSNAME);
return (Provider)clazz.newInstance();
} catch (Exception ee) {
throw new RuntimeException("Sun provider not found", e);
--- a/jdk/src/share/classes/sun/security/jgss/GSSUtil.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/jgss/GSSUtil.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -316,24 +316,25 @@
* no Subject present or a Vector which contains 0 or more
* matching GSSCredentialSpi objects.
*/
- public static Vector searchSubject(final GSSNameSpi name,
- final Oid mech,
- final boolean initiate,
- final Class credCls) {
+ public static <T extends GSSCredentialSpi> Vector<T>
+ searchSubject(final GSSNameSpi name,
+ final Oid mech,
+ final boolean initiate,
+ final Class<? extends T> credCls) {
debug("Search Subject for " + getMechStr(mech) +
(initiate? " INIT" : " ACCEPT") + " cred (" +
(name == null? "<<DEF>>" : name.toString()) + ", " +
credCls.getName() + ")");
final AccessControlContext acc = AccessController.getContext();
try {
- Vector creds =
+ Vector<T> creds =
AccessController.doPrivileged
- (new PrivilegedExceptionAction<Vector>() {
- public Vector run() throws Exception {
+ (new PrivilegedExceptionAction<Vector<T>>() {
+ public Vector<T> run() throws Exception {
Subject accSubj = Subject.getSubject(acc);
- Vector<GSSCredentialSpi> result = null;
+ Vector<T> result = null;
if (accSubj != null) {
- result = new Vector<GSSCredentialSpi>();
+ result = new Vector<T>();
Iterator<GSSCredentialImpl> iterator =
accSubj.getPrivateCredentials
(GSSCredentialImpl.class).iterator();
@@ -347,7 +348,7 @@
if (ce.getClass().equals(credCls) &&
(name == null ||
name.equals((Object) ce.getName()))) {
- result.add(ce);
+ result.add(credCls.cast(ce));
} else {
debug("......Discard element");
}
--- a/jdk/src/share/classes/sun/security/jgss/krb5/CipherHelper.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/jgss/krb5/CipherHelper.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2010, 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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -139,6 +139,7 @@
return flag;
}
+ @SuppressWarnings("fallthrough")
byte[] calculateChecksum(int alg, byte[] header, byte[] trailer,
byte[] data, int start, int len, int tokenId) throws GSSException {
@@ -1265,7 +1266,7 @@
// Note: When using this RC4 based encryption type, the sequence number
// is always sent in big-endian rather than little-endian order.
byte[] seqNum = new byte[4];
- token.writeBigEndian(token.getSequenceNumber(), seqNum);
+ WrapToken.writeBigEndian(token.getSequenceNumber(), seqNum);
// Krb5Token.debug("\narcFourEncrypt:" + Krb5Token.getHexBytes(all));
--- a/jdk/src/share/classes/sun/security/jgss/krb5/Krb5Context.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/jgss/krb5/Krb5Context.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -1310,6 +1310,8 @@
* The session key returned by inquireSecContext(KRB5_INQ_SSPI_SESSION_KEY)
*/
static class KerberosSessionKey implements Key {
+ private static final long serialVersionUID = 699307378954123869L;
+
private final EncryptionKey key;
KerberosSessionKey(EncryptionKey key) {
--- a/jdk/src/share/classes/sun/security/jgss/krb5/Krb5NameElement.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/jgss/krb5/Krb5NameElement.java Wed Jul 05 17:49:56 2017 +0200
@@ -35,6 +35,7 @@
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.security.Provider;
+import java.util.Locale;
/**
* Implements the GSSNameSpi for the krb5 mechanism.
@@ -184,7 +185,7 @@
} catch (UnknownHostException e) {
// use hostname as it is
}
- hostName = hostName.toLowerCase();
+ hostName = hostName.toLowerCase(Locale.ENGLISH);
temp = temp.append('/').append(hostName);
return temp.toString();
--- a/jdk/src/share/classes/sun/security/jgss/krb5/Krb5Util.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/jgss/krb5/Krb5Util.java Wed Jul 05 17:49:56 2017 +0200
@@ -193,6 +193,8 @@
// Each time new keys are read from KeyTab objects in the private
// credentials set, old ones are removed and new ones added.
public static class KeysFromKeyTab extends KerberosKey {
+ private static final long serialVersionUID = 8238092170252746927L;
+
public KeysFromKeyTab(KerberosKey key) {
super(key.getPrincipal(), key.getEncoded(),
key.getKeyType(), key.getVersionNumber());
--- a/jdk/src/share/classes/sun/security/jgss/krb5/MessageToken.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/jgss/krb5/MessageToken.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -27,12 +27,10 @@
import org.ietf.jgss.*;
import sun.security.jgss.*;
-import sun.security.krb5.*;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
import java.io.ByteArrayInputStream;
-import java.security.GeneralSecurityException;
import java.security.MessageDigest;
/**
@@ -184,7 +182,7 @@
try {
gssHeader = new GSSHeader(is);
- if (!gssHeader.getOid().equals(OID)) {
+ if (!gssHeader.getOid().equals((Object)OID)) {
throw new GSSException(GSSException.DEFECTIVE_TOKEN, -1,
getTokenName(tokenId));
}
--- a/jdk/src/share/classes/sun/security/jgss/krb5/SubjectComber.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/jgss/krb5/SubjectComber.java Wed Jul 05 17:49:56 2017 +0200
@@ -56,15 +56,17 @@
static <T> T find(Subject subject, String serverPrincipal,
String clientPrincipal, Class<T> credClass) {
- return (T)findAux(subject, serverPrincipal, clientPrincipal, credClass,
- true);
+ // findAux returns T if oneOnly.
+ return credClass.cast(findAux(subject, serverPrincipal,
+ clientPrincipal, credClass, true));
}
+ @SuppressWarnings("unchecked") // findAux returns List<T> if !oneOnly.
static <T> List<T> findMany(Subject subject, String serverPrincipal,
String clientPrincipal, Class<T> credClass) {
- return (List<T>)findAux(subject, serverPrincipal, clientPrincipal, credClass,
- false);
+ return (List<T>)findAux(subject, serverPrincipal, clientPrincipal,
+ credClass, false);
}
/**
@@ -73,6 +75,7 @@
*
* @return the private credentials
*/
+ // Returns T if oneOnly and List<T> if !oneOnly.
private static <T> Object findAux(Subject subject, String serverPrincipal,
String clientPrincipal, Class<T> credClass, boolean oneOnly) {
@@ -98,11 +101,11 @@
}
} else if (credClass == KerberosKey.class) {
// We are looking for credentials for the serverPrincipal
- Iterator<T> iterator =
- subject.getPrivateCredentials(credClass).iterator();
+ Iterator<KerberosKey> iterator =
+ subject.getPrivateCredentials(KerberosKey.class).iterator();
while (iterator.hasNext()) {
- T t = iterator.next();
- String name = ((KerberosKey)t).getPrincipal().getName();
+ KerberosKey t = iterator.next();
+ String name = t.getPrincipal().getName();
if (serverPrincipal == null || serverPrincipal.equals(name)) {
if (DEBUG) {
System.out.println("Found " +
@@ -116,7 +119,7 @@
// belong to the same principal
serverPrincipal = name;
}
- answer.add(t);
+ answer.add(credClass.cast(t));
}
}
}
@@ -129,6 +132,7 @@
while (iterator.hasNext()) {
Object obj = iterator.next();
if (obj instanceof KerberosTicket) {
+ @SuppressWarnings("unchecked")
KerberosTicket ticket = (KerberosTicket)obj;
if (DEBUG) {
System.out.println("Found ticket for "
@@ -180,7 +184,7 @@
serverPrincipal =
ticket.getServer().getName();
}
- answer.add((T)ticket);
+ answer.add(credClass.cast(ticket));
}
}
}
--- a/jdk/src/share/classes/sun/security/jgss/spnego/SpNegoContext.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/jgss/spnego/SpNegoContext.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -1016,7 +1016,7 @@
// get the peer name for the mechanism
if (mechContext != null) {
GSSNameImpl targName = (GSSNameImpl)mechContext.getTargName();
- peerName = (GSSNameSpi) targName.getElement(internal_mech);
+ peerName = targName.getElement(internal_mech);
return peerName;
} else {
if (DEBUG) {
@@ -1032,7 +1032,7 @@
// get the src name for the mechanism
if (mechContext != null) {
GSSNameImpl srcName = (GSSNameImpl)mechContext.getSrcName();
- myName = (GSSNameSpi) srcName.getElement(internal_mech);
+ myName = srcName.getElement(internal_mech);
return myName;
} else {
if (DEBUG) {
@@ -1064,8 +1064,8 @@
if (delegCred.getUsage() == GSSCredential.INITIATE_ONLY) {
initiate = true;
}
- GSSCredentialSpi mechCred = (GSSCredentialSpi)
- delegCred.getElement(internal_mech, initiate);
+ GSSCredentialSpi mechCred =
+ delegCred.getElement(internal_mech, initiate);
SpNegoCredElement cred = new SpNegoCredElement(mechCred);
return cred.getInternalCred();
} else {
--- a/jdk/src/share/classes/sun/security/jgss/wrapper/NativeGSSFactory.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/jgss/wrapper/NativeGSSFactory.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -113,8 +113,7 @@
}
GSSCredElement credElement =
- getCredFromSubject((GSSNameElement) nname,
- (usage == GSSCredential.INITIATE_ONLY));
+ getCredFromSubject(nname, (usage == GSSCredential.INITIATE_ONLY));
if (credElement == null) {
// No cred in the Subject
--- a/jdk/src/share/classes/sun/security/jgss/wrapper/SunNativeProvider.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/jgss/wrapper/SunNativeProvider.java Wed Jul 05 17:49:56 2017 +0200
@@ -52,7 +52,7 @@
"sun.security.jgss.wrapper.NativeGSSFactory";
private static final String LIB_PROP = "sun.security.jgss.lib";
private static final String DEBUG_PROP = "sun.security.nativegss.debug";
- private static HashMap MECH_MAP;
+ private static HashMap<String, String> MECH_MAP;
static final Provider INSTANCE = new SunNativeProvider();
static boolean DEBUG;
static void debug(String message) {
@@ -66,8 +66,9 @@
static {
MECH_MAP =
- AccessController.doPrivileged(new PrivilegedAction<HashMap>() {
- public HashMap run() {
+ AccessController.doPrivileged(
+ new PrivilegedAction<HashMap<String, String>>() {
+ public HashMap<String, String> run() {
DEBUG = Boolean.parseBoolean
(System.getProperty(DEBUG_PROP));
try {
--- a/jdk/src/share/classes/sun/security/krb5/Checksum.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/krb5/Checksum.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -199,7 +199,7 @@
if (cksumType != cksum.cksumType)
return false;
CksumType cksumEngine = CksumType.getInstance(cksumType);
- return cksumEngine.isChecksumEqual(checksum, cksum.checksum);
+ return CksumType.isChecksumEqual(checksum, cksum.checksum);
}
/**
--- a/jdk/src/share/classes/sun/security/krb5/Config.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/krb5/Config.java Wed Jul 05 17:49:56 2017 +0200
@@ -45,7 +45,6 @@
import java.util.List;
import sun.net.dns.ResolverConfiguration;
import sun.security.krb5.internal.crypto.EType;
-import sun.security.krb5.internal.ktab.*;
import sun.security.krb5.internal.Krb5;
/**
@@ -233,15 +232,18 @@
* @return the value found in config file, returns null if no value
* matched with the key is found.
*/
- private String getDefault(String k, Hashtable t) {
+ private String getDefault(String k, Hashtable<String, Object> t) {
String result = null;
String key;
if (stanzaTable != null) {
- for (Enumeration e = t.keys(); e.hasMoreElements(); ) {
- key = (String)e.nextElement();
+ for (Enumeration<String> e = t.keys(); e.hasMoreElements(); ) {
+ key = e.nextElement();
Object ob = t.get(key);
if (ob instanceof Hashtable) {
- result = getDefault(k, (Hashtable)ob);
+ @SuppressWarnings("unchecked") // Checked with an instanceof check
+ Hashtable<String, Object> table =
+ (Hashtable<String, Object>)ob;
+ result = getDefault(k, table);
if (result != null) {
return result;
}
@@ -276,15 +278,20 @@
* @param section the name of the section.
* @return the default value, null is returned if it cannot be found.
*/
+ // stanzaTable leads to a lot of unchecked casts since its value type is
+ // STANZATABLE = String | Hashtable<String, STANZATABLE>
+ @SuppressWarnings("unchecked")
public String getDefault(String name, String section) {
String stanzaName;
String result = null;
- Hashtable subTable;
+ Hashtable<String, Object> subTable;
if (stanzaTable != null) {
- for (Enumeration e = stanzaTable.keys(); e.hasMoreElements(); ) {
- stanzaName = (String)e.nextElement();
- subTable = (Hashtable)stanzaTable.get(stanzaName);
+ for (Enumeration<String> e = stanzaTable.keys();
+ e.hasMoreElements(); ) {
+ stanzaName = e.nextElement();
+ subTable = (Hashtable<String, Object>)
+ stanzaTable.get(stanzaName);
if (stanzaName.equalsIgnoreCase(section)) {
if (subTable.containsKey(name)) {
return (String)(subTable.get(name));
@@ -292,7 +299,8 @@
} else if (subTable.containsKey(section)) {
Object ob = subTable.get(section);
if (ob instanceof Hashtable) {
- Hashtable temp = (Hashtable)ob;
+ Hashtable<String, Object> temp =
+ (Hashtable<String, Object>)ob;
if (temp.containsKey(name)) {
Object object = temp.get(name);
if (object instanceof Vector) {
@@ -819,10 +827,10 @@
/**
* Compares the key with the known keys to see if it exists.
*/
- private boolean exists(String key, Vector v) {
+ private boolean exists(String key, Vector<String> v) {
boolean exists = false;
for (int i = 0; i < v.size(); i++) {
- if (((String)(v.elementAt(i))).equals(key)) {
+ if (v.elementAt(i).equals(key)) {
exists = true;
}
}
@@ -837,12 +845,15 @@
listTable(stanzaTable);
}
- private void listTable(Hashtable table) {
- Vector v = new Vector();
+ // stanzaTable leads to a lot of unchecked casts since its value type is
+ // STANZATABLE = String | Hashtable<String, STANZATABLE>
+ @SuppressWarnings("unchecked")
+ private void listTable(Hashtable<String, Object> table) {
+ Vector<String> v = new Vector<String>();
String key;
if (stanzaTable != null) {
- for (Enumeration e = table.keys(); e.hasMoreElements(); ) {
- key = (String)e.nextElement();
+ for (Enumeration<String> e = table.keys(); e.hasMoreElements(); ) {
+ key = e.nextElement();
Object object = table.get(key);
if (table == stanzaTable) {
System.out.println("[" + key + "]");
@@ -850,7 +861,7 @@
if (object instanceof Hashtable) {
if (table != stanzaTable)
System.out.println("\t" + key + " = {");
- listTable((Hashtable)object);
+ listTable((Hashtable<String, Object>)object);
if (table != stanzaTable)
System.out.println("\t}");
@@ -858,10 +869,9 @@
System.out.println("\t" + key + " = " +
(String)table.get(key));
} else if (object instanceof Vector) {
- v = (Vector)object;
+ v = (Vector<String>)object;
for (int i = 0; i < v.size(); i++) {
- System.out.println("\t" + key + " = " +
- (String)v.elementAt(i));
+ System.out.println("\t" + key + " = " + v.elementAt(i));
}
}
}
@@ -906,7 +916,7 @@
ls.add(type);
}
}
- if (ls.size() == 0) {
+ if (ls.isEmpty()) {
if (DEBUG) {
System.out.println(
"no supported default etypes for " + enctypes);
@@ -1296,7 +1306,7 @@
sb.append(obj);
sb.append('\n');
} else if (obj instanceof Hashtable) {
- Hashtable tab = (Hashtable)obj;
+ Hashtable<?, ?> tab = (Hashtable<?, ?>)obj;
for (Object o: tab.keySet()) {
sb.append(prefix);
sb.append(o);
@@ -1305,7 +1315,7 @@
sb.append(prefix + "}\n");
}
} else if (obj instanceof Vector) {
- Vector v = (Vector)obj;
+ Vector<?> v = (Vector<?>)obj;
for (Object o: v.toArray()) {
toStringIndented(prefix + " ", o, sb);
}
--- a/jdk/src/share/classes/sun/security/krb5/KrbServiceLocator.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/krb5/KrbServiceLocator.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -26,12 +26,9 @@
package sun.security.krb5;
import java.util.Arrays;
-import java.util.Enumeration;
import java.util.Hashtable;
-import java.util.NoSuchElementException;
import java.util.Random;
import java.util.StringTokenizer;
-import java.util.List;
import javax.naming.*;
import javax.naming.directory.*;
@@ -80,7 +77,7 @@
// the initial context constructor. This avoids having the initial
// context constructor call itself (when processing the URL
// argument in the getAttributes call).
- Context ctx = NamingManager.getURLContext("dns", new Hashtable(0));
+ Context ctx = NamingManager.getURLContext("dns", new Hashtable<>(0));
if (!(ctx instanceof DirContext)) {
return null; // cannot create a DNS context
}
@@ -141,7 +138,7 @@
// the initial context constructor. This avoids having the initial
// context constructor call itself (when processing the URL
// argument in the getAttributes call).
- Context ctx = NamingManager.getURLContext("dns", new Hashtable(0));
+ Context ctx = NamingManager.getURLContext("dns", new Hashtable<>(0));
if (!(ctx instanceof DirContext)) {
return null; // cannot create a DNS context
}
@@ -263,7 +260,7 @@
* See http://www.ietf.org/rfc/rfc2782.txt
*/
-static class SrvRecord implements Comparable {
+static class SrvRecord implements Comparable<SrvRecord> {
int priority;
int weight;
@@ -295,8 +292,7 @@
* Sort records in ascending order of priority value. For records with
* equal priority move those with weight 0 to the top of the list.
*/
- public int compareTo(Object o) {
- SrvRecord that = (SrvRecord) o;
+ public int compareTo(SrvRecord that) {
if (priority > that.priority) {
return 1; // this > that
} else if (priority < that.priority) {
--- a/jdk/src/share/classes/sun/security/krb5/PrincipalName.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/krb5/PrincipalName.java Wed Jul 05 17:49:56 2017 +0200
@@ -35,6 +35,7 @@
import sun.security.util.*;
import java.net.*;
import java.util.Vector;
+import java.util.Locale;
import java.io.IOException;
import java.math.BigInteger;
import sun.security.krb5.internal.ccache.CCacheOutputStream;
@@ -389,14 +390,14 @@
// Looks if canonicalized is a longer format of hostName,
// we accept cases like
// bunny -> bunny.rabbit.hole
- if (canonicalized.toLowerCase()
- .startsWith(hostName.toLowerCase()+".")) {
+ if (canonicalized.toLowerCase(Locale.ENGLISH).startsWith(
+ hostName.toLowerCase(Locale.ENGLISH)+".")) {
hostName = canonicalized;
}
} catch (UnknownHostException e) {
// no canonicalization, use old
}
- nameParts[1] = hostName.toLowerCase();
+ nameParts[1] = hostName.toLowerCase(Locale.ENGLISH);
}
nameStrings = nameParts;
nameType = type;
--- a/jdk/src/share/classes/sun/security/krb5/internal/ccache/FileCredentialsCache.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/krb5/internal/ccache/FileCredentialsCache.java Wed Jul 05 17:49:56 2017 +0200
@@ -69,9 +69,9 @@
try {
FileCredentialsCache fcc = new FileCredentialsCache();
if (cache == null) {
- cacheName = fcc.getDefaultCacheName();
+ cacheName = FileCredentialsCache.getDefaultCacheName();
} else {
- cacheName = fcc.checkValidation(cache);
+ cacheName = FileCredentialsCache.checkValidation(cache);
}
if ((cacheName == null) || !(new File(cacheName)).exists()) {
// invalid cache name or the file doesn't exist
@@ -105,7 +105,7 @@
String name) {
try {
FileCredentialsCache fcc = new FileCredentialsCache();
- cacheName = fcc.checkValidation(name);
+ cacheName = FileCredentialsCache.checkValidation(name);
if (cacheName == null) {
// invalid cache name or the file doesn't exist
return null;
@@ -123,7 +123,7 @@
static synchronized FileCredentialsCache New(PrincipalName principal) {
try {
FileCredentialsCache fcc = new FileCredentialsCache();
- cacheName = fcc.getDefaultCacheName();
+ cacheName = FileCredentialsCache.getDefaultCacheName();
fcc.init(principal, cacheName);
return fcc;
}
--- a/jdk/src/share/classes/sun/security/pkcs/ContentInfo.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs/ContentInfo.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -163,9 +163,9 @@
}
public byte[] getData() throws IOException {
- if (contentType.equals(DATA_OID) ||
- contentType.equals(OLD_DATA_OID) ||
- contentType.equals(TIMESTAMP_TOKEN_INFO_OID)) {
+ if (contentType.equals((Object)DATA_OID) ||
+ contentType.equals((Object)OLD_DATA_OID) ||
+ contentType.equals((Object)TIMESTAMP_TOKEN_INFO_OID)) {
if (content == null)
return null;
else
--- a/jdk/src/share/classes/sun/security/pkcs/PKCS10.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs/PKCS10.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -26,7 +26,6 @@
package sun.security.pkcs;
-import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.io.IOException;
import java.math.BigInteger;
@@ -225,7 +224,7 @@
*/
AlgorithmId algId = null;
try {
- algId = AlgorithmId.getAlgorithmId(signature.getAlgorithm());
+ algId = AlgorithmId.get(signature.getAlgorithm());
} catch (NoSuchAlgorithmException nsae) {
throw new SignatureException(nsae);
}
--- a/jdk/src/share/classes/sun/security/pkcs/PKCS7.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs/PKCS7.java Wed Jul 05 17:49:56 2017 +0200
@@ -153,12 +153,13 @@
contentType = contentInfo.contentType;
DerValue content = contentInfo.getContent();
- if (contentType.equals(ContentInfo.SIGNED_DATA_OID)) {
+ if (contentType.equals((Object)ContentInfo.SIGNED_DATA_OID)) {
parseSignedData(content);
- } else if (contentType.equals(ContentInfo.OLD_SIGNED_DATA_OID)) {
+ } else if (contentType.equals((Object)ContentInfo.OLD_SIGNED_DATA_OID)) {
// This is for backwards compatibility with JDK 1.1.x
parseOldSignedData(content);
- } else if (contentType.equals(ContentInfo.NETSCAPE_CERT_SEQUENCE_OID)){
+ } else if (contentType.equals((Object)
+ ContentInfo.NETSCAPE_CERT_SEQUENCE_OID)){
parseNetscapeCertChain(content);
} else {
throw new ParsingException("content type " + contentType +
@@ -477,9 +478,7 @@
byte[] encoded = certificates[i].getEncoded();
implCerts[i] = new X509CertImpl(encoded);
} catch (CertificateException ce) {
- IOException ie = new IOException(ce.getMessage());
- ie.initCause(ce);
- throw ie;
+ throw new IOException(ce);
}
}
}
@@ -501,9 +500,7 @@
byte[] encoded = crl.getEncoded();
implCRLs.add(new X509CRLImpl(encoded));
} catch (CRLException ce) {
- IOException ie = new IOException(ce.getMessage());
- ie.initCause(ce);
- throw ie;
+ throw new IOException(ce);
}
}
}
@@ -562,7 +559,7 @@
intResult.addElement(signerInfo);
}
}
- if (intResult.size() != 0) {
+ if (!intResult.isEmpty()) {
SignerInfo[] result = new SignerInfo[intResult.size()];
intResult.copyInto(result);
--- a/jdk/src/share/classes/sun/security/pkcs/PKCS8Key.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs/PKCS8Key.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -208,7 +208,7 @@
throw new InstantiationException();
}
- Class keyClass = null;
+ Class<?> keyClass = null;
try {
keyClass = Class.forName(classname);
} catch (ClassNotFoundException e) {
@@ -342,9 +342,9 @@
BigInteger version = val.data.getBigInteger();
- if (!version.equals(this.version)) {
+ if (!version.equals(PKCS8Key.version)) {
throw new IOException("version mismatch: (supported: " +
- Debug.toHexString(this.version) +
+ Debug.toHexString(PKCS8Key.version) +
", parsed: " +
Debug.toHexString(version));
}
--- a/jdk/src/share/classes/sun/security/pkcs/PKCS9Attribute.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs/PKCS9Attribute.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -320,11 +320,11 @@
{new Byte(DerValue.tag_Sequence)} // SignatureTimestampToken
};
- private static final Class[] VALUE_CLASSES = new Class[18];
+ private static final Class<?>[] VALUE_CLASSES = new Class<?>[18];
static {
try {
- Class str = Class.forName("[Ljava.lang.String;");
+ Class<?> str = Class.forName("[Ljava.lang.String;");
VALUE_CLASSES[0] = null; // not used
VALUE_CLASSES[1] = str; // EMailAddress
--- a/jdk/src/share/classes/sun/security/pkcs/SignerInfo.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs/SignerInfo.java Wed Jul 05 17:49:56 2017 +0200
@@ -36,7 +36,6 @@
import sun.security.x509.AlgorithmId;
import sun.security.x509.X500Name;
import sun.security.x509.KeyUsageExtension;
-import sun.security.x509.PKIXExtensions;
import sun.misc.HexDumpEncoder;
/**
@@ -300,7 +299,7 @@
authenticatedAttributes.getAttributeValue(
PKCS9Attribute.CONTENT_TYPE_OID);
if (contentType == null ||
- !contentType.equals(content.contentType))
+ !contentType.equals((Object)content.contentType))
return null; // contentType does not match, bad SignerInfo
// now, check message digest
@@ -371,11 +370,11 @@
+ "extension");
}
- boolean digSigAllowed = ((Boolean)keyUsage.get(
- KeyUsageExtension.DIGITAL_SIGNATURE)).booleanValue();
+ boolean digSigAllowed = keyUsage.get(
+ KeyUsageExtension.DIGITAL_SIGNATURE).booleanValue();
- boolean nonRepuAllowed = ((Boolean)keyUsage.get(
- KeyUsageExtension.NON_REPUDIATION)).booleanValue();
+ boolean nonRepuAllowed = keyUsage.get(
+ KeyUsageExtension.NON_REPUDIATION).booleanValue();
if (!digSigAllowed && !nonRepuAllowed) {
throw new SignatureException("Key usage restricted: "
--- a/jdk/src/share/classes/sun/security/pkcs11/Config.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs11/Config.java Wed Jul 05 17:49:56 2017 +0200
@@ -552,12 +552,13 @@
private boolean parseBoolean() throws IOException {
String val = parseWord();
- if (val.equals("true")) {
- return true;
- } else if (val.equals("false")) {
- return false;
- } else {
- throw excToken("Expected boolean value, read:");
+ switch (val) {
+ case "true":
+ return true;
+ case "false":
+ return false;
+ default:
+ throw excToken("Expected boolean value, read:");
}
}
@@ -886,14 +887,15 @@
private String parseOperation() throws IOException {
String op = parseWord();
- if (op.equals("*")) {
- return TemplateManager.O_ANY;
- } else if (op.equals("generate")) {
- return TemplateManager.O_GENERATE;
- } else if (op.equals("import")) {
- return TemplateManager.O_IMPORT;
- } else {
- throw excLine("Unknown operation " + op);
+ switch (op) {
+ case "*":
+ return TemplateManager.O_ANY;
+ case "generate":
+ return TemplateManager.O_GENERATE;
+ case "import":
+ return TemplateManager.O_IMPORT;
+ default:
+ throw excLine("Unknown operation " + op);
}
}
@@ -978,6 +980,7 @@
}
class ConfigurationException extends IOException {
+ private static final long serialVersionUID = 254492758807673194L;
ConfigurationException(String msg) {
super(msg);
}
--- a/jdk/src/share/classes/sun/security/pkcs11/P11Cipher.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11Cipher.java Wed Jul 05 17:49:56 2017 +0200
@@ -258,7 +258,7 @@
// see JCE spec
protected byte[] engineGetIV() {
- return (iv == null) ? null : (byte[]) iv.clone();
+ return (iv == null) ? null : iv.clone();
}
// see JCE spec
@@ -315,7 +315,7 @@
byte[] ivValue;
if (params != null) {
try {
- IvParameterSpec ivSpec = (IvParameterSpec)
+ IvParameterSpec ivSpec =
params.getParameterSpec(IvParameterSpec.class);
ivValue = ivSpec.getIV();
} catch (InvalidParameterSpecException e) {
--- a/jdk/src/share/classes/sun/security/pkcs11/P11DHKeyFactory.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11DHKeyFactory.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -212,8 +212,8 @@
}
}
- KeySpec implGetPublicKeySpec(P11Key key, Class keySpec, Session[] session)
- throws PKCS11Exception, InvalidKeySpecException {
+ <T extends KeySpec> T implGetPublicKeySpec(P11Key key, Class<T> keySpec,
+ Session[] session) throws PKCS11Exception, InvalidKeySpecException {
if (DHPublicKeySpec.class.isAssignableFrom(keySpec)) {
session[0] = token.getObjSession();
CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] {
@@ -227,15 +227,15 @@
attributes[1].getBigInteger(),
attributes[2].getBigInteger()
);
- return spec;
+ return keySpec.cast(spec);
} else { // X.509 handled in superclass
throw new InvalidKeySpecException("Only DHPublicKeySpec and "
+ "X509EncodedKeySpec supported for DH public keys");
}
}
- KeySpec implGetPrivateKeySpec(P11Key key, Class keySpec, Session[] session)
- throws PKCS11Exception, InvalidKeySpecException {
+ <T extends KeySpec> T implGetPrivateKeySpec(P11Key key, Class<T> keySpec,
+ Session[] session) throws PKCS11Exception, InvalidKeySpecException {
if (DHPrivateKeySpec.class.isAssignableFrom(keySpec)) {
session[0] = token.getObjSession();
CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] {
@@ -249,7 +249,7 @@
attributes[1].getBigInteger(),
attributes[2].getBigInteger()
);
- return spec;
+ return keySpec.cast(spec);
} else { // PKCS#8 handled in superclass
throw new InvalidKeySpecException("Only DHPrivateKeySpec "
+ "and PKCS8EncodedKeySpec supported for DH private keys");
--- a/jdk/src/share/classes/sun/security/pkcs11/P11DSAKeyFactory.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11DSAKeyFactory.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -208,8 +208,8 @@
}
}
- KeySpec implGetPublicKeySpec(P11Key key, Class keySpec, Session[] session)
- throws PKCS11Exception, InvalidKeySpecException {
+ <T extends KeySpec> T implGetPublicKeySpec(P11Key key, Class<T> keySpec,
+ Session[] session) throws PKCS11Exception, InvalidKeySpecException {
if (DSAPublicKeySpec.class.isAssignableFrom(keySpec)) {
session[0] = token.getObjSession();
CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] {
@@ -225,15 +225,15 @@
attributes[2].getBigInteger(),
attributes[3].getBigInteger()
);
- return spec;
+ return keySpec.cast(spec);
} else { // X.509 handled in superclass
throw new InvalidKeySpecException("Only DSAPublicKeySpec and "
+ "X509EncodedKeySpec supported for DSA public keys");
}
}
- KeySpec implGetPrivateKeySpec(P11Key key, Class keySpec, Session[] session)
- throws PKCS11Exception, InvalidKeySpecException {
+ <T extends KeySpec> T implGetPrivateKeySpec(P11Key key, Class<T> keySpec,
+ Session[] session) throws PKCS11Exception, InvalidKeySpecException {
if (DSAPrivateKeySpec.class.isAssignableFrom(keySpec)) {
session[0] = token.getObjSession();
CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] {
@@ -249,7 +249,7 @@
attributes[2].getBigInteger(),
attributes[3].getBigInteger()
);
- return spec;
+ return keySpec.cast(spec);
} else { // PKCS#8 handled in superclass
throw new InvalidKeySpecException("Only DSAPrivateKeySpec "
+ "and PKCS8EncodedKeySpec supported for DSA private keys");
--- a/jdk/src/share/classes/sun/security/pkcs11/P11ECKeyFactory.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11ECKeyFactory.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -253,8 +253,8 @@
}
}
- KeySpec implGetPublicKeySpec(P11Key key, Class keySpec, Session[] session)
- throws PKCS11Exception, InvalidKeySpecException {
+ <T extends KeySpec> T implGetPublicKeySpec(P11Key key, Class<T> keySpec,
+ Session[] session) throws PKCS11Exception, InvalidKeySpecException {
if (ECPublicKeySpec.class.isAssignableFrom(keySpec)) {
session[0] = token.getObjSession();
CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] {
@@ -265,7 +265,7 @@
try {
ECParameterSpec params = decodeParameters(attributes[1].getByteArray());
ECPoint point = decodePoint(attributes[0].getByteArray(), params.getCurve());
- return new ECPublicKeySpec(point, params);
+ return keySpec.cast(new ECPublicKeySpec(point, params));
} catch (IOException e) {
throw new InvalidKeySpecException("Could not parse key", e);
}
@@ -275,8 +275,8 @@
}
}
- KeySpec implGetPrivateKeySpec(P11Key key, Class keySpec, Session[] session)
- throws PKCS11Exception, InvalidKeySpecException {
+ <T extends KeySpec> T implGetPrivateKeySpec(P11Key key, Class<T> keySpec,
+ Session[] session) throws PKCS11Exception, InvalidKeySpecException {
if (ECPrivateKeySpec.class.isAssignableFrom(keySpec)) {
session[0] = token.getObjSession();
CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] {
@@ -286,7 +286,8 @@
token.p11.C_GetAttributeValue(session[0].id(), key.keyID, attributes);
try {
ECParameterSpec params = decodeParameters(attributes[1].getByteArray());
- return new ECPrivateKeySpec(attributes[0].getBigInteger(), params);
+ return keySpec.cast(
+ new ECPrivateKeySpec(attributes[0].getBigInteger(), params));
} catch (IOException e) {
throw new InvalidKeySpecException("Could not parse key", e);
}
--- a/jdk/src/share/classes/sun/security/pkcs11/P11Key.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11Key.java Wed Jul 05 17:49:56 2017 +0200
@@ -128,7 +128,7 @@
// see JCA spec
public final byte[] getEncoded() {
byte[] b = getEncodedInternal();
- return (b == null) ? null : (byte[])b.clone();
+ return (b == null) ? null : b.clone();
}
abstract byte[] getEncodedInternal();
@@ -299,21 +299,22 @@
// we assume that all components of public keys are always accessible
static PublicKey publicKey(Session session, long keyID, String algorithm,
int keyLength, CK_ATTRIBUTE[] attributes) {
- if (algorithm.equals("RSA")) {
- return new P11RSAPublicKey
- (session, keyID, algorithm, keyLength, attributes);
- } else if (algorithm.equals("DSA")) {
- return new P11DSAPublicKey
- (session, keyID, algorithm, keyLength, attributes);
- } else if (algorithm.equals("DH")) {
- return new P11DHPublicKey
- (session, keyID, algorithm, keyLength, attributes);
- } else if (algorithm.equals("EC")) {
- return new P11ECPublicKey
- (session, keyID, algorithm, keyLength, attributes);
- } else {
- throw new ProviderException
- ("Unknown public key algorithm " + algorithm);
+ switch (algorithm) {
+ case "RSA":
+ return new P11RSAPublicKey
+ (session, keyID, algorithm, keyLength, attributes);
+ case "DSA":
+ return new P11DSAPublicKey
+ (session, keyID, algorithm, keyLength, attributes);
+ case "DH":
+ return new P11DHPublicKey
+ (session, keyID, algorithm, keyLength, attributes);
+ case "EC":
+ return new P11ECPublicKey
+ (session, keyID, algorithm, keyLength, attributes);
+ default:
+ throw new ProviderException
+ ("Unknown public key algorithm " + algorithm);
}
}
@@ -328,42 +329,43 @@
return new P11PrivateKey
(session, keyID, algorithm, keyLength, attributes);
} else {
- if (algorithm.equals("RSA")) {
- // XXX better test for RSA CRT keys (single getAttributes() call)
- // we need to determine whether this is a CRT key
- // see if we can obtain the public exponent
- // this should also be readable for sensitive/extractable keys
- CK_ATTRIBUTE[] attrs2 = new CK_ATTRIBUTE[] {
- new CK_ATTRIBUTE(CKA_PUBLIC_EXPONENT),
- };
- boolean crtKey;
- try {
- session.token.p11.C_GetAttributeValue
- (session.id(), keyID, attrs2);
- crtKey = (attrs2[0].pValue instanceof byte[]);
- } catch (PKCS11Exception e) {
- // ignore, assume not available
- crtKey = false;
- }
- if (crtKey) {
- return new P11RSAPrivateKey
+ switch (algorithm) {
+ case "RSA":
+ // XXX better test for RSA CRT keys (single getAttributes() call)
+ // we need to determine whether this is a CRT key
+ // see if we can obtain the public exponent
+ // this should also be readable for sensitive/extractable keys
+ CK_ATTRIBUTE[] attrs2 = new CK_ATTRIBUTE[] {
+ new CK_ATTRIBUTE(CKA_PUBLIC_EXPONENT),
+ };
+ boolean crtKey;
+ try {
+ session.token.p11.C_GetAttributeValue
+ (session.id(), keyID, attrs2);
+ crtKey = (attrs2[0].pValue instanceof byte[]);
+ } catch (PKCS11Exception e) {
+ // ignore, assume not available
+ crtKey = false;
+ }
+ if (crtKey) {
+ return new P11RSAPrivateKey
+ (session, keyID, algorithm, keyLength, attributes);
+ } else {
+ return new P11RSAPrivateNonCRTKey
+ (session, keyID, algorithm, keyLength, attributes);
+ }
+ case "DSA":
+ return new P11DSAPrivateKey
(session, keyID, algorithm, keyLength, attributes);
- } else {
- return new P11RSAPrivateNonCRTKey
+ case "DH":
+ return new P11DHPrivateKey
(session, keyID, algorithm, keyLength, attributes);
- }
- } else if (algorithm.equals("DSA")) {
- return new P11DSAPrivateKey
- (session, keyID, algorithm, keyLength, attributes);
- } else if (algorithm.equals("DH")) {
- return new P11DHPrivateKey
- (session, keyID, algorithm, keyLength, attributes);
- } else if (algorithm.equals("EC")) {
- return new P11ECPrivateKey
- (session, keyID, algorithm, keyLength, attributes);
- } else {
- throw new ProviderException
- ("Unknown private key algorithm " + algorithm);
+ case "EC":
+ return new P11ECPrivateKey
+ (session, keyID, algorithm, keyLength, attributes);
+ default:
+ throw new ProviderException
+ ("Unknown private key algorithm " + algorithm);
}
}
}
@@ -371,6 +373,8 @@
// class for sensitive and unextractable private keys
private static final class P11PrivateKey extends P11Key
implements PrivateKey {
+ private static final long serialVersionUID = -2138581185214187615L;
+
P11PrivateKey(Session session, long keyID, String algorithm,
int keyLength, CK_ATTRIBUTE[] attributes) {
super(PRIVATE, session, keyID, algorithm, keyLength, attributes);
@@ -387,6 +391,7 @@
}
private static class P11SecretKey extends P11Key implements SecretKey {
+ private static final long serialVersionUID = -7828241727014329084L;
private volatile byte[] encoded;
P11SecretKey(Session session, long keyID, String algorithm,
int keyLength, CK_ATTRIBUTE[] attributes) {
@@ -434,6 +439,8 @@
private static class P11TlsMasterSecretKey extends P11SecretKey
implements TlsMasterSecret {
+ private static final long serialVersionUID = -1318560923770573441L;
+
private final int majorVersion, minorVersion;
P11TlsMasterSecretKey(Session session, long keyID, String algorithm,
int keyLength, CK_ATTRIBUTE[] attributes, int major, int minor) {
@@ -453,6 +460,8 @@
// RSA CRT private key
private static final class P11RSAPrivateKey extends P11Key
implements RSAPrivateCrtKey {
+ private static final long serialVersionUID = 9215872438913515220L;
+
private BigInteger n, e, d, p, q, pe, qe, coeff;
private byte[] encoded;
P11RSAPrivateKey(Session session, long keyID, String algorithm,
@@ -563,6 +572,8 @@
// RSA non-CRT private key
private static final class P11RSAPrivateNonCRTKey extends P11Key
implements RSAPrivateKey {
+ private static final long serialVersionUID = 1137764983777411481L;
+
private BigInteger n, d;
private byte[] encoded;
P11RSAPrivateNonCRTKey(Session session, long keyID, String algorithm,
@@ -624,6 +635,8 @@
private static final class P11RSAPublicKey extends P11Key
implements RSAPublicKey {
+ private static final long serialVersionUID = -826726289023854455L;
+
private BigInteger n, e;
private byte[] encoded;
P11RSAPublicKey(Session session, long keyID, String algorithm,
@@ -676,6 +689,8 @@
private static final class P11DSAPublicKey extends P11Key
implements DSAPublicKey {
+ private static final long serialVersionUID = 5989753793316396637L;
+
private BigInteger y;
private DSAParams params;
private byte[] encoded;
@@ -737,6 +752,8 @@
private static final class P11DSAPrivateKey extends P11Key
implements DSAPrivateKey {
+ private static final long serialVersionUID = 3119629997181999389L;
+
private BigInteger x;
private DSAParams params;
private byte[] encoded;
@@ -798,6 +815,8 @@
private static final class P11DHPrivateKey extends P11Key
implements DHPrivateKey {
+ private static final long serialVersionUID = -1698576167364928838L;
+
private BigInteger x;
private DHParameterSpec params;
private byte[] encoded;
@@ -860,6 +879,8 @@
private static final class P11DHPublicKey extends P11Key
implements DHPublicKey {
+ static final long serialVersionUID = -598383872153843657L;
+
private BigInteger y;
private DHParameterSpec params;
private byte[] encoded;
@@ -922,6 +943,8 @@
private static final class P11ECPrivateKey extends P11Key
implements ECPrivateKey {
+ private static final long serialVersionUID = -7786054399510515515L;
+
private BigInteger s;
private ECParameterSpec params;
private byte[] encoded;
@@ -982,6 +1005,8 @@
private static final class P11ECPublicKey extends P11Key
implements ECPublicKey {
+ private static final long serialVersionUID = -6371481375154806089L;
+
private ECPoint w;
private ECParameterSpec params;
private byte[] encoded;
--- a/jdk/src/share/classes/sun/security/pkcs11/P11KeyAgreement.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11KeyAgreement.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -143,8 +143,8 @@
// just in case not, attempt conversion
P11DHKeyFactory kf = new P11DHKeyFactory(token, "DH");
try {
- DHPublicKeySpec spec = (DHPublicKeySpec)kf.engineGetKeySpec
- (key, DHPublicKeySpec.class);
+ DHPublicKeySpec spec = kf.engineGetKeySpec(
+ key, DHPublicKeySpec.class);
y = spec.getY();
p = spec.getP();
g = spec.getG();
--- a/jdk/src/share/classes/sun/security/pkcs11/P11KeyFactory.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11KeyFactory.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -29,7 +29,6 @@
import java.security.spec.*;
import sun.security.pkcs11.wrapper.PKCS11Exception;
-import static sun.security.pkcs11.wrapper.PKCS11Constants.*;
/**
* KeyFactory base class. Provides common infrastructure for the RSA, DSA,
@@ -77,7 +76,7 @@
if (PKCS8EncodedKeySpec.class.isAssignableFrom(keySpec)
|| X509EncodedKeySpec.class.isAssignableFrom(keySpec)) {
try {
- return (T)implGetSoftwareFactory().getKeySpec(key, keySpec);
+ return implGetSoftwareFactory().getKeySpec(key, keySpec);
} catch (GeneralSecurityException e) {
throw new InvalidKeySpecException("Could not encode key", e);
}
@@ -92,9 +91,9 @@
Session[] session = new Session[1];
try {
if (p11Key.isPublic()) {
- return (T)implGetPublicKeySpec(p11Key, keySpec, session);
+ return implGetPublicKeySpec(p11Key, keySpec, session);
} else {
- return (T)implGetPrivateKeySpec(p11Key, keySpec, session);
+ return implGetPrivateKeySpec(p11Key, keySpec, session);
}
} catch (PKCS11Exception e) {
throw new InvalidKeySpecException("Could not generate KeySpec", e);
@@ -138,10 +137,10 @@
}
}
- abstract KeySpec implGetPublicKeySpec(P11Key key, Class keySpec,
+ abstract <T extends KeySpec> T implGetPublicKeySpec(P11Key key, Class<T> keySpec,
Session[] session) throws PKCS11Exception, InvalidKeySpecException;
- abstract KeySpec implGetPrivateKeySpec(P11Key key, Class keySpec,
+ abstract <T extends KeySpec> T implGetPrivateKeySpec(P11Key key, Class<T> keySpec,
Session[] session) throws PKCS11Exception, InvalidKeySpecException;
abstract PublicKey implTranslatePublicKey(PublicKey key)
--- a/jdk/src/share/classes/sun/security/pkcs11/P11KeyStore.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11KeyStore.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -34,12 +34,9 @@
import java.io.UnsupportedEncodingException;
import java.util.Arrays;
-import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.List;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.HashMap;
@@ -48,7 +45,6 @@
import java.security.*;
import java.security.KeyStore.*;
-import java.security.cert.CertPath;
import java.security.cert.Certificate;
import java.security.cert.X509Certificate;
import java.security.cert.CertificateFactory;
@@ -60,7 +56,6 @@
import javax.crypto.SecretKey;
import javax.crypto.interfaces.*;
-import javax.security.auth.Subject;
import javax.security.auth.x500.X500Principal;
import javax.security.auth.login.LoginException;
import javax.security.auth.callback.Callback;
@@ -69,7 +64,6 @@
import javax.security.auth.callback.UnsupportedCallbackException;
import sun.security.util.Debug;
-import sun.security.x509.SerialNumber;
import sun.security.util.DerValue;
import sun.security.ec.ECParameters;
@@ -235,7 +229,7 @@
private PasswordCallbackHandler(char[] password) {
if (password != null) {
- this.password = (char[])password.clone();
+ this.password = password.clone();
}
}
@@ -331,10 +325,8 @@
// did not find anything
return null;
- } catch (PKCS11Exception pe) {
- throw new ProviderException(pe);
- } catch (KeyStoreException ke) {
- throw new ProviderException(ke);
+ } catch (PKCS11Exception | KeyStoreException e) {
+ throw new ProviderException(e);
} finally {
token.releaseSession(session);
}
@@ -458,10 +450,8 @@
} else if (key instanceof SecretKey) {
entry = new KeyStore.SecretKeyEntry((SecretKey)key);
}
- } catch (NullPointerException npe) {
- throw new KeyStoreException(npe);
- } catch (IllegalArgumentException iae) {
- throw new KeyStoreException(iae);
+ } catch (NullPointerException | IllegalArgumentException e) {
+ throw new KeyStoreException(e);
}
engineSetEntry(alias, entry, new KeyStore.PasswordProtection(password));
}
@@ -566,10 +556,8 @@
} else {
throw new KeyStoreException("unexpected entry type");
}
- } catch (PKCS11Exception pe) {
- throw new KeyStoreException(pe);
- } catch (CertificateException ce) {
- throw new KeyStoreException(ce);
+ } catch (PKCS11Exception | CertificateException e) {
+ throw new KeyStoreException(e);
}
}
return false;
@@ -770,18 +758,8 @@
if (debug != null) {
dumpTokenMap();
}
- } catch (LoginException le) {
- IOException ioe = new IOException("load failed");
- ioe.initCause(le);
- throw ioe;
- } catch (KeyStoreException kse) {
- IOException ioe = new IOException("load failed");
- ioe.initCause(kse);
- throw ioe;
- } catch (PKCS11Exception pe) {
- IOException ioe = new IOException("load failed");
- ioe.initCause(pe);
- throw ioe;
+ } catch (LoginException | KeyStoreException | PKCS11Exception e) {
+ throw new IOException("load failed", e);
}
}
@@ -860,11 +838,7 @@
if (debug != null) {
dumpTokenMap();
}
- } catch (LoginException e) {
- throw new IOException("load failed", e);
- } catch (KeyStoreException e) {
- throw new IOException("load failed", e);
- } catch (PKCS11Exception e) {
+ } catch (LoginException | KeyStoreException | PKCS11Exception e) {
throw new IOException("load failed", e);
}
}
@@ -1054,9 +1028,7 @@
storeCert(alias, xcert);
module.setTrust(token, xcert);
mapLabels();
- } catch (PKCS11Exception e) {
- throw new KeyStoreException(e);
- } catch (CertificateException e) {
+ } catch (PKCS11Exception | CertificateException e) {
throw new KeyStoreException(e);
}
@@ -1118,10 +1090,8 @@
storePkey(alias, (KeyStore.PrivateKeyEntry)entry);
}
- } catch (PKCS11Exception pe) {
+ } catch (PKCS11Exception | CertificateException pe) {
throw new KeyStoreException(pe);
- } catch (CertificateException ce) {
- throw new KeyStoreException(ce);
}
} else if (entry instanceof KeyStore.SecretKeyEntry) {
@@ -1158,10 +1128,8 @@
if (debug != null) {
dumpTokenMap();
}
- } catch (PKCS11Exception pe) {
+ } catch (PKCS11Exception | CertificateException pe) {
throw new KeyStoreException(pe);
- } catch (CertificateException ce) {
- throw new KeyStoreException(ce);
}
}
@@ -1870,7 +1838,7 @@
debug.println("creating RSAPrivateKey attrs");
}
- RSAPrivateKey rsaKey = (RSAPrivateKey)key;
+ RSAPrivateKey rsaKey = key;
attrs = new CK_ATTRIBUTE[] {
ATTR_TOKEN_TRUE,
@@ -2662,7 +2630,7 @@
private void dumpTokenMap() {
Set<String> aliases = aliasMap.keySet();
System.out.println("Token Alias Map:");
- if (aliases.size() == 0) {
+ if (aliases.isEmpty()) {
System.out.println(" [empty]");
} else {
for (String s : aliases) {
--- a/jdk/src/share/classes/sun/security/pkcs11/P11RSAKeyFactory.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11RSAKeyFactory.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -130,10 +130,7 @@
rs.getModulus(),
rs.getPublicExponent()
);
- } catch (PKCS11Exception e) {
- throw new InvalidKeySpecException
- ("Could not create RSA public key", e);
- } catch (InvalidKeyException e) {
+ } catch (PKCS11Exception | InvalidKeyException e) {
throw new InvalidKeySpecException
("Could not create RSA public key", e);
}
@@ -177,10 +174,7 @@
throw new InvalidKeySpecException("Only RSAPrivate(Crt)KeySpec "
+ "and PKCS8EncodedKeySpec supported for RSA private keys");
}
- } catch (PKCS11Exception e) {
- throw new InvalidKeySpecException
- ("Could not create RSA private key", e);
- } catch (InvalidKeyException e) {
+ } catch (PKCS11Exception | InvalidKeyException e) {
throw new InvalidKeySpecException
("Could not create RSA private key", e);
}
@@ -260,8 +254,8 @@
}
}
- KeySpec implGetPublicKeySpec(P11Key key, Class keySpec, Session[] session)
- throws PKCS11Exception, InvalidKeySpecException {
+ <T extends KeySpec> T implGetPublicKeySpec(P11Key key, Class<T> keySpec,
+ Session[] session) throws PKCS11Exception, InvalidKeySpecException {
if (RSAPublicKeySpec.class.isAssignableFrom(keySpec)) {
session[0] = token.getObjSession();
CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] {
@@ -273,15 +267,15 @@
attributes[0].getBigInteger(),
attributes[1].getBigInteger()
);
- return spec;
+ return keySpec.cast(spec);
} else { // X.509 handled in superclass
throw new InvalidKeySpecException("Only RSAPublicKeySpec and "
+ "X509EncodedKeySpec supported for RSA public keys");
}
}
- KeySpec implGetPrivateKeySpec(P11Key key, Class keySpec, Session[] session)
- throws PKCS11Exception, InvalidKeySpecException {
+ <T extends KeySpec> T implGetPrivateKeySpec(P11Key key, Class<T> keySpec,
+ Session[] session) throws PKCS11Exception, InvalidKeySpecException {
if (RSAPrivateCrtKeySpec.class.isAssignableFrom(keySpec)) {
session[0] = token.getObjSession();
CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] {
@@ -305,7 +299,7 @@
attributes[6].getBigInteger(),
attributes[7].getBigInteger()
);
- return spec;
+ return keySpec.cast(spec);
} else if (RSAPrivateKeySpec.class.isAssignableFrom(keySpec)) {
session[0] = token.getObjSession();
CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] {
@@ -317,7 +311,7 @@
attributes[0].getBigInteger(),
attributes[1].getBigInteger()
);
- return spec;
+ return keySpec.cast(spec);
} else { // PKCS#8 handled in superclass
throw new InvalidKeySpecException("Only RSAPrivate(Crt)KeySpec "
+ "and PKCS8EncodedKeySpec supported for RSA private keys");
--- a/jdk/src/share/classes/sun/security/pkcs11/P11SecretKeyFactory.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11SecretKeyFactory.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -319,7 +319,7 @@
}
// see JCE spec
- protected KeySpec engineGetKeySpec(SecretKey key, Class keySpec)
+ protected KeySpec engineGetKeySpec(SecretKey key, Class<?> keySpec)
throws InvalidKeySpecException {
token.ensureValid();
if ((key == null) || (keySpec == null)) {
--- a/jdk/src/share/classes/sun/security/pkcs11/P11Signature.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11Signature.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -396,7 +396,7 @@
ensureInitialized();
switch (type) {
case T_UPDATE:
- buffer[0] = (byte)b;
+ buffer[0] = b;
engineUpdate(buffer, 0, 1);
break;
case T_DIGEST:
--- a/jdk/src/share/classes/sun/security/pkcs11/P11TlsPrfGenerator.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11TlsPrfGenerator.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -98,6 +98,8 @@
// SecretKeySpec does not allow zero length keys, so we define our own class.
private static final SecretKey NULL_KEY = new SecretKey() {
+ private static final long serialVersionUID = -8090049519656411362L;
+
public byte[] getEncoded() {
return new byte[0];
}
--- a/jdk/src/share/classes/sun/security/pkcs11/P11Util.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11Util.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -88,7 +88,7 @@
p = Security.getProvider(providerName);
if (p == null) {
try {
- Class clazz = Class.forName(className);
+ Class<?> clazz = Class.forName(className);
p = (Provider)clazz.newInstance();
} catch (Exception e) {
throw new ProviderException
--- a/jdk/src/share/classes/sun/security/pkcs11/Secmod.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs11/Secmod.java Wed Jul 05 17:49:56 2017 +0200
@@ -236,6 +236,7 @@
throw new IllegalStateException(e);
}
if (modules == null) {
+ @SuppressWarnings("unchecked")
List<Module> modules = (List<Module>)nssGetModuleList(nssHandle,
nssLibDir);
this.modules = Collections.unmodifiableList(modules);
--- a/jdk/src/share/classes/sun/security/pkcs11/Session.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs11/Session.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -87,7 +87,7 @@
}
long id() {
- if (token.isPresent(this) == false) {
+ if (token.isPresent(this.id) == false) {
throw new ProviderException("Token has been removed");
}
lastAccess = System.currentTimeMillis();
@@ -167,7 +167,9 @@
void dispose() {
refList.remove(this);
try {
- token.p11.C_CloseSession(id);
+ if (token.isPresent(id)) {
+ token.p11.C_CloseSession(id);
+ }
} catch (PKCS11Exception e1) {
// ignore
} catch (ProviderException e2) {
--- a/jdk/src/share/classes/sun/security/pkcs11/Token.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs11/Token.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -217,7 +217,7 @@
// return whether a token is present (i.e. token not removed)
// returns cached value if current, otherwise performs new check
- boolean isPresent(Session session) {
+ boolean isPresent(long sessionID) {
if (removable == false) {
return true;
}
@@ -238,7 +238,7 @@
// the token should return an error
CK_SESSION_INFO sessInfo =
provider.p11.C_GetSessionInfo
- (session.idInternal());
+ (sessionID);
ok = true;
}
} catch (PKCS11Exception e) {
--- a/jdk/src/share/classes/sun/security/pkcs11/wrapper/Functions.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs11/wrapper/Functions.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 2002 Graz University of Technology. All rights reserved.
@@ -517,7 +517,7 @@
if (array != null) {
for (int i = 0; (i < 4) && (i < array.length); i++) {
- hash ^= ((int) (0xFF & array[i])) << ((i%4) << 3);
+ hash ^= (0xFF & array[i]) << ((i%4) << 3);
}
}
@@ -537,7 +537,7 @@
if (array != null) {
for (int i = 0; (i < 4) && (i < array.length); i++) {
- hash ^= ((int) (0xFFFF & array[i])) << ((i%2) << 4);
+ hash ^= (0xFFFF & array[i]) << ((i%2) << 4);
}
}
@@ -557,18 +557,18 @@
if (date != null) {
if (date.year.length == 4) {
- hash ^= ((int) (0xFFFF & date.year[0])) << 16;
- hash ^= (int) (0xFFFF & date.year[1]);
- hash ^= ((int) (0xFFFF & date.year[2])) << 16;
- hash ^= (int) (0xFFFF & date.year[3]);
+ hash ^= (0xFFFF & date.year[0]) << 16;
+ hash ^= 0xFFFF & date.year[1];
+ hash ^= (0xFFFF & date.year[2]) << 16;
+ hash ^= 0xFFFF & date.year[3];
}
if (date.month.length == 2) {
- hash ^= ((int) (0xFFFF & date.month[0])) << 16;
- hash ^= (int) (0xFFFF & date.month[1]);
+ hash ^= (0xFFFF & date.month[0]) << 16;
+ hash ^= 0xFFFF & date.month[1];
}
if (date.day.length == 2) {
- hash ^= ((int) (0xFFFF & date.day[0])) << 16;
- hash ^= (int) (0xFFFF & date.day[1]);
+ hash ^= (0xFFFF & date.day[0]) << 16;
+ hash ^= 0xFFFF & date.day[1];
}
}
--- a/jdk/src/share/classes/sun/security/pkcs11/wrapper/PKCS11Exception.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs11/wrapper/PKCS11Exception.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 2002 Graz University of Technology. All rights reserved.
@@ -63,6 +63,7 @@
* @invariants
*/
public class PKCS11Exception extends Exception {
+ private static final long serialVersionUID = 4877072363729195L;
/**
* The code of the error which was the reason for this exception.
--- a/jdk/src/share/classes/sun/security/pkcs11/wrapper/PKCS11RuntimeException.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs11/wrapper/PKCS11RuntimeException.java Wed Jul 05 17:49:56 2017 +0200
@@ -57,6 +57,7 @@
* @invariants
*/
public class PKCS11RuntimeException extends RuntimeException {
+ private static final long serialVersionUID = 7889842162743590564L;
/**
* Empty constructor.
--- a/jdk/src/share/classes/sun/security/pkcs12/PKCS12KeyStore.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs12/PKCS12KeyStore.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -41,13 +41,10 @@
import java.security.cert.CertificateException;
import java.security.spec.PKCS8EncodedKeySpec;
import java.util.*;
-import java.math.*;
import java.security.AlgorithmParameters;
-import java.security.spec.AlgorithmParameterSpec;
import javax.crypto.spec.PBEParameterSpec;
import javax.crypto.spec.PBEKeySpec;
-import javax.crypto.spec.SecretKeySpec;
import javax.crypto.SecretKeyFactory;
import javax.crypto.SecretKey;
import javax.crypto.Cipher;
@@ -222,7 +219,7 @@
public Key engineGetKey(String alias, char[] password)
throws NoSuchAlgorithmException, UnrecoverableKeyException
{
- KeyEntry entry = entries.get(alias.toLowerCase());
+ KeyEntry entry = entries.get(alias.toLowerCase(Locale.ENGLISH));
Key key = null;
if (entry == null) {
@@ -299,7 +296,7 @@
* <i>key entry</i> without a certificate chain).
*/
public Certificate[] engineGetCertificateChain(String alias) {
- KeyEntry entry = entries.get(alias.toLowerCase());
+ KeyEntry entry = entries.get(alias.toLowerCase(Locale.ENGLISH));
if (entry != null) {
if (entry.chain == null) {
return null;
@@ -327,7 +324,7 @@
* does not contain a certificate.
*/
public Certificate engineGetCertificate(String alias) {
- KeyEntry entry = entries.get(alias.toLowerCase());
+ KeyEntry entry = entries.get(alias.toLowerCase(Locale.ENGLISH));
if (entry != null) {
if (entry.chain == null) {
return null;
@@ -348,7 +345,7 @@
* not exist
*/
public Date engineGetCreationDate(String alias) {
- KeyEntry entry = entries.get(alias.toLowerCase());
+ KeyEntry entry = entries.get(alias.toLowerCase(Locale.ENGLISH));
if (entry != null) {
return new Date(entry.date.getTime());
} else {
@@ -412,15 +409,13 @@
// set the keyId to current date
entry.keyId = ("Time " + (entry.date).getTime()).getBytes("UTF8");
// set the alias
- entry.alias = alias.toLowerCase();
+ entry.alias = alias.toLowerCase(Locale.ENGLISH);
// add the entry
- entries.put(alias.toLowerCase(), entry);
+ entries.put(alias.toLowerCase(Locale.ENGLISH), entry);
} catch (Exception nsae) {
- KeyStoreException ke = new KeyStoreException("Key protection " +
- " algorithm not found: " + nsae);
- ke.initCause(nsae);
- throw ke;
+ throw new KeyStoreException("Key protection " +
+ " algorithm not found: " + nsae, nsae);
}
}
@@ -456,10 +451,8 @@
try {
new EncryptedPrivateKeyInfo(key);
} catch (IOException ioe) {
- KeyStoreException ke = new KeyStoreException("Private key is not"
- + " stored as PKCS#8 EncryptedPrivateKeyInfo: " + ioe);
- ke.initCause(ioe);
- throw ke;
+ throw new KeyStoreException("Private key is not stored"
+ + " as PKCS#8 EncryptedPrivateKeyInfo: " + ioe, ioe);
}
KeyEntry entry = new KeyEntry();
@@ -472,7 +465,7 @@
// Won't happen
}
// set the alias
- entry.alias = alias.toLowerCase();
+ entry.alias = alias.toLowerCase(Locale.ENGLISH);
entry.protectedPrivKey = key.clone();
if (chain != null) {
@@ -480,7 +473,7 @@
}
// add the entry
- entries.put(alias.toLowerCase(), entry);
+ entries.put(alias.toLowerCase(Locale.ENGLISH), entry);
}
@@ -513,11 +506,8 @@
algParams = AlgorithmParameters.getInstance(algorithm);
algParams.init(paramSpec);
} catch (Exception e) {
- IOException ioe =
- new IOException("getAlgorithmParameters failed: " +
- e.getMessage());
- ioe.initCause(e);
- throw ioe;
+ throw new IOException("getAlgorithmParameters failed: " +
+ e.getMessage(), e);
}
return algParams;
}
@@ -544,11 +534,8 @@
algParams.init(params.toByteArray());
}
} catch (Exception e) {
- IOException ioe =
- new IOException("parseAlgParameters failed: " +
- e.getMessage());
- ioe.initCause(e);
- throw ioe;
+ throw new IOException("parseAlgParameters failed: " +
+ e.getMessage(), e);
}
return algParams;
}
@@ -565,10 +552,8 @@
SecretKeyFactory skFac = SecretKeyFactory.getInstance("PBE");
skey = skFac.generateSecret(keySpec);
} catch (Exception e) {
- IOException ioe = new IOException("getSecretKey failed: " +
- e.getMessage());
- ioe.initCause(e);
- throw ioe;
+ throw new IOException("getSecretKey failed: " +
+ e.getMessage(), e);
}
return skey;
}
@@ -633,7 +618,7 @@
public synchronized void engineSetCertificateEntry(String alias,
Certificate cert) throws KeyStoreException
{
- KeyEntry entry = entries.get(alias.toLowerCase());
+ KeyEntry entry = entries.get(alias.toLowerCase(Locale.ENGLISH));
if (entry != null) {
throw new KeyStoreException("Cannot overwrite own certificate");
} else
@@ -650,7 +635,7 @@
public synchronized void engineDeleteEntry(String alias)
throws KeyStoreException
{
- entries.remove(alias.toLowerCase());
+ entries.remove(alias.toLowerCase(Locale.ENGLISH));
}
/**
@@ -670,7 +655,7 @@
* @return true if the alias exists, false otherwise
*/
public boolean engineContainsAlias(String alias) {
- return entries.containsKey(alias.toLowerCase());
+ return entries.containsKey(alias.toLowerCase(Locale.ENGLISH));
}
/**
@@ -690,7 +675,7 @@
* <i>key entry</i>, false otherwise.
*/
public boolean engineIsKeyEntry(String alias) {
- KeyEntry entry = entries.get(alias.toLowerCase());
+ KeyEntry entry = entries.get(alias.toLowerCase(Locale.ENGLISH));
if (entry != null) {
return true;
} else {
@@ -826,9 +811,7 @@
md.update(data);
digest = md.digest();
} catch (Exception e) {
- IOException ioe = new IOException("generateHash failed: " + e);
- ioe.initCause(e);
- throw ioe;
+ throw new IOException("generateHash failed: " + e, e);
}
return digest;
}
@@ -866,9 +849,7 @@
bytes.write(macData.getEncoded());
mData = bytes.toByteArray();
} catch (Exception e) {
- IOException ioe = new IOException("calculateMac failed: " + e);
- ioe.initCause(e);
- throw ioe;
+ throw new IOException("calculateMac failed: " + e, e);
}
return mData;
}
@@ -1149,10 +1130,8 @@
encryptedData = cipher.doFinal(data);
} catch (Exception e) {
- IOException ioe = new IOException("Failed to encrypt" +
- " safe contents entry: " + e);
- ioe.initCause(e);
- throw ioe;
+ throw new IOException("Failed to encrypt" +
+ " safe contents entry: " + e, e);
}
// create EncryptedContentInfo
@@ -1220,7 +1199,7 @@
ContentInfo authSafe = new ContentInfo(s);
ObjectIdentifier contentType = authSafe.getContentType();
- if (contentType.equals(ContentInfo.DATA_OID)) {
+ if (contentType.equals((Object)ContentInfo.DATA_OID)) {
authSafeData = authSafe.getData();
} else /* signed data */ {
throw new IOException("public key protected PKCS12 not supported");
@@ -1246,7 +1225,7 @@
safeContents = new ContentInfo(sci);
contentType = safeContents.getContentType();
safeContentsData = null;
- if (contentType.equals(ContentInfo.DATA_OID)) {
+ if (contentType.equals((Object)ContentInfo.DATA_OID)) {
safeContentsData = safeContents.getData();
} else if (contentType.equals(ContentInfo.ENCRYPTED_DATA_OID)) {
if (password == null) {
@@ -1280,10 +1259,8 @@
safeContentsData = cipher.doFinal(safeContentsData);
} catch (Exception e) {
- IOException ioe = new IOException("failed to decrypt safe"
- + " contents entry: " + e);
- ioe.initCause(e);
- throw ioe;
+ throw new IOException("failed to decrypt safe"
+ + " contents entry: " + e, e);
}
} else {
throw new IOException("public key protected PKCS12" +
@@ -1297,7 +1274,8 @@
if (password != null && s.available() > 0) {
MacData macData = new MacData(s);
try {
- String algName = macData.getDigestAlgName().toUpperCase();
+ String algName =
+ macData.getDigestAlgName().toUpperCase(Locale.ENGLISH);
if (algName.equals("SHA") ||
algName.equals("SHA1") ||
algName.equals("SHA-1")) {
@@ -1319,10 +1297,7 @@
" integrity checking");
}
} catch (Exception e) {
- IOException ioe =
- new IOException("Integrity check failed: " + e);
- ioe.initCause(e);
- throw ioe;
+ throw new IOException("Integrity check failed: " + e, e);
}
}
@@ -1402,12 +1377,12 @@
+ bagValue.tag);
}
bagValue = bagValue.data.getDerValue();
- if (bagId.equals(PKCS8ShroudedKeyBag_OID)) {
+ if (bagId.equals((Object)PKCS8ShroudedKeyBag_OID)) {
KeyEntry kEntry = new KeyEntry();
kEntry.protectedPrivKey = bagValue.toByteArray();
bagItem = kEntry;
privateKeyCount++;
- } else if (bagId.equals(CertBag_OID)) {
+ } else if (bagId.equals((Object)CertBag_OID)) {
DerInputStream cs = new DerInputStream(bagValue.toByteArray());
DerValue[] certValues = cs.getSequence(2);
ObjectIdentifier certId = certValues[0].getOID();
@@ -1453,9 +1428,9 @@
throw new IOException("Attribute " + attrId +
" should have a value " + e.getMessage());
}
- if (attrId.equals(PKCS9FriendlyName_OID)) {
+ if (attrId.equals((Object)PKCS9FriendlyName_OID)) {
alias = valSet[0].getBMPString();
- } else if (attrId.equals(PKCS9LocalKeyId_OID)) {
+ } else if (attrId.equals((Object)PKCS9LocalKeyId_OID)) {
keyId = valSet[0].getOctetString();
} else {
// log error message for "unknown attr"
@@ -1505,7 +1480,7 @@
if (alias == null)
alias = getUnfriendlyName();
entry.alias = alias;
- entries.put(alias.toLowerCase(), entry);
+ entries.put(alias.toLowerCase(Locale.ENGLISH), entry);
} else if (bagItem instanceof X509Certificate) {
X509Certificate cert = (X509Certificate)bagItem;
// Insert a localKeyID for the corresponding cert
--- a/jdk/src/share/classes/sun/security/provider/DSAKeyFactory.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/provider/DSAKeyFactory.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -25,15 +25,12 @@
package sun.security.provider;
-import java.util.*;
-import java.lang.*;
import java.security.Key;
import java.security.PublicKey;
import java.security.PrivateKey;
import java.security.KeyFactorySpi;
import java.security.InvalidKeyException;
import java.security.AccessController;
-import java.security.PrivilegedAction;
import java.security.interfaces.DSAParams;
import java.security.spec.DSAPublicKeySpec;
import java.security.spec.DSAPrivateKeySpec;
@@ -194,13 +191,13 @@
java.security.interfaces.DSAPublicKey dsaPubKey
= (java.security.interfaces.DSAPublicKey)key;
params = dsaPubKey.getParams();
- return (T) new DSAPublicKeySpec(dsaPubKey.getY(),
- params.getP(),
- params.getQ(),
- params.getG());
+ return keySpec.cast(new DSAPublicKeySpec(dsaPubKey.getY(),
+ params.getP(),
+ params.getQ(),
+ params.getG()));
} else if (x509KeySpec.isAssignableFrom(keySpec)) {
- return (T) new X509EncodedKeySpec(key.getEncoded());
+ return keySpec.cast(new X509EncodedKeySpec(key.getEncoded()));
} else {
throw new InvalidKeySpecException
@@ -219,13 +216,13 @@
java.security.interfaces.DSAPrivateKey dsaPrivKey
= (java.security.interfaces.DSAPrivateKey)key;
params = dsaPrivKey.getParams();
- return (T) new DSAPrivateKeySpec(dsaPrivKey.getX(),
- params.getP(),
- params.getQ(),
- params.getG());
+ return keySpec.cast(new DSAPrivateKeySpec(dsaPrivKey.getX(),
+ params.getP(),
+ params.getQ(),
+ params.getG()));
} else if (pkcs8KeySpec.isAssignableFrom(keySpec)) {
- return (T) new PKCS8EncodedKeySpec(key.getEncoded());
+ return keySpec.cast(new PKCS8EncodedKeySpec(key.getEncoded()));
} else {
throw new InvalidKeySpecException
--- a/jdk/src/share/classes/sun/security/provider/DSAParameters.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/provider/DSAParameters.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -25,7 +25,6 @@
package sun.security.provider;
-import java.util.*;
import java.io.*;
import java.math.BigInteger;
import java.security.AlgorithmParametersSpi;
@@ -103,7 +102,8 @@
Class<?> dsaParamSpec = Class.forName
("java.security.spec.DSAParameterSpec");
if (dsaParamSpec.isAssignableFrom(paramSpec)) {
- return (T)new DSAParameterSpec(this.p, this.q, this.g);
+ return paramSpec.cast(
+ new DSAParameterSpec(this.p, this.q, this.g));
} else {
throw new InvalidParameterSpecException
("Inappropriate parameter Specification");
--- a/jdk/src/share/classes/sun/security/provider/JavaKeyStore.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/provider/JavaKeyStore.java Wed Jul 05 17:49:56 2017 +0200
@@ -54,7 +54,7 @@
// regular JKS
public static final class JKS extends JavaKeyStore {
String convertAlias(String alias) {
- return alias.toLowerCase();
+ return alias.toLowerCase(Locale.ENGLISH);
}
}
--- a/jdk/src/share/classes/sun/security/provider/MD4.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/provider/MD4.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -65,7 +65,9 @@
private final static Provider md4Provider;
static {
- md4Provider = new Provider("MD4Provider", 1.0d, "MD4 MessageDigest") {};
+ md4Provider = new Provider("MD4Provider", 1.0d, "MD4 MessageDigest") {
+ private static final long serialVersionUID = -8850464997518327965L;
+ };
AccessController.doPrivileged(new PrivilegedAction<Void>() {
public Void run() {
md4Provider.put("MessageDigest.MD4", "sun.security.provider.MD4");
--- a/jdk/src/share/classes/sun/security/provider/PolicyFile.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/provider/PolicyFile.java Wed Jul 05 17:49:56 2017 +0200
@@ -26,27 +26,21 @@
package sun.security.provider;
import java.io.*;
-import java.lang.RuntimePermission;
import java.lang.reflect.*;
-import java.lang.ref.*;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URI;
import java.util.*;
import java.util.Enumeration;
-import java.util.Hashtable;
import java.util.List;
import java.util.StringTokenizer;
-import java.util.PropertyPermission;
import java.util.ArrayList;
import java.util.ListIterator;
-import java.util.WeakHashMap;
import java.text.MessageFormat;
import com.sun.security.auth.PrincipalComparator;
import java.security.*;
import java.security.cert.Certificate;
import java.security.cert.X509Certificate;
-import javax.security.auth.PrivateCredentialPermission;
import javax.security.auth.Subject;
import javax.security.auth.x500.X500Principal;
import java.io.FilePermission;
@@ -68,7 +62,6 @@
import sun.misc.JavaSecurityProtectionDomainAccess;
import static sun.misc.JavaSecurityProtectionDomainAccess.ProtectionDomainCache;
import sun.misc.SharedSecrets;
-import sun.security.util.Password;
import sun.security.util.PolicyUtil;
import sun.security.util.PropertyExpander;
import sun.security.util.Debug;
@@ -1006,7 +999,7 @@
* via reflection. Keep list short to not penalize non-JDK-defined
* permissions.
*/
- private static final Permission getKnownInstance(Class claz,
+ private static final Permission getKnownInstance(Class<?> claz,
String name, String actions) {
// XXX shorten list to most popular ones?
if (claz.equals(FilePermission.class)) {
@@ -1346,7 +1339,7 @@
"\tActive Principals: " + accPs);
}
- if (entryPs == null || entryPs.size() == 0) {
+ if (entryPs == null || entryPs.isEmpty()) {
// policy entry has no principals -
// add perms regardless of principals in current ACC
@@ -1547,7 +1540,7 @@
Principal[] pdp,
Permissions perms) {
- if (entryPs == null || entryPs.size() == 0) {
+ if (entryPs == null || entryPs.isEmpty()) {
// No principals in the grant to substitute
if (debug != null) {
debug.println("Ignoring permission "
@@ -1890,7 +1883,7 @@
private boolean replacePrincipals(
List<PolicyParser.PrincipalEntry> principals, KeyStore keystore) {
- if (principals == null || principals.size() == 0 || keystore == null)
+ if (principals == null || principals.isEmpty() || keystore == null)
return true;
ListIterator<PolicyParser.PrincipalEntry> i = principals.listIterator();
@@ -2403,7 +2396,7 @@
final List<PolicyEntry> identityPolicyEntries;
// Maps aliases to certs
- final Map aliasMapping;
+ final Map<Object, Object> aliasMapping;
// Maps ProtectionDomain to PermissionCollection
private final ProtectionDomainCache[] pdMapping;
@@ -2413,7 +2406,8 @@
policyEntries = new ArrayList<PolicyEntry>();
identityPolicyEntries =
Collections.synchronizedList(new ArrayList<PolicyEntry>(2));
- aliasMapping = Collections.synchronizedMap(new HashMap(11));
+ aliasMapping = Collections.synchronizedMap(
+ new HashMap<Object, Object>(11));
pdMapping = new ProtectionDomainCache[numCaches];
JavaSecurityProtectionDomainAccess jspda
--- a/jdk/src/share/classes/sun/security/provider/certpath/AdaptableX509CertSelector.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/provider/certpath/AdaptableX509CertSelector.java Wed Jul 05 17:49:56 2017 +0200
@@ -101,7 +101,8 @@
void parseAuthorityKeyIdentifierExtension(
AuthorityKeyIdentifierExtension akidext) throws IOException {
if (akidext != null) {
- KeyIdentifier akid = (KeyIdentifier)akidext.get(akidext.KEY_ID);
+ KeyIdentifier akid = (KeyIdentifier)akidext.get(
+ AuthorityKeyIdentifierExtension.KEY_ID);
if (akid != null) {
// Do not override the previous setting for initial selection.
if (isSKIDSensitive || getSubjectKeyIdentifier() == null) {
@@ -113,8 +114,8 @@
}
}
- SerialNumber asn =
- (SerialNumber)akidext.get(akidext.SERIAL_NUMBER);
+ SerialNumber asn = (SerialNumber)akidext.get(
+ AuthorityKeyIdentifierExtension.SERIAL_NUMBER);
if (asn != null) {
// Do not override the previous setting for initial selection.
if (isSNSensitive || getSerialNumber() == null) {
--- a/jdk/src/share/classes/sun/security/provider/certpath/Builder.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/provider/certpath/Builder.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -153,6 +153,7 @@
if (debug != null) {
debug.println("Builder.distance(): Names are different types");
}
+ return incomparable;
case GeneralNameInterface.NAME_SAME_TYPE:
if (debug != null) {
debug.println("Builder.distance(): Names are same type but " +
@@ -306,8 +307,8 @@
SubjectAlternativeNameExtension altNameExt =
certImpl.getSubjectAlternativeNameExtension();
if (altNameExt != null) {
- GeneralNames altNames =
- (GeneralNames)altNameExt.get(altNameExt.SUBJECT_NAME);
+ GeneralNames altNames = altNameExt.get(
+ SubjectAlternativeNameExtension.SUBJECT_NAME);
/* see if any alternative name matches target */
if (altNames != null) {
for (int j = 0, n = altNames.size(); j < n; j++) {
@@ -343,10 +344,10 @@
+ String.valueOf(constraints));
}
/* reduce permitted by excluded */
- GeneralSubtrees permitted = (GeneralSubtrees)
- constraints.get(constraints.PERMITTED_SUBTREES);
- GeneralSubtrees excluded = (GeneralSubtrees)
- constraints.get(constraints.EXCLUDED_SUBTREES);
+ GeneralSubtrees permitted =
+ constraints.get(NameConstraintsExtension.PERMITTED_SUBTREES);
+ GeneralSubtrees excluded =
+ constraints.get(NameConstraintsExtension.EXCLUDED_SUBTREES);
if (permitted != null) {
permitted.reduce(excluded);
}
--- a/jdk/src/share/classes/sun/security/provider/certpath/CrlRevocationChecker.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/provider/certpath/CrlRevocationChecker.java Wed Jul 05 17:49:56 2017 +0200
@@ -41,7 +41,6 @@
import java.security.cert.*;
import java.security.cert.CertPathValidatorException.BasicReason;
import java.security.interfaces.DSAPublicKey;
-import javax.security.auth.x500.X500Principal;
import sun.security.util.Debug;
import sun.security.x509.AccessDescription;
import sun.security.x509.AuthorityInfoAccessExtension;
@@ -758,8 +757,7 @@
null, null);
points = Collections.singletonList(point);
} else {
- points = (List<DistributionPoint>)ext.get(
- CRLDistributionPointsExtension.POINTS);
+ points = ext.get(CRLDistributionPointsExtension.POINTS);
}
Set<X509CRL> results = new HashSet<X509CRL>();
DistributionPointFetcher dpf =
--- a/jdk/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java Wed Jul 05 17:49:56 2017 +0200
@@ -114,8 +114,8 @@
}
return Collections.emptySet();
}
- List<DistributionPoint> points = (List<DistributionPoint>)ext.get(
- CRLDistributionPointsExtension.POINTS);
+ List<DistributionPoint> points =
+ ext.get(CRLDistributionPointsExtension.POINTS);
Set<X509CRL> results = new HashSet<X509CRL>();
for (Iterator<DistributionPoint> t = points.iterator();
t.hasNext() && !Arrays.equals(reasonsMask, ALL_REASONS); ) {
@@ -570,15 +570,16 @@
AuthorityKeyIdentifierExtension akidext =
crlImpl.getAuthKeyIdExtension();
if (akidext != null) {
- KeyIdentifier akid = (KeyIdentifier)akidext.get(akidext.KEY_ID);
+ KeyIdentifier akid = (KeyIdentifier)akidext.get(
+ AuthorityKeyIdentifierExtension.KEY_ID);
if (akid != null) {
DerOutputStream derout = new DerOutputStream();
derout.putOctetString(akid.getIdentifier());
certSel.setSubjectKeyIdentifier(derout.toByteArray());
}
- SerialNumber asn =
- (SerialNumber)akidext.get(akidext.SERIAL_NUMBER);
+ SerialNumber asn = (SerialNumber)akidext.get(
+ AuthorityKeyIdentifierExtension.SERIAL_NUMBER);
if (asn != null) {
certSel.setSerialNumber(asn.getNumber());
}
--- a/jdk/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java Wed Jul 05 17:49:56 2017 +0200
@@ -30,7 +30,6 @@
import java.security.GeneralSecurityException;
import java.security.InvalidKeyException;
-import java.security.cert.Certificate;
import java.security.cert.CertificateException;
import java.security.cert.CertPathValidatorException;
import java.security.cert.PKIXReason;
@@ -44,22 +43,13 @@
import javax.security.auth.x500.X500Principal;
import sun.security.util.Debug;
-import sun.security.util.DerOutputStream;
import sun.security.x509.AccessDescription;
import sun.security.x509.AuthorityInfoAccessExtension;
import sun.security.x509.PKIXExtensions;
import sun.security.x509.PolicyMappingsExtension;
import sun.security.x509.X500Name;
import sun.security.x509.X509CertImpl;
-import sun.security.x509.X509CRLImpl;
import sun.security.x509.AuthorityKeyIdentifierExtension;
-import sun.security.x509.KeyIdentifier;
-import sun.security.x509.SubjectKeyIdentifierExtension;
-import sun.security.x509.SerialNumber;
-import sun.security.x509.GeneralNames;
-import sun.security.x509.GeneralName;
-import sun.security.x509.GeneralNameInterface;
-import java.math.BigInteger;
/**
* This class represents a forward builder, which is able to retrieve
@@ -362,6 +352,9 @@
* Download Certificates from the given AIA and add them to the
* specified Collection.
*/
+ // cs.getCertificates(caSelector) returns a collection of X509Certificate's
+ // because of the selector, so the cast is safe
+ @SuppressWarnings("unchecked")
private boolean getCerts(AuthorityInfoAccessExtension aiaExt,
Collection<X509Certificate> certs) {
if (Builder.USE_AIA == false) {
--- a/jdk/src/share/classes/sun/security/provider/certpath/ForwardState.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/provider/certpath/ForwardState.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -206,8 +206,8 @@
SubjectAlternativeNameExtension subjAltNameExt
= icert.getSubjectAlternativeNameExtension();
if (subjAltNameExt != null) {
- GeneralNames gNames = (GeneralNames)
- subjAltNameExt.get(SubjectAlternativeNameExtension.SUBJECT_NAME);
+ GeneralNames gNames = subjAltNameExt.get(
+ SubjectAlternativeNameExtension.SUBJECT_NAME);
for (Iterator<GeneralName> t = gNames.iterator();
t.hasNext(); ) {
GeneralNameInterface gName = t.next().getName();
@@ -236,6 +236,7 @@
* because some of them will
* not have their contents modified by subsequent calls to updateState.
*/
+ @SuppressWarnings("unchecked") // Safe casts assuming clone() works correctly
public Object clone() {
try {
ForwardState clonedState = (ForwardState) super.clone();
--- a/jdk/src/share/classes/sun/security/provider/certpath/IndexedCollectionCertStore.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/provider/certpath/IndexedCollectionCertStore.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2006, 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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -185,6 +185,7 @@
list.add((X509Certificate)oldEntry);
certSubjects.put(subject, list);
} else {
+ @SuppressWarnings("unchecked") // See certSubjects javadoc.
List<X509Certificate> list = (List<X509Certificate>)oldEntry;
if (list.contains(cert) == false) {
list.add(cert);
@@ -210,6 +211,8 @@
list.add((X509CRL)oldEntry);
crlIssuers.put(issuer, list);
} else {
+ // See crlIssuers javadoc.
+ @SuppressWarnings("unchecked")
List<X509CRL> list = (List<X509CRL>)oldEntry;
if (list.contains(crl) == false) {
list.add(crl);
@@ -279,6 +282,8 @@
return Collections.<X509Certificate>emptySet();
}
} else {
+ // See certSubjects javadoc.
+ @SuppressWarnings("unchecked")
List<X509Certificate> list = (List<X509Certificate>)entry;
Set<X509Certificate> matches = new HashSet<X509Certificate>(16);
for (X509Certificate cert : list) {
@@ -309,6 +314,8 @@
matches.add(cert);
}
} else {
+ // See certSubjects javadoc.
+ @SuppressWarnings("unchecked")
List<X509Certificate> list = (List<X509Certificate>)obj;
for (X509Certificate cert : list) {
if (selector.match(cert)) {
@@ -370,6 +377,8 @@
matches.add(crl);
}
} else { // List
+ // See crlIssuers javadoc.
+ @SuppressWarnings("unchecked")
List<X509CRL> list = (List<X509CRL>)entry;
for (X509CRL crl : list) {
if (x509Selector.match(crl)) {
@@ -398,6 +407,8 @@
matches.add(crl);
}
} else {
+ // See crlIssuers javadoc.
+ @SuppressWarnings("unchecked")
List<X509CRL> list = (List<X509CRL>)obj;
for (X509CRL crl : list) {
if (selector.match(crl)) {
--- a/jdk/src/share/classes/sun/security/provider/certpath/OCSP.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/provider/certpath/OCSP.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -291,7 +291,7 @@
List<AccessDescription> descriptions = aia.getAccessDescriptions();
for (AccessDescription description : descriptions) {
- if (description.getAccessMethod().equals(
+ if (description.getAccessMethod().equals((Object)
AccessDescription.Ad_OCSP_Id)) {
GeneralName generalName = description.getAccessLocation();
--- a/jdk/src/share/classes/sun/security/provider/certpath/OCSPChecker.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/provider/certpath/OCSPChecker.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -300,7 +300,7 @@
if (filter != null) {
List<CertStore> certStores = pkixParams.getCertStores();
for (CertStore certStore : certStores) {
- Iterator i = null;
+ Iterator<? extends Certificate> i = null;
try {
i = certStore.getCertificates(filter).iterator();
} catch (CertStoreException cse) {
@@ -392,7 +392,7 @@
List<AccessDescription> descriptions = aia.getAccessDescriptions();
for (AccessDescription description : descriptions) {
- if (description.getAccessMethod().equals(
+ if (description.getAccessMethod().equals((Object)
AccessDescription.Ad_OCSP_Id)) {
GeneralName generalName = description.getAccessLocation();
--- a/jdk/src/share/classes/sun/security/provider/certpath/OCSPResponse.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/provider/certpath/OCSPResponse.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -26,7 +26,6 @@
package sun.security.provider.certpath;
import java.io.*;
-import java.math.BigInteger;
import java.security.*;
import java.security.cert.CertificateException;
import java.security.cert.CertificateParsingException;
@@ -206,7 +205,7 @@
// responseType
derIn = tmp.data;
ObjectIdentifier responseType = derIn.getOID();
- if (responseType.equals(OCSP_BASIC_RESPONSE_OID)) {
+ if (responseType.equals((Object)OCSP_BASIC_RESPONSE_OID)) {
if (DEBUG != null) {
DEBUG.println("OCSP response type: basic");
}
@@ -301,7 +300,7 @@
if (DEBUG != null) {
DEBUG.println("OCSP extension: " + responseExtension);
}
- if (responseExtension.getExtensionId().equals(
+ if (responseExtension.getExtensionId().equals((Object)
OCSP_NONCE_EXTENSION_OID)) {
/*
ocspNonce =
--- a/jdk/src/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,7 +25,6 @@
package sun.security.provider.certpath;
-import java.io.IOException;
import java.security.AccessController;
import java.security.InvalidAlgorithmParameterException;
import java.security.cert.CertPath;
@@ -40,13 +39,11 @@
import java.security.cert.PolicyNode;
import java.security.cert.TrustAnchor;
import java.security.cert.X509Certificate;
-import java.security.cert.X509CertSelector;
import java.util.Collections;
import java.util.List;
import java.util.ArrayList;
import java.util.Date;
import java.util.Set;
-import javax.security.auth.x500.X500Principal;
import sun.security.action.GetBooleanSecurityPropertyAction;
import sun.security.util.Debug;
@@ -130,6 +127,9 @@
// Must copy elements of certList into a new modifiable List before
// calling Collections.reverse().
+ // If cp is not an X.509 or X509 certpath, an
+ // InvalidAlgorithmParameterException will have been thrown by now.
+ @SuppressWarnings("unchecked")
ArrayList<X509Certificate> certList = new ArrayList<X509Certificate>
((List<X509Certificate>)cp.getCertificates());
if (debug != null) {
--- a/jdk/src/share/classes/sun/security/provider/certpath/PolicyChecker.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/provider/certpath/PolicyChecker.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -274,8 +274,8 @@
= currCert.getPolicyConstraintsExtension();
if (polConstExt == null)
return explicitPolicy;
- int require = ((Integer)
- polConstExt.get(PolicyConstraintsExtension.REQUIRE)).intValue();
+ int require =
+ polConstExt.get(PolicyConstraintsExtension.REQUIRE).intValue();
if (debug != null) {
debug.println("PolicyChecker.mergeExplicitPolicy() "
+ "require Index from cert = " + require);
@@ -328,8 +328,8 @@
if (polConstExt == null)
return policyMapping;
- int inhibit = ((Integer)
- polConstExt.get(PolicyConstraintsExtension.INHIBIT)).intValue();
+ int inhibit =
+ polConstExt.get(PolicyConstraintsExtension.INHIBIT).intValue();
if (debug != null)
debug.println("PolicyChecker.mergePolicyMapping() "
+ "inhibit Index from cert = " + inhibit);
@@ -376,8 +376,8 @@
if (inhAnyPolExt == null)
return inhibitAnyPolicy;
- int skipCerts = ((Integer)
- inhAnyPolExt.get(InhibitAnyPolicyExtension.SKIP_CERTS)).intValue();
+ int skipCerts =
+ inhAnyPolExt.get(InhibitAnyPolicyExtension.SKIP_CERTS).intValue();
if (debug != null)
debug.println("PolicyChecker.mergeInhibitAnyPolicy() "
+ "skipCerts Index from cert = " + skipCerts);
@@ -448,8 +448,7 @@
+ "policiesCritical = " + policiesCritical);
try {
- policyInfo = (List<PolicyInformation>)
- currCertPolicies.get(CertificatePoliciesExtension.POLICIES);
+ policyInfo = currCertPolicies.get(CertificatePoliciesExtension.POLICIES);
} catch (IOException ioe) {
throw new CertPathValidatorException("Exception while "
+ "retrieving policyOIDs", ioe);
@@ -751,8 +750,7 @@
List<CertificatePolicyMap> maps = null;
try {
- maps = (List<CertificatePolicyMap>)polMappingsExt.get
- (PolicyMappingsExtension.MAP);
+ maps = polMappingsExt.get(PolicyMappingsExtension.MAP);
} catch (IOException e) {
if (debug != null) {
debug.println("PolicyChecker.processPolicyMappings() "
@@ -860,8 +858,7 @@
{
List<PolicyInformation> policyInfo = null;
try {
- policyInfo = (List<PolicyInformation>)
- currCertPolicies.get(CertificatePoliciesExtension.POLICIES);
+ policyInfo = currCertPolicies.get(CertificatePoliciesExtension.POLICIES);
} catch (IOException ioe) {
throw new CertPathValidatorException("Exception while "
+ "retrieving policyOIDs", ioe);
--- a/jdk/src/share/classes/sun/security/provider/certpath/ReverseState.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/provider/certpath/ReverseState.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -365,6 +365,7 @@
* because some of them (e.g., subjKeyId) will
* not have their contents modified by subsequent calls to updateState.
*/
+ @SuppressWarnings("unchecked") // Safe casts assuming clone() works correctly
public Object clone() {
try {
ReverseState clonedState = (ReverseState) super.clone();
--- a/jdk/src/share/classes/sun/security/provider/certpath/URICertStore.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/provider/certpath/URICertStore.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -209,7 +209,8 @@
* object of a certificate's Authority Information Access Extension.
*/
static CertStore getInstance(AccessDescription ad) {
- if (!ad.getAccessMethod().equals(AccessDescription.Ad_CAISSUERS_Id)) {
+ if (!ad.getAccessMethod().equals((Object)
+ AccessDescription.Ad_CAISSUERS_Id)) {
return null;
}
GeneralNameInterface gn = ad.getAccessLocation().getName();
@@ -241,6 +242,7 @@
* match the specified selector
* @throws CertStoreException if an exception occurs
*/
+ @SuppressWarnings("unchecked")
public synchronized Collection<X509Certificate> engineGetCertificates
(CertSelector selector) throws CertStoreException {
@@ -255,6 +257,7 @@
}
// Fetch the certificates via LDAP. LDAPCertStore has its own
// caching mechanism, see the class description for more info.
+ // Safe cast since xsel is an X509 certificate selector.
return (Collection<X509Certificate>)
ldapCertStore.getCertificates(xsel);
}
@@ -300,6 +303,7 @@
if (debug != null) {
debug.println("Downloading new certificates...");
}
+ // Safe cast since factory is an X.509 certificate factory
certs = (Collection<X509Certificate>)
factory.generateCertificates(in);
return getMatchingCerts(certs, selector);
@@ -361,6 +365,7 @@
* match the specified selector
* @throws CertStoreException if an exception occurs
*/
+ @SuppressWarnings("unchecked")
public synchronized Collection<X509CRL> engineGetCRLs(CRLSelector selector)
throws CertStoreException {
@@ -375,6 +380,7 @@
}
// Fetch the CRLs via LDAP. LDAPCertStore has its own
// caching mechanism, see the class description for more info.
+ // Safe cast since xsel is an X509 certificate selector.
return (Collection<X509CRL>) ldapCertStore.getCRLs(xsel);
}
--- a/jdk/src/share/classes/sun/security/provider/certpath/Vertex.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/provider/certpath/Vertex.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -171,7 +171,8 @@
try {
sKeyID = x509Cert.getSubjectKeyIdentifierExtension();
if (sKeyID != null) {
- KeyIdentifier keyID = (KeyIdentifier)sKeyID.get(sKeyID.KEY_ID);
+ KeyIdentifier keyID = sKeyID.get(
+ SubjectKeyIdentifierExtension.KEY_ID);
out = out + "SubjKeyID: " + keyID.toString();
}
} catch (Exception e) {
@@ -184,7 +185,8 @@
try {
aKeyID = x509Cert.getAuthorityKeyIdentifierExtension();
if (aKeyID != null) {
- KeyIdentifier keyID = (KeyIdentifier)aKeyID.get(aKeyID.KEY_ID);
+ KeyIdentifier keyID = (KeyIdentifier)aKeyID.get(
+ AuthorityKeyIdentifierExtension.KEY_ID);
out = out + "AuthKeyID: " + keyID.toString();
}
} catch (Exception e) {
--- a/jdk/src/share/classes/sun/security/provider/certpath/X509CertPath.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/provider/certpath/X509CertPath.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -25,7 +25,6 @@
package sun.security.provider.certpath;
-import java.io.BufferedInputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -101,11 +100,18 @@
* @exception CertificateException if <code>certs</code> contains an element
* that is not an <code>X509Certificate</code>
*/
+ @SuppressWarnings("unchecked")
public X509CertPath(List<? extends Certificate> certs) throws CertificateException {
super("X.509");
// Ensure that the List contains only X509Certificates
- for (Object obj : (List<?>)certs) {
+ //
+ // Note; The certs parameter is not necessarily to be of Certificate
+ // for some old code. For compatibility, to make sure the exception
+ // is CertificateException, rather than ClassCastException, please
+ // don't use
+ // for (Certificate obj : certs)
+ for (Object obj : certs) {
if (obj instanceof X509Certificate == false) {
throw new CertificateException
("List is not all X509Certificates: "
@@ -147,12 +153,15 @@
throws CertificateException {
super("X.509");
- if (PKIPATH_ENCODING.equals(encoding)) {
- certs = parsePKIPATH(is);
- } else if (PKCS7_ENCODING.equals(encoding)) {
- certs = parsePKCS7(is);
- } else {
- throw new CertificateException("unsupported encoding");
+ switch (encoding) {
+ case PKIPATH_ENCODING:
+ certs = parsePKIPATH(is);
+ break;
+ case PKCS7_ENCODING:
+ certs = parsePKCS7(is);
+ break;
+ default:
+ throw new CertificateException("unsupported encoding");
}
}
@@ -192,10 +201,8 @@
return Collections.unmodifiableList(certList);
} catch (IOException ioe) {
- CertificateException ce = new CertificateException("IOException" +
- " parsing PkiPath data: " + ioe);
- ce.initCause(ioe);
- throw ce;
+ throw new CertificateException("IOException parsing PkiPath data: "
+ + ioe, ioe);
}
}
@@ -220,7 +227,7 @@
// Copy the entire input stream into an InputStream that does
// support mark
is = new ByteArrayInputStream(readAllBytes(is));
- };
+ }
PKCS7 pkcs7 = new PKCS7(is);
X509Certificate[] certArray = pkcs7.getCertificates();
@@ -301,10 +308,8 @@
return derout.toByteArray();
} catch (IOException ioe) {
- CertificateEncodingException ce = new CertificateEncodingException
- ("IOException encoding PkiPath data: " + ioe);
- ce.initCause(ioe);
- throw ce;
+ throw new CertificateEncodingException("IOException encoding " +
+ "PkiPath data: " + ioe, ioe);
}
}
@@ -339,12 +344,13 @@
*/
public byte[] getEncoded(String encoding)
throws CertificateEncodingException {
- if (PKIPATH_ENCODING.equals(encoding)) {
- return encodePKIPATH();
- } else if (PKCS7_ENCODING.equals(encoding)) {
- return encodePKCS7();
- } else {
- throw new CertificateEncodingException("unsupported encoding");
+ switch (encoding) {
+ case PKIPATH_ENCODING:
+ return encodePKIPATH();
+ case PKCS7_ENCODING:
+ return encodePKCS7();
+ default:
+ throw new CertificateEncodingException("unsupported encoding");
}
}
--- a/jdk/src/share/classes/sun/security/provider/certpath/ldap/LDAPCertStore.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/provider/certpath/ldap/LDAPCertStore.java Wed Jul 05 17:49:56 2017 +0200
@@ -879,7 +879,8 @@
if (hashCode == 0) {
int result = 17;
result = 37*result + getPort();
- result = 37*result + getServerName().toLowerCase().hashCode();
+ result = 37*result +
+ getServerName().toLowerCase(Locale.ENGLISH).hashCode();
hashCode = result;
}
return hashCode;
--- a/jdk/src/share/classes/sun/security/rsa/RSAKeyFactory.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/rsa/RSAKeyFactory.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -351,12 +351,12 @@
if (key instanceof RSAPublicKey) {
RSAPublicKey rsaKey = (RSAPublicKey)key;
if (rsaPublicKeySpecClass.isAssignableFrom(keySpec)) {
- return (T) new RSAPublicKeySpec(
+ return keySpec.cast(new RSAPublicKeySpec(
rsaKey.getModulus(),
rsaKey.getPublicExponent()
- );
+ ));
} else if (x509KeySpecClass.isAssignableFrom(keySpec)) {
- return (T) new X509EncodedKeySpec(key.getEncoded());
+ return keySpec.cast(new X509EncodedKeySpec(key.getEncoded()));
} else {
throw new InvalidKeySpecException
("KeySpec must be RSAPublicKeySpec or "
@@ -364,11 +364,11 @@
}
} else if (key instanceof RSAPrivateKey) {
if (pkcs8KeySpecClass.isAssignableFrom(keySpec)) {
- return (T) new PKCS8EncodedKeySpec(key.getEncoded());
+ return keySpec.cast(new PKCS8EncodedKeySpec(key.getEncoded()));
} else if (rsaPrivateCrtKeySpecClass.isAssignableFrom(keySpec)) {
if (key instanceof RSAPrivateCrtKey) {
RSAPrivateCrtKey crtKey = (RSAPrivateCrtKey)key;
- return (T) new RSAPrivateCrtKeySpec(
+ return keySpec.cast(new RSAPrivateCrtKeySpec(
crtKey.getModulus(),
crtKey.getPublicExponent(),
crtKey.getPrivateExponent(),
@@ -377,17 +377,17 @@
crtKey.getPrimeExponentP(),
crtKey.getPrimeExponentQ(),
crtKey.getCrtCoefficient()
- );
+ ));
} else {
throw new InvalidKeySpecException
("RSAPrivateCrtKeySpec can only be used with CRT keys");
}
} else if (rsaPrivateKeySpecClass.isAssignableFrom(keySpec)) {
RSAPrivateKey rsaKey = (RSAPrivateKey)key;
- return (T) new RSAPrivateKeySpec(
+ return keySpec.cast(new RSAPrivateKeySpec(
rsaKey.getModulus(),
rsaKey.getPrivateExponent()
- );
+ ));
} else {
throw new InvalidKeySpecException
("KeySpec must be RSAPrivate(Crt)KeySpec or "
--- a/jdk/src/share/classes/sun/security/rsa/RSASignature.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/rsa/RSASignature.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -27,7 +27,6 @@
import java.io.IOException;
import java.nio.ByteBuffer;
-import java.math.BigInteger;
import java.util.Arrays;
import java.security.*;
@@ -202,8 +201,6 @@
// return false rather than propagating the exception for
// compatibility/ease of use
return false;
- } catch (GeneralSecurityException e) {
- throw new SignatureException("Signature verification failed", e);
} catch (IOException e) {
throw new SignatureException("Signature encoding error", e);
}
@@ -235,7 +232,7 @@
throw new IOException("SEQUENCE length error");
}
AlgorithmId algId = AlgorithmId.parse(values[0]);
- if (algId.getOID().equals(oid) == false) {
+ if (algId.getOID().equals((Object)oid) == false) {
throw new IOException("ObjectIdentifier mismatch: "
+ algId.getOID());
}
--- a/jdk/src/share/classes/sun/security/ssl/CipherSuite.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/ssl/CipherSuite.java Wed Jul 05 17:49:56 2017 +0200
@@ -65,7 +65,7 @@
* unavailable or disabled at compile time
*
*/
-final class CipherSuite implements Comparable {
+final class CipherSuite implements Comparable<CipherSuite> {
// minimum priority for supported CipherSuites
final static int SUPPORTED_SUITES_PRIORITY = 1;
@@ -202,8 +202,8 @@
* Note that for unsupported CipherSuites parsed from a handshake
* message we violate the equals() contract.
*/
- public int compareTo(Object o) {
- return ((CipherSuite)o).priority - priority;
+ public int compareTo(CipherSuite o) {
+ return o.priority - priority;
}
/**
--- a/jdk/src/share/classes/sun/security/ssl/HandshakeMessage.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/ssl/HandshakeMessage.java Wed Jul 05 17:49:56 2017 +0200
@@ -811,13 +811,16 @@
sig = JsseJce.getSignature(
preferableSignatureAlgorithm.getAlgorithmName());
} else {
- if (algorithm.equals("DSA")) {
- sig = JsseJce.getSignature(JsseJce.SIGNATURE_DSA);
- } else if (algorithm.equals("RSA")) {
- sig = RSASignature.getInstance();
- } else {
- throw new SSLKeyException("neither an RSA or a DSA key");
- }
+ switch (algorithm) {
+ case "DSA":
+ sig = JsseJce.getSignature(JsseJce.SIGNATURE_DSA);
+ break;
+ case "RSA":
+ sig = RSASignature.getInstance();
+ break;
+ default:
+ throw new SSLKeyException("neither an RSA or a DSA key");
+ }
}
sig.initVerify(publicKey);
@@ -1097,13 +1100,14 @@
private static Signature getSignature(String keyAlgorithm)
throws NoSuchAlgorithmException {
- if (keyAlgorithm.equals("EC")) {
- return JsseJce.getSignature(JsseJce.SIGNATURE_ECDSA);
- } else if (keyAlgorithm.equals("RSA")) {
- return RSASignature.getInstance();
- } else {
- throw new NoSuchAlgorithmException("neither an RSA or a EC key");
- }
+ switch (keyAlgorithm) {
+ case "EC":
+ return JsseJce.getSignature(JsseJce.SIGNATURE_ECDSA);
+ case "RSA":
+ return RSASignature.getInstance();
+ default:
+ throw new NoSuchAlgorithmException("neither an RSA or a EC key");
+ }
}
private void updateSignature(Signature sig, byte clntNonce[],
@@ -1611,16 +1615,17 @@
*/
private static Signature getSignature(ProtocolVersion protocolVersion,
String algorithm) throws GeneralSecurityException {
- if (algorithm.equals("RSA")) {
- return RSASignature.getInternalInstance();
- } else if (algorithm.equals("DSA")) {
- return JsseJce.getSignature(JsseJce.SIGNATURE_RAWDSA);
- } else if (algorithm.equals("EC")) {
- return JsseJce.getSignature(JsseJce.SIGNATURE_RAWECDSA);
- } else {
- throw new SignatureException("Unrecognized algorithm: "
- + algorithm);
- }
+ switch (algorithm) {
+ case "RSA":
+ return RSASignature.getInternalInstance();
+ case "DSA":
+ return JsseJce.getSignature(JsseJce.SIGNATURE_RAWDSA);
+ case "EC":
+ return JsseJce.getSignature(JsseJce.SIGNATURE_RAWECDSA);
+ default:
+ throw new SignatureException("Unrecognized algorithm: "
+ + algorithm);
+ }
}
/*
@@ -1696,7 +1701,7 @@
md.update(temp);
}
- private final static Class delegate;
+ private final static Class<?> delegate;
private final static Field spiField;
static {
@@ -1724,7 +1729,7 @@
// cache Method objects per Spi class
// Note that this will prevent the Spi classes from being GC'd. We assume
// that is not a problem.
- private final static Map<Class,Object> methodCache =
+ private final static Map<Class<?>,Object> methodCache =
new ConcurrentHashMap<>();
private static void digestKey(MessageDigest md, SecretKey key) {
--- a/jdk/src/share/classes/sun/security/ssl/Handshaker.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/ssl/Handshaker.java Wed Jul 05 17:49:56 2017 +0200
@@ -154,7 +154,7 @@
* Data is protected by the SSLEngine.this lock.
*/
private volatile boolean taskDelegated = false;
- private volatile DelegatedTask delegatedTask = null;
+ private volatile DelegatedTask<?> delegatedTask = null;
private volatile Exception thrown = null;
// Could probably use a java.util.concurrent.atomic.AtomicReference
@@ -1316,7 +1316,7 @@
thrown = null;
}
- DelegatedTask getTask() {
+ DelegatedTask<?> getTask() {
if (!taskDelegated) {
taskDelegated = true;
return delegatedTask;
@@ -1358,8 +1358,7 @@
thrown = null;
if (e instanceof RuntimeException) {
- throw (RuntimeException)
- new RuntimeException(msg).initCause(e);
+ throw new RuntimeException(msg, e);
} else if (e instanceof SSLHandshakeException) {
throw (SSLHandshakeException)
new SSLHandshakeException(msg).initCause(e);
@@ -1377,8 +1376,7 @@
* If it's SSLException or any other Exception,
* we'll wrap it in an SSLException.
*/
- throw (SSLException)
- new SSLException(msg).initCause(e);
+ throw new SSLException(msg, e);
}
}
}
--- a/jdk/src/share/classes/sun/security/ssl/JsseJce.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/ssl/JsseJce.java Wed Jul 05 17:49:56 2017 +0200
@@ -30,7 +30,6 @@
import java.security.*;
import java.security.interfaces.RSAPublicKey;
-import java.security.spec.RSAPublicKeySpec;
import java.security.spec.*;
import javax.crypto.*;
@@ -110,6 +109,8 @@
}
private static final class SunCertificates extends Provider {
+ private static final long serialVersionUID = -3284138292032213752L;
+
SunCertificates(final Provider p) {
super("SunCertificates", 1.0d, "SunJSSE internal");
AccessController.doPrivileged(new PrivilegedAction<Object>() {
@@ -372,7 +373,7 @@
KeyFactory factory = JsseJce.getKeyFactory("RSA");
return factory.getKeySpec(key, RSAPublicKeySpec.class);
} catch (Exception e) {
- throw (RuntimeException)new RuntimeException().initCause(e);
+ throw new RuntimeException(e);
}
}
--- a/jdk/src/share/classes/sun/security/ssl/SSLEngineImpl.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/ssl/SSLEngineImpl.java Wed Jul 05 17:49:56 2017 +0200
@@ -27,8 +27,6 @@
import java.io.*;
import java.nio.*;
-import java.nio.ReadOnlyBufferException;
-import java.util.LinkedList;
import java.security.*;
import javax.crypto.BadPaddingException;
@@ -36,7 +34,6 @@
import javax.net.ssl.*;
import javax.net.ssl.SSLEngineResult.*;
-import com.sun.net.ssl.internal.ssl.X509ExtendedTrustManager;
/**
* Implementation of an non-blocking SSLEngine.
@@ -574,8 +571,7 @@
readMAC = handshaker.newReadMAC();
} catch (GeneralSecurityException e) {
// "can't happen"
- throw (SSLException)new SSLException
- ("Algorithm missing: ").initCause(e);
+ throw new SSLException("Algorithm missing: ", e);
}
/*
@@ -611,8 +607,7 @@
writeMAC = handshaker.newWriteMAC();
} catch (GeneralSecurityException e) {
// "can't happen"
- throw (SSLException)new SSLException
- ("Algorithm missing: ").initCause(e);
+ throw new SSLException("Algorithm missing: ", e);
}
// See comment above.
@@ -877,9 +872,7 @@
} catch (SSLException e) {
throw e;
} catch (IOException e) {
- SSLException ex = new SSLException("readRecord");
- ex.initCause(e);
- throw ex;
+ throw new SSLException("readRecord", e);
}
/*
@@ -1151,7 +1144,7 @@
* For now, force it to be large enough to handle any
* valid SSL/TLS record.
*/
- if (netData.remaining() < outputRecord.maxRecordSize) {
+ if (netData.remaining() < EngineOutputRecord.maxRecordSize) {
return new SSLEngineResult(
Status.BUFFER_OVERFLOW, getHSStatus(null), 0, 0);
}
@@ -1248,9 +1241,7 @@
} catch (SSLException e) {
throw e;
} catch (IOException e) {
- SSLException ex = new SSLException("Write problems");
- ex.initCause(e);
- throw ex;
+ throw new SSLException("Write problems", e);
}
/*
@@ -1624,10 +1615,7 @@
} else if (cause instanceof SSLException) {
throw (SSLException)cause;
} else if (cause instanceof Exception) {
- SSLException ssle = new SSLException(
- "fatal SSLEngine condition");
- ssle.initCause(cause);
- throw ssle;
+ throw new SSLException("fatal SSLEngine condition", cause);
}
}
@@ -1875,6 +1863,7 @@
* client or server mode. Must be called before any SSL
* traffic has started.
*/
+ @SuppressWarnings("fallthrough")
synchronized public void setUseClientMode(boolean flag) {
switch (connectionState) {
--- a/jdk/src/share/classes/sun/security/ssl/SSLSessionContextImpl.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/ssl/SSLSessionContextImpl.java Wed Jul 05 17:49:56 2017 +0200
@@ -33,6 +33,7 @@
import java.util.Hashtable;
import java.util.NoSuchElementException;
import java.util.Vector;
+import java.util.Locale;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSessionContext;
@@ -166,7 +167,8 @@
}
private String getKey(String hostname, int port) {
- return (hostname + ":" + String.valueOf(port)).toLowerCase();
+ return (hostname + ":" +
+ String.valueOf(port)).toLowerCase(Locale.ENGLISH);
}
// cache a SSLSession
--- a/jdk/src/share/classes/sun/security/ssl/SSLSocketImpl.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/ssl/SSLSocketImpl.java Wed Jul 05 17:49:56 2017 +0200
@@ -41,8 +41,6 @@
import javax.net.ssl.*;
-import com.sun.net.ssl.internal.ssl.X509ExtendedTrustManager;
-
/**
* Implementation of an SSL socket. This is a normal connection type
* socket, implementing SSL over some lower level socket, such as TCP.
@@ -1996,8 +1994,7 @@
readMAC = handshaker.newReadMAC();
} catch (GeneralSecurityException e) {
// "can't happen"
- throw (SSLException)new SSLException
- ("Algorithm missing: ").initCause(e);
+ throw new SSLException("Algorithm missing: ", e);
}
/*
@@ -2028,8 +2025,7 @@
writeMAC = handshaker.newWriteMAC();
} catch (GeneralSecurityException e) {
// "can't happen"
- throw (SSLException)new SSLException
- ("Algorithm missing: ").initCause(e);
+ throw new SSLException("Algorithm missing: ", e);
}
// See comment above.
@@ -2217,6 +2213,7 @@
* client or server mode. Must be called before any SSL
* traffic has started.
*/
+ @SuppressWarnings("fallthrough")
synchronized public void setUseClientMode(boolean flag) {
switch (connectionState) {
--- a/jdk/src/share/classes/sun/security/ssl/SunX509KeyManagerImpl.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/ssl/SunX509KeyManagerImpl.java Wed Jul 05 17:49:56 2017 +0200
@@ -84,7 +84,7 @@
*
* Map: String(keyType) -> String[](alias)
*/
- private Map<String,String[]> serverAliasCache;
+ private final Map<String,String[]> serverAliasCache;
/*
* Basic container for credentials implemented as an inner class.
@@ -113,11 +113,13 @@
}
}
- SunX509KeyManagerImpl(KeyStore ks, char[] password) throws KeyStoreException,
+ SunX509KeyManagerImpl(KeyStore ks, char[] password)
+ throws KeyStoreException,
NoSuchAlgorithmException, UnrecoverableKeyException {
credentialsMap = new HashMap<String,X509Credentials>();
- serverAliasCache = new HashMap<String,String[]>();
+ serverAliasCache = Collections.synchronizedMap(
+ new HashMap<String,String[]>());
if (ks == null) {
return;
}
@@ -352,15 +354,17 @@
if (sigType != null) {
if (certs.length > 1) {
// if possible, check the public key in the issuer cert
- if (!sigType.equals(certs[1].getPublicKey().getAlgorithm())) {
+ if (!sigType.equals(
+ certs[1].getPublicKey().getAlgorithm())) {
continue;
}
} else {
// Check the signature algorithm of the certificate itself.
// Look for the "withRSA" in "SHA1withRSA", etc.
String sigAlgName =
- certs[0].getSigAlgName().toUpperCase(Locale.ENGLISH);
- String pattern = "WITH" + sigType.toUpperCase(Locale.ENGLISH);
+ certs[0].getSigAlgName().toUpperCase(Locale.ENGLISH);
+ String pattern = "WITH" +
+ sigType.toUpperCase(Locale.ENGLISH);
if (sigAlgName.contains(pattern) == false) {
continue;
}
@@ -412,5 +416,4 @@
}
return list.toArray(new X500Principal[list.size()]);
}
-
}
--- a/jdk/src/share/classes/sun/security/ssl/X509KeyManagerImpl.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/ssl/X509KeyManagerImpl.java Wed Jul 05 17:49:56 2017 +0200
@@ -91,6 +91,8 @@
// LinkedHashMap with a max size of 10
// see LinkedHashMap JavaDocs
private static class SizedMap<K,V> extends LinkedHashMap<K,V> {
+ private static final long serialVersionUID = -8211222668790986062L;
+
@Override protected boolean removeEldestEntry(Map.Entry<K,V> eldest) {
return size() > 10;
}
@@ -247,7 +249,7 @@
return null;
}
entry = (PrivateKeyEntry)newEntry;
- entryCacheMap.put(alias, new SoftReference(entry));
+ entryCacheMap.put(alias, new SoftReference<PrivateKeyEntry>(entry));
return entry;
} catch (Exception e) {
// ignore
@@ -329,7 +331,7 @@
*/
private String chooseAlias(List<KeyType> keyTypeList, Principal[] issuers,
CheckType checkType, AlgorithmConstraints constraints) {
- if (keyTypeList == null || keyTypeList.size() == 0) {
+ if (keyTypeList == null || keyTypeList.isEmpty()) {
return null;
}
@@ -403,7 +405,7 @@
// ignore
}
}
- if (allResults == null || allResults.size() == 0) {
+ if (allResults == null || allResults.isEmpty()) {
if (useDebug) {
debug.println("KeyMgr: no matching alias found");
}
@@ -523,38 +525,43 @@
if (ku != null) {
String algorithm = cert.getPublicKey().getAlgorithm();
boolean kuSignature = getBit(ku, 0);
- if (algorithm.equals("RSA")) {
- // require either signature bit
- // or if server also allow key encipherment bit
- if (kuSignature == false) {
- if ((this == CLIENT) || (getBit(ku, 2) == false)) {
+ switch (algorithm) {
+ case "RSA":
+ // require either signature bit
+ // or if server also allow key encipherment bit
+ if (kuSignature == false) {
+ if ((this == CLIENT) || (getBit(ku, 2) == false)) {
+ return CheckResult.EXTENSION_MISMATCH;
+ }
+ }
+ break;
+ case "DSA":
+ // require signature bit
+ if (kuSignature == false) {
return CheckResult.EXTENSION_MISMATCH;
}
- }
- } else if (algorithm.equals("DSA")) {
- // require signature bit
- if (kuSignature == false) {
- return CheckResult.EXTENSION_MISMATCH;
- }
- } else if (algorithm.equals("DH")) {
- // require keyagreement bit
- if (getBit(ku, 4) == false) {
- return CheckResult.EXTENSION_MISMATCH;
- }
- } else if (algorithm.equals("EC")) {
- // require signature bit
- if (kuSignature == false) {
- return CheckResult.EXTENSION_MISMATCH;
- }
- // For servers, also require key agreement.
- // This is not totally accurate as the keyAgreement bit
- // is only necessary for static ECDH key exchange and
- // not ephemeral ECDH. We leave it in for now until
- // there are signs that this check causes problems
- // for real world EC certificates.
- if ((this == SERVER) && (getBit(ku, 4) == false)) {
- return CheckResult.EXTENSION_MISMATCH;
- }
+ break;
+ case "DH":
+ // require keyagreement bit
+ if (getBit(ku, 4) == false) {
+ return CheckResult.EXTENSION_MISMATCH;
+ }
+ break;
+ case "EC":
+ // require signature bit
+ if (kuSignature == false) {
+ return CheckResult.EXTENSION_MISMATCH;
+ }
+ // For servers, also require key agreement.
+ // This is not totally accurate as the keyAgreement bit
+ // is only necessary for static ECDH key exchange and
+ // not ephemeral ECDH. We leave it in for now until
+ // there are signs that this check causes problems
+ // for real world EC certificates.
+ if ((this == SERVER) && (getBit(ku, 4) == false)) {
+ return CheckResult.EXTENSION_MISMATCH;
+ }
+ break;
}
}
} catch (CertificateException e) {
--- a/jdk/src/share/classes/sun/security/timestamp/HttpTimestamper.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/timestamp/HttpTimestamper.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -30,12 +30,11 @@
import java.io.IOException;
import java.net.URL;
import java.net.HttpURLConnection;
-import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
import java.util.Set;
-import java.util.Arrays;
import sun.misc.IOUtils;
-import sun.security.pkcs.*;
/**
* A timestamper that communicates with a Timestamping Authority (TSA)
@@ -95,11 +94,12 @@
connection.setConnectTimeout(CONNECT_TIMEOUT);
if (DEBUG) {
- Set headers = connection.getRequestProperties().entrySet();
+ Set<Map.Entry<String, List<String>>> headers =
+ connection.getRequestProperties().entrySet();
System.out.println(connection.getRequestMethod() + " " + tsaUrl +
" HTTP/1.1");
- for (Iterator i = headers.iterator(); i.hasNext(); ) {
- System.out.println(" " + i.next());
+ for (Map.Entry<String, List<String>> entry : headers) {
+ System.out.println(" " + entry);
}
System.out.println();
}
--- a/jdk/src/share/classes/sun/security/timestamp/TSResponse.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/timestamp/TSResponse.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -26,15 +26,8 @@
package sun.security.timestamp;
import java.io.IOException;
-import java.math.BigInteger;
import sun.security.pkcs.PKCS7;
-import sun.security.pkcs.PKCS9Attribute;
-import sun.security.pkcs.PKCS9Attributes;
-import sun.security.pkcs.ParsingException;
-import sun.security.pkcs.SignerInfo;
import sun.security.util.DerValue;
-import sun.security.x509.AlgorithmId;
-import sun.security.x509.X500Name;
/**
* This class provides the response corresponding to a timestamp request,
@@ -376,9 +369,11 @@
}
}
-final static class TimestampException extends IOException {
- TimestampException(String message) {
- super(message);
+ final static class TimestampException extends IOException {
+ private static final long serialVersionUID = -1631631794891940953L;
+
+ TimestampException(String message) {
+ super(message);
+ }
}
}
-}
--- a/jdk/src/share/classes/sun/security/tools/JarSigner.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/tools/JarSigner.java Wed Jul 05 17:49:56 2017 +0200
@@ -1425,6 +1425,7 @@
* lines of attributes plus an empty line. The empty line is included
* in the header.
*/
+ @SuppressWarnings("fallthrough")
private int findHeaderEnd(byte[] bs) {
// Initial state true to deal with empty header
boolean newline = true; // just met a newline
@@ -1739,8 +1740,7 @@
NetscapeCertTypeExtension extn =
new NetscapeCertTypeExtension(encoded);
- Boolean val = (Boolean)extn.get(
- NetscapeCertTypeExtension.OBJECT_SIGNING);
+ Boolean val = extn.get(NetscapeCertTypeExtension.OBJECT_SIGNING);
if (!val) {
if (bad != null) {
bad[2] = true;
@@ -2054,7 +2054,7 @@
ClassLoader appClassLoader = new URLClassLoader(urls);
// attempt to find signer
- Class signerClass = appClassLoader.loadClass(signerClassName);
+ Class<?> signerClass = appClassLoader.loadClass(signerClassName);
// Check that it implements ContentSigner
Object signer = signerClass.newInstance();
@@ -2297,9 +2297,7 @@
tsaUri = new URI(tsaUrl);
}
} catch (URISyntaxException e) {
- IOException ioe = new IOException();
- ioe.initCause(e);
- throw ioe;
+ throw new IOException(e);
}
// Assemble parameters for the signing mechanism
--- a/jdk/src/share/classes/sun/security/tools/KeyStoreUtil.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/tools/KeyStoreUtil.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,6 +25,8 @@
package sun.security.tools;
+import java.util.Locale;
+
/**
* <p> This class provides several utilities to <code>KeyStore</code>.
*
@@ -63,7 +65,7 @@
} else if(storetype.equalsIgnoreCase("Windows-ROOT")) {
return "Windows-ROOT";
} else {
- return storetype.toUpperCase();
+ return storetype.toUpperCase(Locale.ENGLISH);
}
}
}
--- a/jdk/src/share/classes/sun/security/tools/KeyTool.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/tools/KeyTool.java Wed Jul 05 17:49:56 2017 +0200
@@ -1197,7 +1197,7 @@
new CertificateVersion(CertificateVersion.V3));
info.set(X509CertInfo.ALGORITHM_ID,
new CertificateAlgorithmId(
- AlgorithmId.getAlgorithmId(sigAlgName)));
+ AlgorithmId.get(sigAlgName)));
info.set(X509CertInfo.ISSUER, new CertificateIssuerName(issuer));
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
@@ -1227,7 +1227,7 @@
Iterator<PKCS10Attribute> attrs = req.getAttributes().getAttributes().iterator();
while (attrs.hasNext()) {
PKCS10Attribute attr = attrs.next();
- if (attr.getAttributeId().equals(PKCS9Attribute.EXTENSION_REQUEST_OID)) {
+ if (attr.getAttributeId().equals((Object)PKCS9Attribute.EXTENSION_REQUEST_OID)) {
reqex = (CertificateExtensions)attr.getAttributeValue();
}
}
@@ -1266,7 +1266,7 @@
Date firstDate = getStartDate(startDate);
Date lastDate = (Date) firstDate.clone();
- lastDate.setTime(lastDate.getTime() + (long)validity*1000*24*60*60);
+ lastDate.setTime(lastDate.getTime() + validity*1000*24*60*60);
CertificateValidity interval = new CertificateValidity(firstDate,
lastDate);
@@ -2093,8 +2093,9 @@
CRLDistributionPointsExtension ext =
X509CertImpl.toImpl(cert).getCRLDistributionPointsExtension();
if (ext == null) return crls;
- for (DistributionPoint o: (List<DistributionPoint>)
- ext.get(CRLDistributionPointsExtension.POINTS)) {
+ List<DistributionPoint> distPoints =
+ ext.get(CRLDistributionPointsExtension.POINTS);
+ for (DistributionPoint o: distPoints) {
GeneralNames names = o.getFullName();
if (names != null) {
for (GeneralName name: names.names()) {
@@ -2199,7 +2200,7 @@
req.getSubjectName(), pkey.getFormat(), pkey.getAlgorithm());
for (PKCS10Attribute attr: req.getAttributes().getAttributes()) {
ObjectIdentifier oid = attr.getAttributeId();
- if (oid.equals(PKCS9Attribute.EXTENSION_REQUEST_OID)) {
+ if (oid.equals((Object)PKCS9Attribute.EXTENSION_REQUEST_OID)) {
CertificateExtensions exts = (CertificateExtensions)attr.getAttributeValue();
if (exts != null) {
printExtensions(rb.getString("Extension.Request."), exts, out);
@@ -2314,7 +2315,7 @@
}
}
jf.close();
- if (ss.size() == 0) {
+ if (ss.isEmpty()) {
out.println(rb.getString("Not.a.signed.jar.file"));
}
} else if (sslserver != null) {
@@ -3745,7 +3746,7 @@
}
String n = reqex.getNameByOid(findOidForExtName(type));
if (add) {
- Extension e = (Extension)reqex.get(n);
+ Extension e = reqex.get(n);
if (!e.isCritical() && action == 0
|| e.isCritical() && action == 1) {
e = Extension.newExtension(
--- a/jdk/src/share/classes/sun/security/tools/TimestampedSigner.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/tools/TimestampedSigner.java Wed Jul 05 17:49:56 2017 +0200
@@ -275,7 +275,8 @@
URIName uri;
for (int i = 0; i < derValue.length; i++) {
description = new AccessDescription(derValue[i]);
- if (description.getAccessMethod().equals(AD_TIMESTAMPING_Id)) {
+ if (description.getAccessMethod()
+ .equals((Object)AD_TIMESTAMPING_Id)) {
location = description.getAccessLocation();
if (location.getType() == GeneralNameInterface.NAME_URI) {
uri = (URIName) location.getName();
@@ -351,7 +352,7 @@
}
if (!Arrays.equals(tst.getHashedMessage(), digest)) {
throw new IOException("Digest octets changed in timestamp token");
- };
+ }
BigInteger replyNonce = tst.getNonce();
if (replyNonce == null && nonce != null) {
@@ -374,7 +375,7 @@
throw new CertificateException(
"Certificate is not valid for timestamping");
}
- List keyPurposes = cert.getExtendedKeyUsage();
+ List<String> keyPurposes = cert.getExtendedKeyUsage();
if (keyPurposes == null ||
! keyPurposes.contains(KP_TIMESTAMPING_OID)) {
throw new CertificateException(
--- a/jdk/src/share/classes/sun/security/tools/policytool/PolicyTool.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/tools/policytool/PolicyTool.java Wed Jul 05 17:49:56 2017 +0200
@@ -123,7 +123,7 @@
* set the PolicyFileName
*/
void setPolicyFileName(String policyFileName) {
- this.policyFileName = policyFileName;
+ PolicyTool.policyFileName = policyFileName;
}
/**
@@ -605,7 +605,7 @@
if (type.equals(PolicyParser.PrincipalEntry.WILDCARD_CLASS) ||
type.equals(PolicyParser.REPLACE_NAME)) {
return;
- };
+ }
Class<?> PRIN = Class.forName("java.security.Principal");
Class<?> pc = Class.forName(type, true,
Thread.currentThread().getContextClassLoader());
@@ -629,6 +629,7 @@
/**
* Check to see if the Permission contents are OK
*/
+ @SuppressWarnings("fallthrough")
void verifyPermission(String type,
String name,
String actions)
@@ -655,6 +656,7 @@
// proceed to the one-param constructor
objects.add(null);
}
+ /* fall through */
case 1:
try {
c = pc.getConstructor(ONEPARAMS);
@@ -663,6 +665,7 @@
// proceed to the two-param constructor
objects.add(null);
}
+ /* fall through */
case 2:
c = pc.getConstructor(TWOPARAMS);
break;
@@ -1553,16 +1556,15 @@
if (edit) {
// get the selected item
entries = tool.getEntry();
- List policyList = (List)tw.getComponent(tw.MW_POLICY_LIST);
+ List policyList = (List)tw.getComponent(ToolWindow.MW_POLICY_LIST);
listIndex = policyList.getSelectedIndex();
// get principal list
- LinkedList principals =
+ LinkedList<PolicyParser.PrincipalEntry> principals =
entries[listIndex].getGrantEntry().principals;
for (int i = 0; i < principals.size(); i++) {
String prinString = null;
- PolicyParser.PrincipalEntry nextPrin =
- (PolicyParser.PrincipalEntry)principals.get(i);
+ PolicyParser.PrincipalEntry nextPrin = principals.get(i);
prinList.addTaggedItem(PrincipalEntryToUserFriendlyString(nextPrin), nextPrin);
}
@@ -1631,10 +1633,10 @@
label = new Label(PolicyTool.rb.getString("Principals."));
tw.addNewComponent(this, label, PE_PRIN_LABEL,
0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
- tw.BOTTOM_PADDING);
+ ToolWindow.BOTTOM_PADDING);
tw.addNewComponent(this, prinList, PE_PRIN_LIST,
1, 3, 3, 1, 0.0, 0.0, GridBagConstraints.BOTH,
- tw.BOTTOM_PADDING);
+ ToolWindow.BOTTOM_PADDING);
// panel for permission buttons
panel = new Panel();
@@ -1661,12 +1663,12 @@
tw.addNewComponent(this, panel, PE_PANEL1,
0, 4, 2, 1, 0.0, 0.0, GridBagConstraints.HORIZONTAL,
- tw.LITE_BOTTOM_PADDING);
+ ToolWindow.LITE_BOTTOM_PADDING);
// permission list
tw.addNewComponent(this, permList, PE_PERM_LIST,
0, 5, 3, 1, 0.0, 0.0, GridBagConstraints.BOTH,
- tw.BOTTOM_PADDING);
+ ToolWindow.BOTTOM_PADDING);
// panel for Done and Cancel buttons
@@ -1679,14 +1681,14 @@
(new AddEntryDoneButtonListener(tool, tw, this, edit));
tw.addNewComponent(panel, button, PE_DONE_BUTTON,
0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
- tw.LR_PADDING);
+ ToolWindow.LR_PADDING);
// Cancel Button
button = new Button(PolicyTool.rb.getString("Cancel"));
button.addActionListener(new CancelButtonListener(this));
tw.addNewComponent(panel, button, PE_CANCEL_BUTTON,
1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
- tw.LR_PADDING);
+ ToolWindow.LR_PADDING);
// add the panel
tw.addNewComponent(this, panel, PE_PANEL2,
@@ -1760,7 +1762,7 @@
(PolicyTool.rb.getString("KeyStore.URL."));
tw.addNewComponent(this, label, KSD_NAME_LABEL,
0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
- tw.BOTTOM_PADDING);
+ ToolWindow.BOTTOM_PADDING);
TextField tf = new TextField(tool.getKeyStoreName(), 30);
// URL to U R L, so that accessibility reader will pronounce well
@@ -1768,45 +1770,45 @@
PolicyTool.rb.getString("KeyStore.U.R.L."));
tw.addNewComponent(this, tf, KSD_NAME_TEXTFIELD,
1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
- tw.BOTTOM_PADDING);
+ ToolWindow.BOTTOM_PADDING);
// KeyStore type and textfield
label = new Label(PolicyTool.rb.getString("KeyStore.Type."));
tw.addNewComponent(this, label, KSD_TYPE_LABEL,
0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
- tw.BOTTOM_PADDING);
+ ToolWindow.BOTTOM_PADDING);
tf = new TextField(tool.getKeyStoreType(), 30);
tf.getAccessibleContext().setAccessibleName(
PolicyTool.rb.getString("KeyStore.Type."));
tw.addNewComponent(this, tf, KSD_TYPE_TEXTFIELD,
1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
- tw.BOTTOM_PADDING);
+ ToolWindow.BOTTOM_PADDING);
// KeyStore provider and textfield
label = new Label(PolicyTool.rb.getString
("KeyStore.Provider."));
tw.addNewComponent(this, label, KSD_PROVIDER_LABEL,
0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
- tw.BOTTOM_PADDING);
+ ToolWindow.BOTTOM_PADDING);
tf = new TextField(tool.getKeyStoreProvider(), 30);
tf.getAccessibleContext().setAccessibleName(
PolicyTool.rb.getString("KeyStore.Provider."));
tw.addNewComponent(this, tf, KSD_PROVIDER_TEXTFIELD,
1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
- tw.BOTTOM_PADDING);
+ ToolWindow.BOTTOM_PADDING);
// KeyStore password URL and textfield
label = new Label(PolicyTool.rb.getString
("KeyStore.Password.URL."));
tw.addNewComponent(this, label, KSD_PWD_URL_LABEL,
0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
- tw.BOTTOM_PADDING);
+ ToolWindow.BOTTOM_PADDING);
tf = new TextField(tool.getKeyStorePwdURL(), 30);
tf.getAccessibleContext().setAccessibleName(
PolicyTool.rb.getString("KeyStore.Password.U.R.L."));
tw.addNewComponent(this, tf, KSD_PWD_URL_TEXTFIELD,
1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
- tw.BOTTOM_PADDING);
+ ToolWindow.BOTTOM_PADDING);
// OK button
Button okButton = new Button(PolicyTool.rb.getString("OK"));
@@ -1862,7 +1864,7 @@
new Label(PolicyTool.rb.getString(".Add.New.Principal.")));
tw.addNewComponent(newTD, label, PRD_DESC_LABEL,
0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
- tw.TOP_BOTTOM_PADDING);
+ ToolWindow.TOP_BOTTOM_PADDING);
// principal choice
Choice choice = new Choice();
@@ -1888,7 +1890,7 @@
tw.addNewComponent(newTD, choice, PRD_PRIN_CHOICE,
0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
- tw.LR_PADDING);
+ ToolWindow.LR_PADDING);
// principal textfield
TextField tf;
@@ -1898,7 +1900,7 @@
tf.getAccessibleContext().setAccessibleName(PRIN_TYPE);
tw.addNewComponent(newTD, tf, PRD_PRIN_TEXTFIELD,
1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
- tw.LR_PADDING);
+ ToolWindow.LR_PADDING);
// name label and textfield
label = new Label(PRIN_NAME);
@@ -1909,10 +1911,10 @@
tw.addNewComponent(newTD, label, PRD_NAME_LABEL,
0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
- tw.LR_PADDING);
+ ToolWindow.LR_PADDING);
tw.addNewComponent(newTD, tf, PRD_NAME_TEXTFIELD,
1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
- tw.LR_PADDING);
+ ToolWindow.LR_PADDING);
// OK button
Button okButton = new Button(PolicyTool.rb.getString("OK"));
@@ -1921,13 +1923,13 @@
(tool, tw, this, newTD, edit));
tw.addNewComponent(newTD, okButton, PRD_OK_BUTTON,
0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
- tw.TOP_BOTTOM_PADDING);
+ ToolWindow.TOP_BOTTOM_PADDING);
// cancel button
Button cancelButton = new Button(PolicyTool.rb.getString("Cancel"));
cancelButton.addActionListener(new CancelButtonListener(newTD));
tw.addNewComponent(newTD, cancelButton, PRD_CANCEL_BUTTON,
1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
- tw.TOP_BOTTOM_PADDING);
+ ToolWindow.TOP_BOTTOM_PADDING);
newTD.setVisible(true);
}
@@ -1969,7 +1971,7 @@
new Label(PolicyTool.rb.getString(".Add.New.Permission.")));
tw.addNewComponent(newTD, label, PD_DESC_LABEL,
0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
- tw.TOP_BOTTOM_PADDING);
+ ToolWindow.TOP_BOTTOM_PADDING);
// permission choice (added in alphabetical order)
Choice choice = new Choice();
@@ -1982,7 +1984,7 @@
choice.addItemListener(new PermissionMenuListener(newTD));
tw.addNewComponent(newTD, choice, PD_PERM_CHOICE,
0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
- tw.LR_PADDING);
+ ToolWindow.LR_PADDING);
// permission textfield
TextField tf;
@@ -1996,7 +1998,7 @@
}
tw.addNewComponent(newTD, tf, PD_PERM_TEXTFIELD,
1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
- tw.LR_PADDING);
+ ToolWindow.LR_PADDING);
// name label and textfield
choice = new Choice();
@@ -2010,10 +2012,10 @@
}
tw.addNewComponent(newTD, choice, PD_NAME_CHOICE,
0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
- tw.LR_PADDING);
+ ToolWindow.LR_PADDING);
tw.addNewComponent(newTD, tf, PD_NAME_TEXTFIELD,
1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
- tw.LR_PADDING);
+ ToolWindow.LR_PADDING);
// actions label and textfield
choice = new Choice();
@@ -2027,22 +2029,22 @@
}
tw.addNewComponent(newTD, choice, PD_ACTIONS_CHOICE,
0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
- tw.LR_PADDING);
+ ToolWindow.LR_PADDING);
tw.addNewComponent(newTD, tf, PD_ACTIONS_TEXTFIELD,
1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
- tw.LR_PADDING);
+ ToolWindow.LR_PADDING);
// signedby label and textfield
label = new Label(PolicyTool.rb.getString("Signed.By."));
tw.addNewComponent(newTD, label, PD_SIGNEDBY_LABEL,
0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
- tw.LR_PADDING);
+ ToolWindow.LR_PADDING);
tf = (edit ? new TextField(editMe.signedBy, 40) : new TextField(40));
tf.getAccessibleContext().setAccessibleName(
PolicyTool.rb.getString("Signed.By."));
tw.addNewComponent(newTD, tf, PD_SIGNEDBY_TEXTFIELD,
1, 4, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
- tw.LR_PADDING);
+ ToolWindow.LR_PADDING);
// OK button
Button okButton = new Button(PolicyTool.rb.getString("OK"));
@@ -2051,14 +2053,14 @@
(tool, tw, this, newTD, edit));
tw.addNewComponent(newTD, okButton, PD_OK_BUTTON,
0, 5, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
- tw.TOP_BOTTOM_PADDING);
+ ToolWindow.TOP_BOTTOM_PADDING);
// cancel button
Button cancelButton = new Button(PolicyTool.rb.getString("Cancel"));
cancelButton.addActionListener(new CancelButtonListener(newTD));
tw.addNewComponent(newTD, cancelButton, PD_CANCEL_BUTTON,
1, 5, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
- tw.TOP_BOTTOM_PADDING);
+ ToolWindow.TOP_BOTTOM_PADDING);
newTD.setVisible(true);
}
@@ -2205,7 +2207,7 @@
void displayConfirmRemovePolicyEntry() {
// find the entry to be removed
- List list = (List)tw.getComponent(tw.MW_POLICY_LIST);
+ List list = (List)tw.getComponent(ToolWindow.MW_POLICY_LIST);
int index = list.getSelectedIndex();
PolicyEntry entries[] = tool.getEntry();
@@ -2219,7 +2221,7 @@
(PolicyTool.rb.getString("Remove.this.Policy.Entry."));
tw.addNewComponent(this, label, CRPE_LABEL1,
0, 0, 2, 1, 0.0, 0.0, GridBagConstraints.BOTH,
- tw.BOTTOM_PADDING);
+ ToolWindow.BOTTOM_PADDING);
// display the policy entry
label = new Label(entries[index].codebaseToString());
@@ -2237,7 +2239,8 @@
if (i == (perms.size()-1)) {
tw.addNewComponent(this, label, CRPE_LABEL2 + 2 + i,
1, 3 + i, 1, 1, 0.0, 0.0,
- GridBagConstraints.BOTH, tw.BOTTOM_PADDING);
+ GridBagConstraints.BOTH,
+ ToolWindow.BOTTOM_PADDING);
} else {
tw.addNewComponent(this, label, CRPE_LABEL2 + 2 + i,
1, 3 + i, 1, 1, 0.0, 0.0,
@@ -2256,18 +2259,18 @@
(new ConfirmRemovePolicyEntryOKButtonListener(tool, tw, this));
tw.addNewComponent(panel, okButton, CRPE_PANEL_OK,
0, 0, 1, 1, 0.0, 0.0,
- GridBagConstraints.VERTICAL, tw.LR_PADDING);
+ GridBagConstraints.VERTICAL, ToolWindow.LR_PADDING);
// cancel button
Button cancelButton = new Button(PolicyTool.rb.getString("Cancel"));
cancelButton.addActionListener(new CancelButtonListener(this));
tw.addNewComponent(panel, cancelButton, CRPE_PANEL_CANCEL,
1, 0, 1, 1, 0.0, 0.0,
- GridBagConstraints.VERTICAL, tw.LR_PADDING);
+ GridBagConstraints.VERTICAL, ToolWindow.LR_PADDING);
tw.addNewComponent(this, panel, CRPE_LABEL2 + 2 + perms.size(),
0, 3 + perms.size(), 2, 1, 0.0, 0.0,
- GridBagConstraints.VERTICAL, tw.TOP_BOTTOM_PADDING);
+ GridBagConstraints.VERTICAL, ToolWindow.TOP_BOTTOM_PADDING);
pack();
setVisible(true);
@@ -2310,7 +2313,7 @@
// display the new policy filename
TextField newFilename = (TextField)tw.getComponent
- (tw.MW_FILENAME_TEXTFIELD);
+ (ToolWindow.MW_FILENAME_TEXTFIELD);
newFilename.setText(filename);
tw.setVisible(true);
@@ -2346,7 +2349,7 @@
(PolicyTool.rb.getString("Save.changes."));
tw.addNewComponent(this, label, USC_LABEL,
0, 0, 3, 1, 0.0, 0.0, GridBagConstraints.BOTH,
- tw.L_TOP_BOTTOM_PADDING);
+ ToolWindow.L_TOP_BOTTOM_PADDING);
Panel panel = new Panel();
panel.setLayout(new GridBagLayout());
@@ -2357,21 +2360,21 @@
tw.addNewComponent(panel, yesButton, USC_YES_BUTTON,
0, 0, 1, 1, 0.0, 0.0,
GridBagConstraints.VERTICAL,
- tw.LR_BOTTOM_PADDING);
+ ToolWindow.LR_BOTTOM_PADDING);
Button noButton = new Button(PolicyTool.rb.getString("No"));
noButton.addActionListener
(new UserSaveNoButtonListener(this, tool, tw, select));
tw.addNewComponent(panel, noButton, USC_NO_BUTTON,
1, 0, 1, 1, 0.0, 0.0,
GridBagConstraints.VERTICAL,
- tw.LR_BOTTOM_PADDING);
+ ToolWindow.LR_BOTTOM_PADDING);
Button cancelButton = new Button(PolicyTool.rb.getString("Cancel"));
cancelButton.addActionListener
(new UserSaveCancelButtonListener(this));
tw.addNewComponent(panel, cancelButton, USC_CANCEL_BUTTON,
2, 0, 1, 1, 0.0, 0.0,
GridBagConstraints.VERTICAL,
- tw.LR_BOTTOM_PADDING);
+ ToolWindow.LR_BOTTOM_PADDING);
tw.addNewComponent(this, panel, USC_PANEL,
0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH);
@@ -2391,6 +2394,7 @@
* (either QUITting, opening NEW policy file, or OPENing an existing
* policy file. do that now.
*/
+ @SuppressWarnings("fallthrough")
void userSaveContinue(PolicyTool tool, ToolWindow tw,
ToolDialog us, int select) {
@@ -2417,8 +2421,8 @@
tw.replacePolicyList(list);
// display null policy filename and keystore
- TextField newFilename = (TextField)
- tw.getComponent(tw.MW_FILENAME_TEXTFIELD);
+ TextField newFilename = (TextField)tw.getComponent(
+ ToolWindow.MW_FILENAME_TEXTFIELD);
newFilename.setText("");
tw.setVisible(true);
break;
@@ -2459,8 +2463,8 @@
tool.modified = false;
// display the new policy filename
- newFilename = (TextField)
- tw.getComponent(tw.MW_FILENAME_TEXTFIELD);
+ newFilename = (TextField)tw.getComponent(
+ ToolWindow.MW_FILENAME_TEXTFIELD);
newFilename.setText(policyFile);
tw.setVisible(true);
@@ -2479,8 +2483,8 @@
tool.modified = false;
// display a null policy filename
- newFilename = (TextField)
- tw.getComponent(tw.MW_FILENAME_TEXTFIELD);
+ newFilename = (TextField)tw.getComponent(
+ ToolWindow.MW_FILENAME_TEXTFIELD);
newFilename.setText("");
tw.setVisible(true);
@@ -2658,51 +2662,52 @@
public void actionPerformed(ActionEvent e) {
- if (PolicyTool.collator.compare(e.getActionCommand(), tw.QUIT) == 0) {
+ if (PolicyTool.collator.compare(e.getActionCommand(),
+ ToolWindow.QUIT) == 0) {
// ask user if they want to save changes
ToolDialog td = new ToolDialog
(PolicyTool.rb.getString("Save.Changes"), tool, tw, true);
- td.displayUserSave(td.QUIT);
+ td.displayUserSave(ToolDialog.QUIT);
// the above method will perform the QUIT as long as the
// user does not CANCEL the request
} else if (PolicyTool.collator.compare(e.getActionCommand(),
- tw.NEW_POLICY_FILE) == 0) {
+ ToolWindow.NEW_POLICY_FILE) == 0) {
// ask user if they want to save changes
ToolDialog td = new ToolDialog
(PolicyTool.rb.getString("Save.Changes"), tool, tw, true);
- td.displayUserSave(td.NEW);
+ td.displayUserSave(ToolDialog.NEW);
// the above method will perform the NEW as long as the
// user does not CANCEL the request
} else if (PolicyTool.collator.compare(e.getActionCommand(),
- tw.OPEN_POLICY_FILE) == 0) {
+ ToolWindow.OPEN_POLICY_FILE) == 0) {
// ask user if they want to save changes
ToolDialog td = new ToolDialog
(PolicyTool.rb.getString("Save.Changes"), tool, tw, true);
- td.displayUserSave(td.OPEN);
+ td.displayUserSave(ToolDialog.OPEN);
// the above method will perform the OPEN as long as the
// user does not CANCEL the request
} else if (PolicyTool.collator.compare(e.getActionCommand(),
- tw.SAVE_POLICY_FILE) == 0) {
+ ToolWindow.SAVE_POLICY_FILE) == 0) {
// get the previously entered filename
- String filename = ((TextField)
- tw.getComponent(tw.MW_FILENAME_TEXTFIELD)).getText();
+ String filename = ((TextField)tw.getComponent(
+ ToolWindow.MW_FILENAME_TEXTFIELD)).getText();
// if there is no filename, do a SAVE_AS
if (filename == null || filename.length() == 0) {
// user wants to SAVE AS
ToolDialog td = new ToolDialog
(PolicyTool.rb.getString("Save.As"), tool, tw, true);
- td.displaySaveAsDialog(td.NOACTION);
+ td.displaySaveAsDialog(ToolDialog.NOACTION);
} else {
try {
// save the policy entries to a file
@@ -2726,15 +2731,15 @@
}
}
} else if (PolicyTool.collator.compare(e.getActionCommand(),
- tw.SAVE_AS_POLICY_FILE) == 0) {
+ ToolWindow.SAVE_AS_POLICY_FILE) == 0) {
// user wants to SAVE AS
ToolDialog td = new ToolDialog
(PolicyTool.rb.getString("Save.As"), tool, tw, true);
- td.displaySaveAsDialog(td.NOACTION);
+ td.displaySaveAsDialog(ToolDialog.NOACTION);
} else if (PolicyTool.collator.compare(e.getActionCommand(),
- tw.VIEW_WARNINGS) == 0) {
+ ToolWindow.VIEW_WARNINGS) == 0) {
tw.displayWarningLog(null);
}
}
@@ -2756,7 +2761,7 @@
public void actionPerformed(ActionEvent e) {
if (PolicyTool.collator.compare(e.getActionCommand(),
- tw.ADD_POLICY_ENTRY) == 0) {
+ ToolWindow.ADD_POLICY_ENTRY) == 0) {
// display a dialog box for the user to enter policy info
ToolDialog td = new ToolDialog
@@ -2764,10 +2769,10 @@
td.displayPolicyEntryDialog(false);
} else if (PolicyTool.collator.compare(e.getActionCommand(),
- tw.REMOVE_POLICY_ENTRY) == 0) {
+ ToolWindow.REMOVE_POLICY_ENTRY) == 0) {
// get the selected entry
- List list = (List)tw.getComponent(tw.MW_POLICY_LIST);
+ List list = (List)tw.getComponent(ToolWindow.MW_POLICY_LIST);
int index = list.getSelectedIndex();
if (index < 0) {
tw.displayErrorDialog(null, new Exception
@@ -2781,10 +2786,10 @@
td.displayConfirmRemovePolicyEntry();
} else if (PolicyTool.collator.compare(e.getActionCommand(),
- tw.EDIT_POLICY_ENTRY) == 0) {
+ ToolWindow.EDIT_POLICY_ENTRY) == 0) {
// get the selected entry
- List list = (List)tw.getComponent(tw.MW_POLICY_LIST);
+ List list = (List)tw.getComponent(ToolWindow.MW_POLICY_LIST);
int index = list.getSelectedIndex();
if (index < 0) {
tw.displayErrorDialog(null, new Exception
@@ -2798,12 +2803,12 @@
td.displayPolicyEntryDialog(true);
} else if (PolicyTool.collator.compare(e.getActionCommand(),
- tw.EDIT_KEYSTORE) == 0) {
+ ToolWindow.EDIT_KEYSTORE) == 0) {
// display a dialog box for the user to enter keystore info
ToolDialog td = new ToolDialog
(PolicyTool.rb.getString("KeyStore"), tool, tw, true);
- td.keyStoreDialog(td.EDIT_KEYSTORE);
+ td.keyStoreDialog(ToolDialog.EDIT_KEYSTORE);
}
}
}
@@ -2855,7 +2860,7 @@
}
// add the entry
- List policyList = (List)tw.getComponent(tw.MW_POLICY_LIST);
+ List policyList = (List)tw.getComponent(ToolWindow.MW_POLICY_LIST);
if (edit) {
int listIndex = policyList.getSelectedIndex();
tool.addEntry(newEntry, listIndex);
@@ -2896,14 +2901,14 @@
public void actionPerformed(ActionEvent e) {
- String URLString = ((TextField)
- td.getComponent(td.KSD_NAME_TEXTFIELD)).getText().trim();
- String type = ((TextField)
- td.getComponent(td.KSD_TYPE_TEXTFIELD)).getText().trim();
- String provider = ((TextField)
- td.getComponent(td.KSD_PROVIDER_TEXTFIELD)).getText().trim();
- String pwdURL = ((TextField)
- td.getComponent(td.KSD_PWD_URL_TEXTFIELD)).getText().trim();
+ String URLString = ((TextField)td.getComponent(
+ ToolDialog.KSD_NAME_TEXTFIELD)).getText().trim();
+ String type = ((TextField)td.getComponent(
+ ToolDialog.KSD_TYPE_TEXTFIELD)).getText().trim();
+ String provider = ((TextField)td.getComponent(
+ ToolDialog.KSD_PROVIDER_TEXTFIELD)).getText().trim();
+ String pwdURL = ((TextField)td.getComponent(
+ ToolDialog.KSD_PWD_URL_TEXTFIELD)).getText().trim();
try {
tool.openKeyStore
@@ -3018,7 +3023,7 @@
// add the principal to the GUI principal list
TaggedList prinList =
- (TaggedList)listDialog.getComponent(listDialog.PE_PRIN_LIST);
+ (TaggedList)listDialog.getComponent(ToolDialog.PE_PRIN_LIST);
String prinString = ToolDialog.PrincipalEntryToUserFriendlyString(pppe);
if (edit) {
@@ -3079,7 +3084,7 @@
// add the permission to the GUI permission list
TaggedList permList =
- (TaggedList)listDialog.getComponent(listDialog.PE_PERM_LIST);
+ (TaggedList)listDialog.getComponent(ToolDialog.PE_PERM_LIST);
String permString = ToolDialog.PermissionEntryToUserFriendlyString(pppe);
if (edit) {
@@ -3121,7 +3126,8 @@
public void actionPerformed(ActionEvent e) {
// get the Principal selected from the Principal List
- TaggedList prinList = (TaggedList)td.getComponent(td.PE_PRIN_LIST);
+ TaggedList prinList = (TaggedList)td.getComponent(
+ ToolDialog.PE_PRIN_LIST);
int prinIndex = prinList.getSelectedIndex();
if (prinIndex < 0) {
@@ -3155,7 +3161,8 @@
public void actionPerformed(ActionEvent e) {
// get the Permission selected from the Permission List
- TaggedList permList = (TaggedList)td.getComponent(td.PE_PERM_LIST);
+ TaggedList permList = (TaggedList)td.getComponent(
+ ToolDialog.PE_PERM_LIST);
int permIndex = permList.getSelectedIndex();
if (permIndex < 0) {
@@ -3196,7 +3203,8 @@
public void actionPerformed(ActionEvent e) {
// get the Principal selected from the Principal List
- TaggedList list = (TaggedList)td.getComponent(td.PE_PRIN_LIST);
+ TaggedList list = (TaggedList)td.getComponent(
+ ToolDialog.PE_PRIN_LIST);
int prinIndex = list.getSelectedIndex();
if (prinIndex < 0) {
@@ -3235,7 +3243,7 @@
public void actionPerformed(ActionEvent e) {
// get the Permission selected from the Permission List
- List list = (List)td.getComponent(td.PE_PERM_LIST);
+ List list = (List)td.getComponent(ToolDialog.PE_PERM_LIST);
int permIndex = list.getSelectedIndex();
if (permIndex < 0) {
@@ -3260,19 +3268,19 @@
public void itemStateChanged(ItemEvent e) {
- Choice prin = (Choice)td.getComponent(td.PRD_PRIN_CHOICE);
- TextField prinField =
- (TextField)td.getComponent(td.PRD_PRIN_TEXTFIELD);
- TextField nameField =
- (TextField)td.getComponent(td.PRD_NAME_TEXTFIELD);
+ Choice prin = (Choice)td.getComponent(ToolDialog.PRD_PRIN_CHOICE);
+ TextField prinField = (TextField)td.getComponent(
+ ToolDialog.PRD_PRIN_TEXTFIELD);
+ TextField nameField = (TextField)td.getComponent(
+ ToolDialog.PRD_NAME_TEXTFIELD);
prin.getAccessibleContext().setAccessibleName(
PolicyTool.splitToWords((String)e.getItem()));
- if (((String)e.getItem()).equals(td.PRIN_TYPE)) {
+ if (((String)e.getItem()).equals(ToolDialog.PRIN_TYPE)) {
// ignore if they choose "Principal Type:" item
if (prinField.getText() != null &&
prinField.getText().length() > 0) {
- Prin inputPrin = td.getPrin(prinField.getText(), true);
+ Prin inputPrin = ToolDialog.getPrin(prinField.getText(), true);
prin.select(inputPrin.CLASS);
}
return;
@@ -3286,7 +3294,7 @@
// set the text in the textfield and also modify the
// pull-down choice menus to reflect the correct possible
// set of names and actions
- Prin inputPrin = td.getPrin((String)e.getItem(), false);
+ Prin inputPrin = ToolDialog.getPrin((String)e.getItem(), false);
if (inputPrin != null) {
prinField.setText(inputPrin.FULL_CLASS);
}
@@ -3306,26 +3314,31 @@
public void itemStateChanged(ItemEvent e) {
- Choice perms = (Choice)td.getComponent(td.PD_PERM_CHOICE);
- Choice names = (Choice)td.getComponent(td.PD_NAME_CHOICE);
- Choice actions = (Choice)td.getComponent(td.PD_ACTIONS_CHOICE);
- TextField nameField =
- (TextField)td.getComponent(td.PD_NAME_TEXTFIELD);
- TextField actionsField =
- (TextField)td.getComponent(td.PD_ACTIONS_TEXTFIELD);
- TextField permField = (TextField)td.getComponent(td.PD_PERM_TEXTFIELD);
- TextField signedbyField =
- (TextField)td.getComponent(td.PD_SIGNEDBY_TEXTFIELD);
+ Choice perms = (Choice)td.getComponent(
+ ToolDialog.PD_PERM_CHOICE);
+ Choice names = (Choice)td.getComponent(
+ ToolDialog.PD_NAME_CHOICE);
+ Choice actions = (Choice)td.getComponent(
+ ToolDialog.PD_ACTIONS_CHOICE);
+ TextField nameField = (TextField)td.getComponent(
+ ToolDialog.PD_NAME_TEXTFIELD);
+ TextField actionsField = (TextField)td.getComponent(
+ ToolDialog.PD_ACTIONS_TEXTFIELD);
+ TextField permField = (TextField)td.getComponent(
+ ToolDialog.PD_PERM_TEXTFIELD);
+ TextField signedbyField = (TextField)td.getComponent(
+ ToolDialog.PD_SIGNEDBY_TEXTFIELD);
perms.getAccessibleContext().setAccessibleName(
PolicyTool.splitToWords((String)e.getItem()));
// ignore if they choose the 'Permission:' item
- if (PolicyTool.collator.compare((String)e.getItem(), td.PERM) == 0) {
+ if (PolicyTool.collator.compare((String)e.getItem(),
+ ToolDialog.PERM) == 0) {
if (permField.getText() != null &&
permField.getText().length() > 0) {
- Perm inputPerm = td.getPerm(permField.getText(), true);
+ Perm inputPerm = ToolDialog.getPerm(permField.getText(), true);
if (inputPerm != null) {
perms.select(inputPerm.CLASS);
}
@@ -3344,7 +3357,7 @@
// pull-down choice menus to reflect the correct possible
// set of names and actions
- Perm inputPerm = td.getPerm((String)e.getItem(), false);
+ Perm inputPerm = ToolDialog.getPerm((String)e.getItem(), false);
if (inputPerm == null) {
permField.setText("");
} else {
@@ -3368,14 +3381,14 @@
public void itemStateChanged(ItemEvent e) {
- Choice names = (Choice)td.getComponent(td.PD_NAME_CHOICE);
+ Choice names = (Choice)td.getComponent(ToolDialog.PD_NAME_CHOICE);
names.getAccessibleContext().setAccessibleName(
PolicyTool.splitToWords((String)e.getItem()));
- if (((String)e.getItem()).indexOf(td.PERM_NAME) != -1)
+ if (((String)e.getItem()).indexOf(ToolDialog.PERM_NAME) != -1)
return;
- TextField tf = (TextField)td.getComponent(td.PD_NAME_TEXTFIELD);
+ TextField tf = (TextField)td.getComponent(ToolDialog.PD_NAME_TEXTFIELD);
tf.setText((String)e.getItem());
}
}
@@ -3393,13 +3406,15 @@
public void itemStateChanged(ItemEvent e) {
- Choice actions = (Choice)td.getComponent(td.PD_ACTIONS_CHOICE);
+ Choice actions = (Choice)td.getComponent(
+ ToolDialog.PD_ACTIONS_CHOICE);
actions.getAccessibleContext().setAccessibleName((String)e.getItem());
- if (((String)e.getItem()).indexOf(td.PERM_ACTIONS) != -1)
+ if (((String)e.getItem()).indexOf(ToolDialog.PERM_ACTIONS) != -1)
return;
- TextField tf = (TextField)td.getComponent(td.PD_ACTIONS_TEXTFIELD);
+ TextField tf = (TextField)td.getComponent(
+ ToolDialog.PD_ACTIONS_TEXTFIELD);
if (tf.getText() == null || tf.getText().equals("")) {
tf.setText((String)e.getItem());
} else {
@@ -3521,8 +3536,8 @@
us.dispose();
try {
- String filename = ((TextField)
- tw.getComponent(tw.MW_FILENAME_TEXTFIELD)).getText();
+ String filename = ((TextField)tw.getComponent(
+ ToolWindow.MW_FILENAME_TEXTFIELD)).getText();
if (filename == null || filename.equals("")) {
us.displaySaveAsDialog(select);
@@ -3616,7 +3631,7 @@
public void actionPerformed(ActionEvent e) {
// remove the entry
- List list = (List)tw.getComponent(tw.MW_POLICY_LIST);
+ List list = (List)tw.getComponent(ToolWindow.MW_POLICY_LIST);
int index = list.getSelectedIndex();
PolicyEntry entries[] = tool.getEntry();
tool.removeEntry(entries[index]);
@@ -3640,13 +3655,15 @@
* it's special, and does not pop out a warning box.
*/
class NoDisplayException extends RuntimeException {
-
+ private static final long serialVersionUID = -4611761427108719794L;
}
/**
* This is a java.awt.List that bind an Object to each String it holds.
*/
class TaggedList extends List {
+ private static final long serialVersionUID = -5676238110427785853L;
+
private java.util.List<Object> data = new LinkedList<>();
public TaggedList(int i, boolean b) {
super(i, b);
--- a/jdk/src/share/classes/sun/security/util/Cache.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/util/Cache.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2009, 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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -251,7 +251,7 @@
private final Map<Object, CacheEntry> cacheMap;
private int maxSize;
private long lifetime;
- private final ReferenceQueue queue;
+ private final ReferenceQueue<Object> queue;
public MemoryCache(boolean soft, int maxSize) {
this(soft, maxSize, 0);
@@ -260,7 +260,7 @@
public MemoryCache(boolean soft, int maxSize, int lifetime) {
this.maxSize = maxSize;
this.lifetime = lifetime * 1000;
- this.queue = soft ? new ReferenceQueue() : null;
+ this.queue = soft ? new ReferenceQueue<Object>() : null;
int buckets = (int)(maxSize / LOAD_FACTOR) + 1;
cacheMap = new LinkedHashMap<Object, CacheEntry>(buckets,
LOAD_FACTOR, true);
@@ -449,7 +449,7 @@
}
protected CacheEntry newEntry(Object key, Object value,
- long expirationTime, ReferenceQueue queue) {
+ long expirationTime, ReferenceQueue<Object> queue) {
if (queue != null) {
return new SoftCacheEntry(key, value, expirationTime, queue);
} else {
@@ -504,13 +504,13 @@
}
private static class SoftCacheEntry
- extends SoftReference implements CacheEntry {
+ extends SoftReference<Object> implements CacheEntry {
private Object key;
private long expirationTime;
SoftCacheEntry(Object key, Object value, long expirationTime,
- ReferenceQueue queue) {
+ ReferenceQueue<Object> queue) {
super(value, queue);
this.key = key;
this.expirationTime = expirationTime;
--- a/jdk/src/share/classes/sun/security/util/HostnameChecker.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/util/HostnameChecker.java Wed Jul 05 17:49:56 2017 +0200
@@ -266,8 +266,8 @@
*/
private static boolean matchAllWildcards(String name,
String template) {
- name = name.toLowerCase();
- template = template.toLowerCase();
+ name = name.toLowerCase(Locale.ENGLISH);
+ template = template.toLowerCase(Locale.ENGLISH);
StringTokenizer nameSt = new StringTokenizer(name, ".");
StringTokenizer templateSt = new StringTokenizer(template, ".");
@@ -296,8 +296,8 @@
*/
private static boolean matchLeftmostWildcard(String name,
String template) {
- name = name.toLowerCase();
- template = template.toLowerCase();
+ name = name.toLowerCase(Locale.ENGLISH);
+ template = template.toLowerCase(Locale.ENGLISH);
// Retreive leftmost component
int templateIdx = template.indexOf(".");
--- a/jdk/src/share/classes/sun/security/util/ManifestDigester.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/util/ManifestDigester.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -62,6 +62,7 @@
* @returns false if end of bytes has been reached, otherwise returns
* true
*/
+ @SuppressWarnings("fallthrough")
private boolean findSection(int offset, Position pos)
{
int i = offset, len = rawBytes.length;
@@ -79,6 +80,7 @@
pos.endOfFirstLine = i-1;
if ((i < len) && (rawBytes[i+1] == '\n'))
i++;
+ /* fall through */
case '\n':
if (pos.endOfFirstLine == -1)
pos.endOfFirstLine = i-1;
--- a/jdk/src/share/classes/sun/security/util/Password.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/util/Password.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -43,6 +43,7 @@
/** Reads user password from given input stream.
* @param isEchoOn true if the password should be echoed on the screen
*/
+ @SuppressWarnings("fallthrough")
public static char[] readPassword(InputStream in, boolean isEchoOn)
throws IOException {
@@ -95,7 +96,7 @@
done = true;
break;
}
-
+ /* fall through */
default:
if (--room < 0) {
buf = new char[offset + 128];
--- a/jdk/src/share/classes/sun/security/util/SignatureFileVerifier.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/util/SignatureFileVerifier.java Wed Jul 05 17:49:56 2017 +0200
@@ -181,7 +181,7 @@
*
*/
public void process(Hashtable<String, CodeSigner[]> signers,
- List manifestDigests)
+ List<Object> manifestDigests)
throws IOException, SignatureException, NoSuchAlgorithmException,
JarException, CertificateException
{
@@ -198,7 +198,7 @@
}
private void processImpl(Hashtable<String, CodeSigner[]> signers,
- List manifestDigests)
+ List<Object> manifestDigests)
throws IOException, SignatureException, NoSuchAlgorithmException,
JarException, CertificateException
{
@@ -277,7 +277,7 @@
private boolean verifyManifestHash(Manifest sf,
ManifestDigester md,
BASE64Decoder decoder,
- List manifestDigests)
+ List<Object> manifestDigests)
throws IOException
{
Attributes mattr = sf.getMainAttributes();
--- a/jdk/src/share/classes/sun/security/validator/SimpleValidator.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/validator/SimpleValidator.java Wed Jul 05 17:49:56 2017 +0200
@@ -37,7 +37,6 @@
import sun.security.x509.NetscapeCertTypeExtension;
import sun.security.util.DerValue;
import sun.security.util.DerInputStream;
-import sun.security.util.DerOutputStream;
import sun.security.util.ObjectIdentifier;
import sun.security.provider.certpath.AlgorithmChecker;
@@ -275,7 +274,7 @@
.toByteArray();
ext = new NetscapeCertTypeExtension(encoded);
}
- Boolean val = (Boolean)ext.get(type);
+ Boolean val = ext.get(type);
return val.booleanValue();
} catch (IOException e) {
return false;
--- a/jdk/src/share/classes/sun/security/x509/AVA.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/AVA.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -42,7 +42,7 @@
* X.500 Attribute-Value-Assertion (AVA): an attribute, as identified by
* some attribute ID, has some particular value. Values are as a rule ASN.1
* printable strings. A conventional set of type IDs is recognized when
- * parsing (and generating) RFC 1779 or RFC 2253 syntax strings.
+ * parsing (and generating) RFC 1779, 2253 or 4514 syntax strings.
*
* <P>AVAs are components of X.500 relative names. Think of them as being
* individual fields of a database record. The attribute ID is how you
@@ -92,18 +92,20 @@
* Leading and trailing spaces, also multiple internal spaces, also
* call for quoting the whole string.
*/
- private static final String specialChars = ",+=\n<>#;";
+ private static final String specialChars1779 = ",=\n+<>#;\\\"";
/*
* In RFC2253, if the value has any of these characters in it, it
* must be quoted by a preceding \.
*/
- private static final String specialChars2253 = ",+\"\\<>;";
+ private static final String specialChars2253 = ",=+<>#;\\\"";
/*
- * includes special chars from RFC1779 and RFC2253, as well as ' '
+ * includes special chars from RFC1779 and RFC2253, as well as ' ' from
+ * RFC 4514.
*/
- private static final String specialCharsAll = ",=\n+<>#;\\\" ";
+ private static final String specialCharsDefault = ",=\n+<>#;\\\" ";
+ private static final String escapedDefault = ",+<>;\"";
/*
* Values that aren't printable strings are emitted as BER-encoded
@@ -120,26 +122,26 @@
}
/**
- * Parse an RFC 1779 or RFC 2253 style AVA string: CN=fee fie foe fum
+ * Parse an RFC 1779, 2253 or 4514 style AVA string: CN=fee fie foe fum
* or perhaps with quotes. Not all defined AVA tags are supported;
* of current note are X.400 related ones (PRMD, ADMD, etc).
*
* This terminates at unescaped AVA separators ("+") or RDN
- * separators (",", ";"), or DN terminators (">"), and removes
- * cosmetic whitespace at the end of values.
+ * separators (",", ";"), and removes cosmetic whitespace at the end of
+ * values.
*/
AVA(Reader in) throws IOException {
this(in, DEFAULT);
}
/**
- * Parse an RFC 1779 or RFC 2253 style AVA string: CN=fee fie foe fum
+ * Parse an RFC 1779, 2253 or 4514 style AVA string: CN=fee fie foe fum
* or perhaps with quotes. Additional keywords can be specified in the
* keyword/OID map.
*
* This terminates at unescaped AVA separators ("+") or RDN
- * separators (",", ";"), or DN terminators (">"), and removes
- * cosmetic whitespace at the end of values.
+ * separators (",", ";"), and removes cosmetic whitespace at the end of
+ * values.
*/
AVA(Reader in, Map<String, String> keywordMap) throws IOException {
this(in, DEFAULT, keywordMap);
@@ -147,9 +149,6 @@
/**
* Parse an AVA string formatted according to format.
- *
- * XXX format RFC1779 should only allow RFC1779 syntax but is
- * actually DEFAULT with RFC1779 keywords.
*/
AVA(Reader in, int format) throws IOException {
this(in, format, Collections.<String, String>emptyMap());
@@ -158,9 +157,6 @@
/**
* Parse an AVA string formatted according to format.
*
- * XXX format RFC1779 should only allow RFC1779 syntax but is
- * actually DEFAULT with RFC1779 keywords.
- *
* @param in Reader containing AVA String
* @param format parsing format
* @param keywordMap a Map where a keyword String maps to a corresponding
@@ -168,11 +164,11 @@
* If an entry does not exist, it will fallback to the builtin
* keyword/OID mapping.
* @throws IOException if the AVA String is not valid in the specified
- * standard or an OID String from the keywordMap is improperly formatted
+ * format or an OID String from the keywordMap is improperly formatted
*/
AVA(Reader in, int format, Map<String, String> keywordMap)
throws IOException {
- // assume format is one of DEFAULT, RFC1779, RFC2253
+ // assume format is one of DEFAULT or RFC2253
StringBuilder temp = new StringBuilder();
int c;
@@ -193,7 +189,7 @@
/*
* Now parse the value. "#hex", a quoted string, or a string
- * terminated by "+", ",", ";", ">". Whitespace before or after
+ * terminated by "+", ",", ";". Whitespace before or after
* the value is stripped away unless format is RFC2253.
*/
temp.setLength(0);
@@ -202,7 +198,7 @@
c = in.read();
if (c == ' ') {
throw new IOException("Incorrect AVA RFC2253 format - " +
- "leading space must be escaped");
+ "leading space must be escaped");
}
} else {
// read next character skipping whitespace
@@ -331,8 +327,7 @@
continue;
}
- if (c != '\\' && c != '"' &&
- specialChars.indexOf((char)c) < 0) {
+ if (specialChars1779.indexOf((char)c) < 0) {
throw new IOException
("Invalid escaped character in AVA: " +
(char)c);
@@ -369,8 +364,8 @@
// encode as PrintableString unless value contains
// non-PrintableString chars
- if (this.oid.equals(PKCS9Attribute.EMAIL_ADDRESS_OID) ||
- (this.oid.equals(X500Name.DOMAIN_COMPONENT_OID) &&
+ if (this.oid.equals((Object)PKCS9Attribute.EMAIL_ADDRESS_OID) ||
+ (this.oid.equals((Object)X500Name.DOMAIN_COMPONENT_OID) &&
PRESERVE_OLD_DC_ENCODING == false)) {
// EmailAddress and DomainComponent must be IA5String
return new DerValue(DerValue.tag_IA5String,
@@ -386,7 +381,7 @@
private DerValue parseString
(Reader in, int c, int format, StringBuilder temp) throws IOException {
- List<Byte> embeddedHex = new ArrayList<Byte>();
+ List<Byte> embeddedHex = new ArrayList<>();
boolean isPrintableString = true;
boolean escape = false;
boolean leadingChar = true;
@@ -413,24 +408,19 @@
}
// check if character was improperly escaped
- if ((format == DEFAULT &&
- specialCharsAll.indexOf((char)c) == -1) ||
- (format == RFC1779 &&
- specialChars.indexOf((char)c) == -1 &&
- c != '\\' && c != '\"')) {
-
+ if (format == DEFAULT &&
+ specialCharsDefault.indexOf((char)c) == -1) {
throw new IOException
("Invalid escaped character in AVA: '" +
(char)c + "'");
-
} else if (format == RFC2253) {
if (c == ' ') {
// only leading/trailing space can be escaped
if (!leadingChar && !trailingSpace(in)) {
- throw new IOException
- ("Invalid escaped space character " +
- "in AVA. Only a leading or trailing " +
- "space character can be escaped.");
+ throw new IOException
+ ("Invalid escaped space character " +
+ "in AVA. Only a leading or trailing " +
+ "space character can be escaped.");
}
} else if (c == '#') {
// only leading '#' can be escaped
@@ -443,18 +433,20 @@
throw new IOException
("Invalid escaped character in AVA: '" +
(char)c + "'");
-
}
}
-
} else {
// check if character should have been escaped
if (format == RFC2253) {
if (specialChars2253.indexOf((char)c) != -1) {
throw new IOException
("Character '" + (char)c +
- "' in AVA appears without escape");
+ "' in AVA appears without escape");
}
+ } else if (escapedDefault.indexOf((char)c) != -1) {
+ throw new IOException
+ ("Character '" + (char)c +
+ "' in AVA appears without escape");
}
}
@@ -503,8 +495,8 @@
// encode as PrintableString unless value contains
// non-PrintableString chars
- if (this.oid.equals(PKCS9Attribute.EMAIL_ADDRESS_OID) ||
- (this.oid.equals(X500Name.DOMAIN_COMPONENT_OID) &&
+ if (this.oid.equals((Object)PKCS9Attribute.EMAIL_ADDRESS_OID) ||
+ (this.oid.equals((Object)X500Name.DOMAIN_COMPONENT_OID) &&
PRESERVE_OLD_DC_ENCODING == false)) {
// EmailAddress and DomainComponent must be IA5String
return new DerValue(DerValue.tag_IA5String, temp.toString());
@@ -551,7 +543,6 @@
case ',':
return true;
case ';':
- case '>':
return format != RFC2253;
default:
return false;
@@ -1204,18 +1195,6 @@
* Get an object identifier representing the specified keyword (or
* string encoded object identifier) in the given standard.
*
- * @throws IOException If the keyword is not valid in the specified standard
- */
- static ObjectIdentifier getOID(String keyword, int standard)
- throws IOException {
- return getOID
- (keyword, standard, Collections.<String, String>emptyMap());
- }
-
- /**
- * Get an object identifier representing the specified keyword (or
- * string encoded object identifier) in the given standard.
- *
* @param keywordMap a Map where a keyword String maps to a corresponding
* OID String. Each AVA keyword will be mapped to the corresponding OID.
* If an entry does not exist, it will fallback to the builtin
@@ -1249,19 +1228,11 @@
return new ObjectIdentifier(oidString);
}
- // no keyword found or not standard compliant, check if OID string
+ // no keyword found, check if OID string
+ if (standard == AVA.DEFAULT && keyword.startsWith("OID.")) {
+ keyword = keyword.substring(4);
+ }
- // RFC1779 requires, DEFAULT allows OID. prefix
- if (standard == AVA.RFC1779) {
- if (keyword.startsWith("OID.") == false) {
- throw new IOException("Invalid RFC1779 keyword: " + keyword);
- }
- keyword = keyword.substring(4);
- } else if (standard == AVA.DEFAULT) {
- if (keyword.startsWith("OID.")) {
- keyword = keyword.substring(4);
- }
- }
boolean number = false;
if (keyword.length() != 0) {
char ch = keyword.charAt(0);
--- a/jdk/src/share/classes/sun/security/x509/AccessDescription.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/AccessDescription.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -25,7 +25,6 @@
package sun.security.x509;
-import java.security.cert.*;
import java.io.IOException;
import sun.security.util.*;
@@ -96,19 +95,19 @@
if (this == that) {
return true;
}
- return (accessMethod.equals(that.getAccessMethod()) &&
+ return (accessMethod.equals((Object)that.getAccessMethod()) &&
accessLocation.equals(that.getAccessLocation()));
}
public String toString() {
String method = null;
- if (accessMethod.equals(Ad_CAISSUERS_Id)) {
+ if (accessMethod.equals((Object)Ad_CAISSUERS_Id)) {
method = "caIssuers";
- } else if (accessMethod.equals(Ad_CAREPOSITORY_Id)) {
+ } else if (accessMethod.equals((Object)Ad_CAREPOSITORY_Id)) {
method = "caRepository";
- } else if (accessMethod.equals(Ad_TIMESTAMPING_Id)) {
+ } else if (accessMethod.equals((Object)Ad_TIMESTAMPING_Id)) {
method = "timeStamping";
- } else if (accessMethod.equals(Ad_OCSP_Id)) {
+ } else if (accessMethod.equals((Object)Ad_OCSP_Id)) {
method = "ocsp";
} else {
method = accessMethod.toString();
--- a/jdk/src/share/classes/sun/security/x509/AlgorithmId.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/AlgorithmId.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -236,7 +236,7 @@
if (algName != null) {
return algName;
}
- if ((params != null) && algid.equals(specifiedWithECDSA_oid)) {
+ if ((params != null) && algid.equals((Object)specifiedWithECDSA_oid)) {
try {
AlgorithmId paramsId =
AlgorithmId.parse(new DerValue(getEncodedParams()));
@@ -273,7 +273,7 @@
public boolean equals(AlgorithmId other) {
boolean paramsEqual =
(params == null ? other.params == null : params.equals(other.params));
- return (algid.equals(other.algid) && paramsEqual);
+ return (algid.equals((Object)other.algid) && paramsEqual);
}
/**
@@ -301,7 +301,7 @@
* they are the same algorithm, ignoring algorithm parameters.
*/
public final boolean equals(ObjectIdentifier id) {
- return algid.equals(id);
+ return algid.equals((Object)id);
}
/**
--- a/jdk/src/share/classes/sun/security/x509/AuthorityInfoAccessExtension.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/AuthorityInfoAccessExtension.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2009, 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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -163,6 +163,7 @@
/**
* Set the attribute value.
*/
+ @SuppressWarnings("unchecked") // Checked with an instanceof check
public void set(String name, Object obj) throws IOException {
if (name.equalsIgnoreCase(DESCRIPTIONS)) {
if (!(obj instanceof List)) {
@@ -180,7 +181,7 @@
/**
* Get the attribute value.
*/
- public Object get(String name) throws IOException {
+ public List<AccessDescription> get(String name) throws IOException {
if (name.equalsIgnoreCase(DESCRIPTIONS)) {
return accessDescriptions;
} else {
--- a/jdk/src/share/classes/sun/security/x509/CRLDistributionPointsExtension.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/CRLDistributionPointsExtension.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2006, 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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -222,6 +222,7 @@
/**
* Set the attribute value.
*/
+ @SuppressWarnings("unchecked") // Checked with instanceof
public void set(String name, Object obj) throws IOException {
if (name.equalsIgnoreCase(POINTS)) {
if (!(obj instanceof List)) {
@@ -239,7 +240,7 @@
/**
* Get the attribute value.
*/
- public Object get(String name) throws IOException {
+ public List<DistributionPoint> get(String name) throws IOException {
if (name.equalsIgnoreCase(POINTS)) {
return distributionPoints;
} else {
--- a/jdk/src/share/classes/sun/security/x509/CRLExtensions.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/CRLExtensions.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -36,7 +36,6 @@
import java.util.Hashtable;
import sun.security.util.*;
-import sun.misc.HexDumpEncoder;
/**
* This class defines the CRL Extensions.
@@ -109,7 +108,7 @@
// Parse the encoded extension
private void parseExtension(Extension ext) throws CRLException {
try {
- Class extClass = OIDMap.getClass(ext.getExtensionId());
+ Class<?> extClass = OIDMap.getClass(ext.getExtensionId());
if (extClass == null) { // Unsupported extension
if (ext.isCritical())
unsupportedCritExt = true;
@@ -117,10 +116,10 @@
throw new CRLException("Duplicate extensions not allowed");
return;
}
- Constructor cons = ((Class<?>)extClass).getConstructor(PARAMS);
+ Constructor<?> cons = extClass.getConstructor(PARAMS);
Object[] passed = new Object[] {Boolean.valueOf(ext.isCritical()),
ext.getExtensionValue()};
- CertAttrSet crlExt = (CertAttrSet)cons.newInstance(passed);
+ CertAttrSet<?> crlExt = (CertAttrSet<?>)cons.newInstance(passed);
if (map.put(crlExt.getName(), (Extension)crlExt) != null) {
throw new CRLException("Duplicate extensions not allowed");
}
--- a/jdk/src/share/classes/sun/security/x509/CRLNumberExtension.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/CRLNumberExtension.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -155,7 +155,7 @@
/**
* Get the attribute value.
*/
- public Object get(String name) throws IOException {
+ public BigInteger get(String name) throws IOException {
if (name.equalsIgnoreCase(NUMBER)) {
if (crlNumber == null) return null;
else return crlNumber;
--- a/jdk/src/share/classes/sun/security/x509/CRLReasonCodeExtension.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/CRLReasonCodeExtension.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -155,7 +155,7 @@
/**
* Get the attribute value.
*/
- public Object get(String name) throws IOException {
+ public Integer get(String name) throws IOException {
if (name.equalsIgnoreCase(REASON)) {
return new Integer(reasonCode);
} else {
--- a/jdk/src/share/classes/sun/security/x509/CertAndKeyGen.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/CertAndKeyGen.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -229,7 +229,7 @@
new CertificateVersion(CertificateVersion.V3));
info.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(
new java.util.Random().nextInt() & 0x7fffffff));
- AlgorithmId algID = AlgorithmId.getAlgorithmId(sigAlg);
+ AlgorithmId algID = AlgorithmId.get(sigAlg);
info.set(X509CertInfo.ALGORITHM_ID,
new CertificateAlgorithmId(algID));
info.set(X509CertInfo.SUBJECT, new CertificateSubjectName(myname));
--- a/jdk/src/share/classes/sun/security/x509/CertificateAlgorithmId.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/CertificateAlgorithmId.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -130,7 +130,7 @@
/**
* Get the attribute value.
*/
- public Object get(String name) throws IOException {
+ public AlgorithmId get(String name) throws IOException {
if (name.equalsIgnoreCase(ALGORITHM)) {
return (algId);
} else {
--- a/jdk/src/share/classes/sun/security/x509/CertificateExtensions.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/CertificateExtensions.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -93,7 +93,7 @@
// Parse the encoded extension
private void parseExtension(Extension ext) throws IOException {
try {
- Class extClass = OIDMap.getClass(ext.getExtensionId());
+ Class<?> extClass = OIDMap.getClass(ext.getExtensionId());
if (extClass == null) { // Unsupported extension
if (ext.isCritical()) {
unsupportedCritExt = true;
@@ -104,11 +104,12 @@
throw new IOException("Duplicate extensions not allowed");
}
}
- Constructor cons = ((Class<?>)extClass).getConstructor(PARAMS);
+ Constructor<?> cons = extClass.getConstructor(PARAMS);
Object[] passed = new Object[] {Boolean.valueOf(ext.isCritical()),
ext.getExtensionValue()};
- CertAttrSet certExt = (CertAttrSet)cons.newInstance(passed);
+ CertAttrSet<?> certExt = (CertAttrSet<?>)
+ cons.newInstance(passed);
if (map.put(certExt.getName(), (Extension)certExt) != null) {
throw new IOException("Duplicate extensions not allowed");
}
@@ -132,12 +133,12 @@
if (e instanceof IOException) {
throw (IOException)e;
} else {
- throw (IOException)new IOException(e.toString()).initCause(e);
+ throw new IOException(e);
}
} catch (IOException e) {
throw e;
} catch (Exception e) {
- throw (IOException)new IOException(e.toString()).initCause(e);
+ throw new IOException(e);
}
}
@@ -210,8 +211,8 @@
* @param name the extension name used in the lookup.
* @exception IOException if named extension is not found.
*/
- public Object get(String name) throws IOException {
- Object obj = map.get(name);
+ public Extension get(String name) throws IOException {
+ Extension obj = map.get(name);
if (obj == null) {
throw new IOException("No extension found with name " + name);
}
@@ -233,7 +234,7 @@
public String getNameByOid(ObjectIdentifier oid) throws IOException {
for (String name: map.keySet()) {
- if (map.get(name).getExtensionId().equals(oid)) {
+ if (map.get(name).getExtensionId().equals((Object)oid)) {
return name;
}
}
@@ -353,7 +354,7 @@
name = "";
try {
- Class extClass = OIDMap.getClass(ext.getExtensionId());
+ Class<?> extClass = OIDMap.getClass(ext.getExtensionId());
if (extClass != null) {
Field field = extClass.getDeclaredField("NAME");
name = (String)(field.get(null)) + " ";
--- a/jdk/src/share/classes/sun/security/x509/CertificateIssuerExtension.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/CertificateIssuerExtension.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -141,7 +141,7 @@
*
* @throws IOException on error
*/
- public Object get(String name) throws IOException {
+ public GeneralNames get(String name) throws IOException {
if (name.equalsIgnoreCase(ISSUER)) {
return names;
} else {
--- a/jdk/src/share/classes/sun/security/x509/CertificateIssuerUniqueIdentity.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/CertificateIssuerUniqueIdentity.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -136,7 +136,7 @@
/**
* Get the attribute value.
*/
- public Object get(String name) throws IOException {
+ public UniqueIdentity get(String name) throws IOException {
if (name.equalsIgnoreCase(ID)) {
return (id);
} else {
--- a/jdk/src/share/classes/sun/security/x509/CertificatePoliciesExtension.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/CertificatePoliciesExtension.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -189,6 +189,7 @@
/**
* Set the attribute value.
*/
+ @SuppressWarnings("unchecked") // Checked with an instanceof check
public void set(String name, Object obj) throws IOException {
if (name.equalsIgnoreCase(POLICIES)) {
if (!(obj instanceof List)) {
@@ -206,7 +207,7 @@
/**
* Get the attribute value.
*/
- public Object get(String name) throws IOException {
+ public List<PolicyInformation> get(String name) throws IOException {
if (name.equalsIgnoreCase(POLICIES)) {
//XXXX May want to consider cloning this
return certPolicies;
--- a/jdk/src/share/classes/sun/security/x509/CertificatePolicyId.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/CertificatePolicyId.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -93,7 +93,8 @@
*/
public boolean equals(Object other) {
if (other instanceof CertificatePolicyId)
- return id.equals(((CertificatePolicyId) other).getIdentifier());
+ return id.equals((Object)
+ ((CertificatePolicyId) other).getIdentifier());
else
return false;
}
--- a/jdk/src/share/classes/sun/security/x509/CertificateSerialNumber.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/CertificateSerialNumber.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -141,7 +141,7 @@
/**
* Get the attribute value.
*/
- public Object get(String name) throws IOException {
+ public SerialNumber get(String name) throws IOException {
if (name.equalsIgnoreCase(NUMBER)) {
return (serial);
} else {
--- a/jdk/src/share/classes/sun/security/x509/CertificateSubjectUniqueIdentity.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/CertificateSubjectUniqueIdentity.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -135,7 +135,7 @@
/**
* Get the attribute value.
*/
- public Object get(String name) throws IOException {
+ public UniqueIdentity get(String name) throws IOException {
if (name.equalsIgnoreCase(ID)) {
return(id);
} else {
--- a/jdk/src/share/classes/sun/security/x509/CertificateValidity.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/CertificateValidity.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -190,7 +190,7 @@
/**
* Get the attribute value.
*/
- public Object get(String name) throws IOException {
+ public Date get(String name) throws IOException {
if (name.equalsIgnoreCase(NOT_BEFORE)) {
return (getNotBefore());
} else if (name.equalsIgnoreCase(NOT_AFTER)) {
--- a/jdk/src/share/classes/sun/security/x509/CertificateVersion.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/CertificateVersion.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -191,7 +191,7 @@
/**
* Get the attribute value.
*/
- public Object get(String name) throws IOException {
+ public Integer get(String name) throws IOException {
if (name.equalsIgnoreCase(VERSION)) {
return(new Integer(getVersion()));
} else {
--- a/jdk/src/share/classes/sun/security/x509/CertificateX509Key.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/CertificateX509Key.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -122,7 +122,7 @@
/**
* Get the attribute value.
*/
- public Object get(String name) throws IOException {
+ public PublicKey get(String name) throws IOException {
if (name.equalsIgnoreCase(KEY)) {
return(key);
} else {
--- a/jdk/src/share/classes/sun/security/x509/DNSName.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/DNSName.java Wed Jul 05 17:49:56 2017 +0200
@@ -159,7 +159,7 @@
* @return a hash code value for this object.
*/
public int hashCode() {
- return name.toUpperCase().hashCode();
+ return name.toUpperCase(Locale.ENGLISH).hashCode();
}
/**
--- a/jdk/src/share/classes/sun/security/x509/ExtendedKeyUsageExtension.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/ExtendedKeyUsageExtension.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -241,6 +241,7 @@
/**
* Set the attribute value.
*/
+ @SuppressWarnings("unchecked") // Checked with instanceof
public void set(String name, Object obj) throws IOException {
if (name.equalsIgnoreCase(USAGES)) {
if (!(obj instanceof Vector)) {
@@ -258,7 +259,7 @@
/**
* Get the attribute value.
*/
- public Object get(String name) throws IOException {
+ public Vector<ObjectIdentifier> get(String name) throws IOException {
if (name.equalsIgnoreCase(USAGES)) {
//XXXX May want to consider cloning this
return keyUsages;
--- a/jdk/src/share/classes/sun/security/x509/Extension.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/Extension.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -269,7 +269,7 @@
Extension otherExt = (Extension) other;
if (critical != otherExt.critical)
return false;
- if (!extensionId.equals(otherExt.extensionId))
+ if (!extensionId.equals((Object)otherExt.extensionId))
return false;
return Arrays.equals(extensionValue, otherExt.extensionValue);
}
--- a/jdk/src/share/classes/sun/security/x509/InhibitAnyPolicyExtension.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/InhibitAnyPolicyExtension.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -215,7 +215,7 @@
* Integer.
* @throws IOException on error
*/
- public Object get(String name) throws IOException {
+ public Integer get(String name) throws IOException {
if (name.equalsIgnoreCase(SKIP_CERTS))
return (new Integer(skipCerts));
else
--- a/jdk/src/share/classes/sun/security/x509/InvalidityDateExtension.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/InvalidityDateExtension.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -138,7 +138,7 @@
/**
* Get the attribute value.
*/
- public Object get(String name) throws IOException {
+ public Date get(String name) throws IOException {
if (name.equalsIgnoreCase(DATE)) {
if (date == null) {
return null;
--- a/jdk/src/share/classes/sun/security/x509/IssuerAlternativeNameExtension.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/IssuerAlternativeNameExtension.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -190,7 +190,7 @@
/**
* Get the attribute value.
*/
- public Object get(String name) throws IOException {
+ public GeneralNames get(String name) throws IOException {
if (name.equalsIgnoreCase(ISSUER_NAME)) {
return (names);
} else {
--- a/jdk/src/share/classes/sun/security/x509/KeyUsageExtension.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/KeyUsageExtension.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -217,7 +217,7 @@
/**
* Get the attribute value.
*/
- public Object get(String name) throws IOException {
+ public Boolean get(String name) throws IOException {
if (name.equalsIgnoreCase(DIGITAL_SIGNATURE)) {
return Boolean.valueOf(isSet(0));
} else if (name.equalsIgnoreCase(NON_REPUDIATION)) {
--- a/jdk/src/share/classes/sun/security/x509/NameConstraintsExtension.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/NameConstraintsExtension.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -27,10 +27,7 @@
import java.io.IOException;
import java.io.OutputStream;
-import java.security.Principal;
-import java.security.cert.CertificateEncodingException;
import java.security.cert.CertificateException;
-import java.security.cert.CertificateParsingException;
import java.security.cert.X509Certificate;
import java.util.*;
@@ -268,7 +265,7 @@
/**
* Get the attribute value.
*/
- public Object get(String name) throws IOException {
+ public GeneralSubtrees get(String name) throws IOException {
if (name.equalsIgnoreCase(PERMITTED_SUBTREES)) {
return (permitted);
} else if (name.equalsIgnoreCase(EXCLUDED_SUBTREES)) {
@@ -349,8 +346,7 @@
* value and the value indicated in the extension field.
*/
- GeneralSubtrees newExcluded =
- (GeneralSubtrees)newConstraints.get(EXCLUDED_SUBTREES);
+ GeneralSubtrees newExcluded = newConstraints.get(EXCLUDED_SUBTREES);
if (excluded == null) {
excluded = (newExcluded != null) ?
(GeneralSubtrees)newExcluded.clone() : null;
@@ -367,8 +363,7 @@
* previous value and the value indicated in the extension field.
*/
- GeneralSubtrees newPermitted =
- (GeneralSubtrees)newConstraints.get(PERMITTED_SUBTREES);
+ GeneralSubtrees newPermitted = newConstraints.get(PERMITTED_SUBTREES);
if (permitted == null) {
permitted = (newPermitted != null) ?
(GeneralSubtrees)newPermitted.clone() : null;
@@ -455,8 +450,8 @@
if (altNameExt != null) {
// extract altNames from extension; this call does not
// return an IOException on null altnames
- altNames = (GeneralNames)
- (altNameExt.get(altNameExt.SUBJECT_NAME));
+ altNames = altNameExt.get(
+ SubjectAlternativeNameExtension.SUBJECT_NAME);
}
} catch (CertificateException ce) {
throw new IOException("Unable to extract extensions from " +
@@ -575,10 +570,9 @@
* @throws IOException on error
*/
public boolean verifyRFC822SpecialCase(X500Name subject) throws IOException {
- for (Iterator t = subject.allAvas().iterator(); t.hasNext(); ) {
- AVA ava = (AVA)t.next();
+ for (AVA ava : subject.allAvas()) {
ObjectIdentifier attrOID = ava.getObjectIdentifier();
- if (attrOID.equals(PKCS9Attribute.EMAIL_ADDRESS_OID)) {
+ if (attrOID.equals((Object)PKCS9Attribute.EMAIL_ADDRESS_OID)) {
String attrValue = ava.getValueString();
if (attrValue != null) {
RFC822Name emailName;
--- a/jdk/src/share/classes/sun/security/x509/NetscapeCertTypeExtension.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/NetscapeCertTypeExtension.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -220,7 +220,7 @@
/**
* Get the attribute value.
*/
- public Object get(String name) throws IOException {
+ public Boolean get(String name) throws IOException {
return Boolean.valueOf(isSet(getPosition(name)));
}
@@ -306,15 +306,15 @@
if (isSet(getPosition(SSL_CLIENT)) ||
isSet(getPosition(S_MIME)) ||
isSet(getPosition(OBJECT_SIGNING)))
- keyUsage.set(keyUsage.DIGITAL_SIGNATURE, val);
+ keyUsage.set(KeyUsageExtension.DIGITAL_SIGNATURE, val);
if (isSet(getPosition(SSL_SERVER)))
- keyUsage.set(keyUsage.KEY_ENCIPHERMENT, val);
+ keyUsage.set(KeyUsageExtension.KEY_ENCIPHERMENT, val);
if (isSet(getPosition(SSL_CA)) ||
isSet(getPosition(S_MIME_CA)) ||
isSet(getPosition(OBJECT_SIGNING_CA)))
- keyUsage.set(keyUsage.KEY_CERTSIGN, val);
+ keyUsage.set(KeyUsageExtension.KEY_CERTSIGN, val);
} catch (IOException e) { }
return keyUsage.getBits();
}
--- a/jdk/src/share/classes/sun/security/x509/OIDMap.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/OIDMap.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -29,7 +29,6 @@
import java.io.IOException;
import java.security.cert.CertificateException;
-import java.security.cert.CertificateParsingException;
import sun.security.util.*;
@@ -186,7 +185,7 @@
final ObjectIdentifier oid;
final String name;
final String className;
- private volatile Class clazz;
+ private volatile Class<?> clazz;
OIDInfo(String name, ObjectIdentifier oid, String className) {
this.name = name;
@@ -194,7 +193,7 @@
this.className = className;
}
- OIDInfo(String name, ObjectIdentifier oid, Class clazz) {
+ OIDInfo(String name, ObjectIdentifier oid, Class<?> clazz) {
this.name = name;
this.oid = oid;
this.className = clazz.getName();
@@ -204,17 +203,16 @@
/**
* Return the Class object associated with this attribute.
*/
- Class getClazz() throws CertificateException {
+ Class<?> getClazz() throws CertificateException {
try {
- Class c = clazz;
+ Class<?> c = clazz;
if (c == null) {
c = Class.forName(className);
clazz = c;
}
return c;
} catch (ClassNotFoundException e) {
- throw (CertificateException)new CertificateException
- ("Could not load class: " + e).initCause(e);
+ throw new CertificateException("Could not load class: " + e, e);
}
}
}
@@ -228,7 +226,7 @@
* @param clazz the Class object associated with this attribute
* @exception CertificateException on errors.
*/
- public static void addAttribute(String name, String oid, Class clazz)
+ public static void addAttribute(String name, String oid, Class<?> clazz)
throws CertificateException {
ObjectIdentifier objId;
try {
@@ -277,7 +275,7 @@
* @param name the user friendly name.
* @exception CertificateException if class cannot be instantiated.
*/
- public static Class getClass(String name) throws CertificateException {
+ public static Class<?> getClass(String name) throws CertificateException {
OIDInfo info = nameMap.get(name);
return (info == null) ? null : info.getClazz();
}
@@ -288,7 +286,7 @@
* @param oid the name of the object identifier to be returned.
* @exception CertificateException if class cannot be instatiated.
*/
- public static Class getClass(ObjectIdentifier oid)
+ public static Class<?> getClass(ObjectIdentifier oid)
throws CertificateException {
OIDInfo info = oidMap.get(oid);
return (info == null) ? null : info.getClazz();
--- a/jdk/src/share/classes/sun/security/x509/OIDName.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/OIDName.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -120,7 +120,7 @@
OIDName other = (OIDName)obj;
- return oid.equals(other.oid);
+ return oid.equals((Object)other.oid);
}
/**
--- a/jdk/src/share/classes/sun/security/x509/OtherName.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/OtherName.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -120,19 +120,19 @@
private GeneralNameInterface getGNI(ObjectIdentifier oid, byte[] nameValue)
throws IOException {
try {
- Class extClass = OIDMap.getClass(oid);
+ Class<?> extClass = OIDMap.getClass(oid);
if (extClass == null) { // Unsupported OtherName
return null;
}
- Class[] params = { Object.class };
- Constructor cons = ((Class<?>)extClass).getConstructor(params);
+ Class<?>[] params = { Object.class };
+ Constructor<?> cons = extClass.getConstructor(params);
Object[] passed = new Object[] { nameValue };
GeneralNameInterface gni =
(GeneralNameInterface)cons.newInstance(passed);
return gni;
} catch (Exception e) {
- throw (IOException)new IOException("Instantiation error: " + e).initCause(e);
+ throw new IOException("Instantiation error: " + e, e);
}
}
@@ -176,7 +176,7 @@
return false;
}
OtherName otherOther = (OtherName)other;
- if (!(otherOther.oid.equals(oid))) {
+ if (!(otherOther.oid.equals((Object)oid))) {
return false;
}
GeneralNameInterface otherGNI = null;
--- a/jdk/src/share/classes/sun/security/x509/PolicyConstraintsExtension.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/PolicyConstraintsExtension.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -231,7 +231,7 @@
/**
* Get the attribute value.
*/
- public Object get(String name) throws IOException {
+ public Integer get(String name) throws IOException {
if (name.equalsIgnoreCase(REQUIRE)) {
return new Integer(require);
} else if (name.equalsIgnoreCase(INHIBIT)) {
--- a/jdk/src/share/classes/sun/security/x509/PolicyInformation.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/PolicyInformation.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -186,6 +186,7 @@
/**
* Set the attribute value.
*/
+ @SuppressWarnings("unchecked") // Checked with instanceof
public void set(String name, Object obj) throws IOException {
if (name.equalsIgnoreCase(ID)) {
if (obj instanceof CertificatePolicyId)
--- a/jdk/src/share/classes/sun/security/x509/PolicyMappingsExtension.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/PolicyMappingsExtension.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -29,8 +29,6 @@
import java.io.OutputStream;
import java.util.*;
-import java.security.cert.CertificateException;
-
import sun.security.util.*;
/**
@@ -165,6 +163,7 @@
/**
* Set the attribute value.
*/
+ @SuppressWarnings("unchecked") // Checked with instanceof
public void set(String name, Object obj) throws IOException {
if (name.equalsIgnoreCase(MAP)) {
if (!(obj instanceof List)) {
@@ -182,7 +181,7 @@
/**
* Get the attribute value.
*/
- public Object get(String name) throws IOException {
+ public List<CertificatePolicyMap> get(String name) throws IOException {
if (name.equalsIgnoreCase(MAP)) {
return (maps);
} else {
--- a/jdk/src/share/classes/sun/security/x509/PrivateKeyUsageExtension.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/PrivateKeyUsageExtension.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -262,7 +262,7 @@
* Get the attribute value.
* @exception CertificateException on attribute handling errors.
*/
- public Object get(String name) throws CertificateException {
+ public Date get(String name) throws CertificateException {
if (name.equalsIgnoreCase(NOT_BEFORE)) {
return (new Date(notBefore.getTime()));
} else if (name.equalsIgnoreCase(NOT_AFTER)) {
--- a/jdk/src/share/classes/sun/security/x509/RDN.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/RDN.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2006, 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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,17 +25,11 @@
package sun.security.x509;
-import java.lang.reflect.*;
import java.io.IOException;
import java.io.StringReader;
-import java.security.PrivilegedExceptionAction;
-import java.security.AccessController;
-import java.security.Principal;
import java.util.*;
import sun.security.util.*;
-import sun.security.pkcs.PKCS9Attribute;
-import javax.security.auth.x500.X500Principal;
/**
* RDNs are a set of {attribute = value} assertions. Some of those
@@ -327,7 +321,7 @@
*/
DerValue findAttribute(ObjectIdentifier oid) {
for (int i = 0; i < assertion.length; i++) {
- if (assertion[i].oid.equals(oid)) {
+ if (assertion[i].oid.equals((Object)oid)) {
return assertion[i].value;
}
}
--- a/jdk/src/share/classes/sun/security/x509/RFC822Name.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/RFC822Name.java Wed Jul 05 17:49:56 2017 +0200
@@ -153,7 +153,7 @@
* @return a hash code value for this object.
*/
public int hashCode() {
- return name.toUpperCase().hashCode();
+ return name.toUpperCase(Locale.ENGLISH).hashCode();
}
/**
--- a/jdk/src/share/classes/sun/security/x509/SubjectAlternativeNameExtension.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/SubjectAlternativeNameExtension.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -195,7 +195,7 @@
/**
* Get the attribute value.
*/
- public Object get(String name) throws IOException {
+ public GeneralNames get(String name) throws IOException {
if (name.equalsIgnoreCase(SUBJECT_NAME)) {
return (names);
} else {
--- a/jdk/src/share/classes/sun/security/x509/SubjectInfoAccessExtension.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/SubjectInfoAccessExtension.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -167,6 +167,7 @@
/**
* Set the attribute value.
*/
+ @SuppressWarnings("unchecked") // Checked with instanceof
public void set(String name, Object obj) throws IOException {
if (name.equalsIgnoreCase(DESCRIPTIONS)) {
if (!(obj instanceof List)) {
@@ -184,7 +185,7 @@
/**
* Get the attribute value.
*/
- public Object get(String name) throws IOException {
+ public List<AccessDescription> get(String name) throws IOException {
if (name.equalsIgnoreCase(DESCRIPTIONS)) {
return accessDescriptions;
} else {
--- a/jdk/src/share/classes/sun/security/x509/SubjectKeyIdentifierExtension.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/SubjectKeyIdentifierExtension.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -156,7 +156,7 @@
/**
* Get the attribute value.
*/
- public Object get(String name) throws IOException {
+ public KeyIdentifier get(String name) throws IOException {
if (name.equalsIgnoreCase(KEY_ID)) {
return (id);
} else {
--- a/jdk/src/share/classes/sun/security/x509/X500Name.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/X500Name.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -27,14 +27,12 @@
import java.lang.reflect.*;
import java.io.IOException;
-import java.io.StringReader;
import java.security.PrivilegedExceptionAction;
import java.security.AccessController;
import java.security.Principal;
import java.util.*;
import sun.security.util.*;
-import sun.security.pkcs.PKCS9Attribute;
import javax.security.auth.x500.X500Principal;
/**
@@ -144,9 +142,9 @@
/**
* Constructs a name from a conventionally formatted string, such
* as "CN=Dave, OU=JavaSoft, O=Sun Microsystems, C=US".
- * (RFC 1779 or RFC 2253 style).
+ * (RFC 1779, 2253, or 4514 style).
*
- * @param DN X.500 Distinguished Name
+ * @param dname the X.500 Distinguished Name
*/
public X500Name(String dname) throws IOException {
this(dname, Collections.<String, String>emptyMap());
@@ -155,9 +153,9 @@
/**
* Constructs a name from a conventionally formatted string, such
* as "CN=Dave, OU=JavaSoft, O=Sun Microsystems, C=US".
- * (RFC 1779 or RFC 2253 style).
+ * (RFC 1779, 2253, or 4514 style).
*
- * @param DN X.500 Distinguished Name
+ * @param dname the X.500 Distinguished Name
* @param keywordMap an additional keyword/OID map
*/
public X500Name(String dname, Map<String, String> keywordMap)
@@ -169,10 +167,11 @@
* Constructs a name from a string formatted according to format.
* Currently, the formats DEFAULT and RFC2253 are supported.
* DEFAULT is the default format used by the X500Name(String)
- * constructor. RFC2253 is format strictly according to RFC2253
+ * constructor. RFC2253 is the format strictly according to RFC2253
* without extensions.
*
- * @param DN X.500 Distinguished Name
+ * @param dname the X.500 Distinguished Name
+ * @param format the specified format of the String DN
*/
public X500Name(String dname, String format) throws IOException {
if (dname == null) {
@@ -867,8 +866,8 @@
* O="Sue, Grabbit and Runn" or
* O=Sue\, Grabbit and Runn
*
- * This method can parse 1779 or 2253 DNs and non-standard 3280 keywords.
- * Additional keywords can be specified in the keyword/OID map.
+ * This method can parse RFC 1779, 2253 or 4514 DNs and non-standard 3280
+ * keywords. Additional keywords can be specified in the keyword/OID map.
*/
private void parseDN(String input, Map<String, String> keywordMap)
throws IOException {
@@ -877,7 +876,7 @@
return;
}
- List<RDN> dnVector = new ArrayList<RDN>();
+ List<RDN> dnVector = new ArrayList<>();
int dnOffset = 0;
int rdnEnd;
String rdnString;
@@ -947,52 +946,51 @@
if (dnString.length() == 0) {
names = new RDN[0];
return;
- }
-
- List<RDN> dnVector = new ArrayList<RDN>();
- int dnOffset = 0;
- String rdnString;
+ }
- int searchOffset = 0;
- int rdnEnd = dnString.indexOf(',');
- while (rdnEnd >=0) {
- /*
- * We have encountered an RDN delimiter (comma).
- * If the comma in the RDN under consideration is
- * preceded by a backslash (escape), it
- * is part of the RDN. Otherwise, it is used as a separator, to
- * delimit the RDN under consideration from any subsequent RDNs.
- */
- if (rdnEnd > 0 && !escaped(rdnEnd, searchOffset, dnString)) {
+ List<RDN> dnVector = new ArrayList<>();
+ int dnOffset = 0;
+ String rdnString;
+ int searchOffset = 0;
+ int rdnEnd = dnString.indexOf(',');
+ while (rdnEnd >=0) {
+ /*
+ * We have encountered an RDN delimiter (comma).
+ * If the comma in the RDN under consideration is
+ * preceded by a backslash (escape), it
+ * is part of the RDN. Otherwise, it is used as a separator, to
+ * delimit the RDN under consideration from any subsequent RDNs.
+ */
+ if (rdnEnd > 0 && !escaped(rdnEnd, searchOffset, dnString)) {
- /*
- * Comma is a separator
- */
- rdnString = dnString.substring(dnOffset, rdnEnd);
+ /*
+ * Comma is a separator
+ */
+ rdnString = dnString.substring(dnOffset, rdnEnd);
- // Parse RDN, and store it in vector
- RDN rdn = new RDN(rdnString, "RFC2253");
- dnVector.add(rdn);
+ // Parse RDN, and store it in vector
+ RDN rdn = new RDN(rdnString, "RFC2253");
+ dnVector.add(rdn);
- // Increase the offset
- dnOffset = rdnEnd + 1;
- }
+ // Increase the offset
+ dnOffset = rdnEnd + 1;
+ }
- searchOffset = rdnEnd + 1;
- rdnEnd = dnString.indexOf(',', searchOffset);
- }
+ searchOffset = rdnEnd + 1;
+ rdnEnd = dnString.indexOf(',', searchOffset);
+ }
- // Parse last or only RDN, and store it in vector
- rdnString = dnString.substring(dnOffset);
- RDN rdn = new RDN(rdnString, "RFC2253");
- dnVector.add(rdn);
+ // Parse last or only RDN, and store it in vector
+ rdnString = dnString.substring(dnOffset);
+ RDN rdn = new RDN(rdnString, "RFC2253");
+ dnVector.add(rdn);
- /*
- * Store the vector elements as an array of RDNs
- * NOTE: It's only on output that little-endian ordering is used.
- */
- Collections.reverse(dnVector);
- names = dnVector.toArray(new RDN[dnVector.size()]);
+ /*
+ * Store the vector elements as an array of RDNs
+ * NOTE: It's only on output that little-endian ordering is used.
+ */
+ Collections.reverse(dnVector);
+ names = dnVector.toArray(new RDN[dnVector.size()]);
}
/*
@@ -1371,7 +1369,7 @@
/**
* Constructor object for use by asX500Principal().
*/
- private static final Constructor principalConstructor;
+ private static final Constructor<X500Principal> principalConstructor;
/**
* Field object for use by asX500Name().
@@ -1386,9 +1384,9 @@
PrivilegedExceptionAction<Object[]> pa =
new PrivilegedExceptionAction<Object[]>() {
public Object[] run() throws Exception {
- Class pClass = X500Principal.class;
- Class[] args = new Class[] {X500Name.class};
- Constructor cons = ((Class<?>)pClass).getDeclaredConstructor(args);
+ Class<X500Principal> pClass = X500Principal.class;
+ Class<?>[] args = new Class<?>[] { X500Name.class };
+ Constructor<X500Principal> cons = pClass.getDeclaredConstructor(args);
cons.setAccessible(true);
Field field = pClass.getDeclaredField("thisX500Name");
field.setAccessible(true);
@@ -1397,11 +1395,13 @@
};
try {
Object[] result = AccessController.doPrivileged(pa);
- principalConstructor = (Constructor)result[0];
+ @SuppressWarnings("unchecked")
+ Constructor<X500Principal> constr =
+ (Constructor<X500Principal>)result[0];
+ principalConstructor = constr;
principalField = (Field)result[1];
} catch (Exception e) {
- throw (InternalError)new InternalError("Could not obtain "
- + "X500Principal access").initCause(e);
+ throw new InternalError("Could not obtain X500Principal access", e);
}
}
@@ -1415,8 +1415,7 @@
if (x500Principal == null) {
try {
Object[] args = new Object[] {this};
- x500Principal =
- (X500Principal)principalConstructor.newInstance(args);
+ x500Principal = principalConstructor.newInstance(args);
} catch (Exception e) {
throw new RuntimeException("Unexpected exception", e);
}
--- a/jdk/src/share/classes/sun/security/x509/X509CRLEntryImpl.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/X509CRLEntryImpl.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -25,11 +25,9 @@
package sun.security.x509;
-import java.io.InputStream;
import java.io.IOException;
import java.security.cert.CRLException;
import java.security.cert.CRLReason;
-import java.security.cert.CertificateException;
import java.security.cert.X509CRLEntry;
import java.math.BigInteger;
import java.util.Collection;
@@ -281,7 +279,7 @@
if (obj == null)
return null;
CRLReasonCodeExtension reasonCode = (CRLReasonCodeExtension)obj;
- return (Integer)(reasonCode.get(reasonCode.REASON));
+ return reasonCode.get(CRLReasonCodeExtension.REASON);
}
/**
@@ -299,13 +297,13 @@
sb.append("\n Certificate issuer: " + certIssuer);
}
if (extensions != null) {
- Collection allEntryExts = extensions.getAllExtensions();
- Object[] objs = allEntryExts.toArray();
+ Collection<Extension> allEntryExts = extensions.getAllExtensions();
+ Extension[] exts = allEntryExts.toArray(new Extension[0]);
- sb.append("\n CRL Entry Extensions: " + objs.length);
- for (int i = 0; i < objs.length; i++) {
+ sb.append("\n CRL Entry Extensions: " + exts.length);
+ for (int i = 0; i < exts.length; i++) {
sb.append("\n [" + (i+1) + "]: ");
- Extension ext = (Extension)objs[i];
+ Extension ext = exts[i];
try {
if (OIDMap.getClass(ext.getExtensionId()) == null) {
sb.append(ext.toString());
@@ -409,7 +407,7 @@
e.hasMoreElements();) {
ex = e.nextElement();
inCertOID = ex.getExtensionId();
- if (inCertOID.equals(findOID)) {
+ if (inCertOID.equals((Object)findOID)) {
crlExt = ex;
break;
}
--- a/jdk/src/share/classes/sun/security/x509/X509CRLImpl.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/X509CRLImpl.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -32,7 +32,6 @@
import java.security.Principal;
import java.security.PublicKey;
import java.security.PrivateKey;
-import java.security.Security;
import java.security.Signature;
import java.security.NoSuchAlgorithmException;
import java.security.InvalidKeyException;
@@ -782,7 +781,8 @@
public KeyIdentifier getAuthKeyId() throws IOException {
AuthorityKeyIdentifierExtension aki = getAuthKeyIdExtension();
if (aki != null) {
- KeyIdentifier keyId = (KeyIdentifier)aki.get(aki.KEY_ID);
+ KeyIdentifier keyId = (KeyIdentifier)aki.get(
+ AuthorityKeyIdentifierExtension.KEY_ID);
return keyId;
} else {
return null;
@@ -821,7 +821,7 @@
public BigInteger getCRLNumber() throws IOException {
CRLNumberExtension numExt = getCRLNumberExtension();
if (numExt != null) {
- BigInteger num = (BigInteger)numExt.get(numExt.NUMBER);
+ BigInteger num = numExt.get(CRLNumberExtension.NUMBER);
return num;
} else {
return null;
@@ -850,7 +850,7 @@
public BigInteger getBaseCRLNumber() throws IOException {
DeltaCRLIndicatorExtension dciExt = getDeltaCRLIndicatorExtension();
if (dciExt != null) {
- BigInteger num = (BigInteger)dciExt.get(dciExt.NUMBER);
+ BigInteger num = dciExt.get(DeltaCRLIndicatorExtension.NUMBER);
return num;
} else {
return null;
@@ -961,7 +961,7 @@
e.hasMoreElements();) {
ex = e.nextElement();
inCertOID = ex.getExtensionId();
- if (inCertOID.equals(findOID)) {
+ if (inCertOID.equals((Object)findOID)) {
crlExt = ex;
break;
}
@@ -1189,8 +1189,7 @@
CertificateIssuerExtension ciExt =
entry.getCertificateIssuerExtension();
if (ciExt != null) {
- GeneralNames names = (GeneralNames)
- ciExt.get(CertificateIssuerExtension.ISSUER);
+ GeneralNames names = ciExt.get(CertificateIssuerExtension.ISSUER);
X500Name issuerDN = (X500Name) names.get(0).getName();
return issuerDN.asX500Principal();
} else {
--- a/jdk/src/share/classes/sun/security/x509/X509CertImpl.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/X509CertImpl.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -196,10 +196,7 @@
parse(new DerValue(certData));
} catch (IOException e) {
signedCert = null;
- CertificateException ce = new
- CertificateException("Unable to initialize, " + e);
- ce.initCause(e);
- throw ce;
+ throw new CertificateException("Unable to initialize, " + e, e);
}
}
@@ -231,25 +228,19 @@
inBuffered.reset();
der = new DerValue(inBuffered);
} catch (IOException ioe1) {
- CertificateException ce = new
- CertificateException("Input stream must be " +
- "either DER-encoded bytes " +
- "or RFC1421 hex-encoded " +
- "DER-encoded bytes: " +
- ioe1.getMessage());
- ce.initCause(ioe1);
- throw ce;
+ throw new CertificateException("Input stream must be " +
+ "either DER-encoded bytes " +
+ "or RFC1421 hex-encoded " +
+ "DER-encoded bytes: " +
+ ioe1.getMessage(), ioe1);
}
}
try {
parse(der);
} catch (IOException ioe) {
signedCert = null;
- CertificateException ce = new
- CertificateException("Unable to parse DER value of " +
- "certificate, " + ioe);
- ce.initCause(ioe);
- throw ce;
+ throw new CertificateException("Unable to parse DER value of " +
+ "certificate, " + ioe, ioe);
}
}
@@ -320,10 +311,7 @@
parse(derVal);
} catch (IOException e) {
signedCert = null;
- CertificateException ce = new
- CertificateException("Unable to initialize, " + e);
- ce.initCause(e);
- throw ce;
+ throw new CertificateException("Unable to initialize, " + e, e);
}
}
@@ -1279,7 +1267,7 @@
return null;
} else {
for (Extension ex : extensions.getAllExtensions()) {
- if (ex.getExtensionId().equals(oid)) {
+ if (ex.getExtensionId().equals((Object)oid)) {
//XXXX May want to consider cloning this
return ex;
}
@@ -1434,10 +1422,7 @@
new ExtendedKeyUsageExtension(Boolean.FALSE, data);
return Collections.unmodifiableList(ekuExt.getExtendedKeyUsage());
} catch (IOException ioe) {
- CertificateParsingException cpe =
- new CertificateParsingException();
- cpe.initCause(ioe);
- throw cpe;
+ throw new CertificateParsingException(ioe);
}
}
@@ -1578,8 +1563,8 @@
}
GeneralNames names;
try {
- names = (GeneralNames) subjectAltNameExt.get
- (SubjectAlternativeNameExtension.SUBJECT_NAME);
+ names = subjectAltNameExt.get(
+ SubjectAlternativeNameExtension.SUBJECT_NAME);
} catch (IOException ioe) {
// should not occur
return Collections.<List<?>>emptySet();
@@ -1610,18 +1595,15 @@
GeneralNames names;
try {
- names = (GeneralNames) subjectAltNameExt.get
- (SubjectAlternativeNameExtension.SUBJECT_NAME);
+ names = subjectAltNameExt.get(
+ SubjectAlternativeNameExtension.SUBJECT_NAME);
} catch (IOException ioe) {
// should not occur
return Collections.<List<?>>emptySet();
}
return makeAltNames(names);
} catch (IOException ioe) {
- CertificateParsingException cpe =
- new CertificateParsingException();
- cpe.initCause(ioe);
- throw cpe;
+ throw new CertificateParsingException(ioe);
}
}
@@ -1644,8 +1626,8 @@
}
GeneralNames names;
try {
- names = (GeneralNames) issuerAltNameExt.get
- (IssuerAlternativeNameExtension.ISSUER_NAME);
+ names = issuerAltNameExt.get(
+ IssuerAlternativeNameExtension.ISSUER_NAME);
} catch (IOException ioe) {
// should not occur
return Collections.<List<?>>emptySet();
@@ -1676,18 +1658,15 @@
data);
GeneralNames names;
try {
- names = (GeneralNames) issuerAltNameExt.get
- (IssuerAlternativeNameExtension.ISSUER_NAME);
+ names = issuerAltNameExt.get(
+ IssuerAlternativeNameExtension.ISSUER_NAME);
} catch (IOException ioe) {
// should not occur
return Collections.<List<?>>emptySet();
}
return makeAltNames(names);
} catch (IOException ioe) {
- CertificateParsingException cpe =
- new CertificateParsingException();
- cpe.initCause(ioe);
- throw cpe;
+ throw new CertificateParsingException(ioe);
}
}
--- a/jdk/src/share/classes/sun/security/x509/X509CertInfo.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/X509CertInfo.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -149,10 +149,7 @@
parse(in);
} catch (IOException e) {
- CertificateParsingException parseException =
- new CertificateParsingException(e.toString());
- parseException.initCause(e);
- throw parseException;
+ throw new CertificateParsingException(e);
}
}
@@ -168,10 +165,7 @@
try {
parse(derVal);
} catch (IOException e) {
- CertificateParsingException parseException =
- new CertificateParsingException(e.toString());
- parseException.initCause(e);
- throw parseException;
+ throw new CertificateParsingException(e);
}
}
@@ -319,12 +313,12 @@
sb.append(" Subject Id:\n" + subjectUniqueId.toString() + "\n");
}
if (extensions != null) {
- Collection allExts = extensions.getAllExtensions();
- Object[] objs = allExts.toArray();
- sb.append("\nCertificate Extensions: " + objs.length);
- for (int i = 0; i < objs.length; i++) {
+ Collection<Extension> allExts = extensions.getAllExtensions();
+ Extension[] exts = allExts.toArray(new Extension[0]);
+ sb.append("\nCertificate Extensions: " + exts.length);
+ for (int i = 0; i < exts.length; i++) {
sb.append("\n[" + (i+1) + "]: ");
- Extension ext = (Extension)objs[i];
+ Extension ext = exts[i];
try {
if (OIDMap.getClass(ext.getExtensionId()) == null) {
sb.append(ext.toString());
@@ -766,8 +760,8 @@
try {
subjectAltNameExt = (SubjectAlternativeNameExtension)
extensions.get(SubjectAlternativeNameExtension.NAME);
- names = (GeneralNames) subjectAltNameExt.get
- (SubjectAlternativeNameExtension.SUBJECT_NAME);
+ names = subjectAltNameExt.get(
+ SubjectAlternativeNameExtension.SUBJECT_NAME);
} catch (IOException e) {
throw new CertificateParsingException("X.509 Certificate is " +
"incomplete: subject field is empty, and " +
--- a/jdk/src/share/classes/sun/security/x509/X509Key.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/security/x509/X509Key.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -31,7 +31,6 @@
import java.security.Key;
import java.security.PublicKey;
import java.security.KeyFactory;
-import java.security.KeyRep;
import java.security.Security;
import java.security.Provider;
import java.security.InvalidKeyException;
@@ -245,7 +244,7 @@
throw new InstantiationException();
}
- Class keyClass = null;
+ Class<?> keyClass = null;
try {
keyClass = Class.forName(classname);
} catch (ClassNotFoundException e) {
--- a/jdk/src/share/classes/sun/swing/PrintingStatus.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/swing/PrintingStatus.java Wed Jul 05 17:49:56 2017 +0200
@@ -43,8 +43,8 @@
* <p/>
* Methods of these class are thread safe, although most Swing methods
* are not. Please see
- * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
- * to Use Threads</A> for more information.
+ * <A HREF="http://download.oracle.com/javase/tutorial/uiswing/concurrency/index.html">Concurrency
+ * in Swing</A> for more information.
*
* @author Alexander Potochkin
* @since 1.6
--- a/jdk/src/share/classes/sun/tools/jconsole/ProxyClient.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/classes/sun/tools/jconsole/ProxyClient.java Wed Jul 05 17:49:56 2017 +0200
@@ -208,7 +208,7 @@
serverStubClass = Class.forName(rmiServerImplStubClassName).asSubclass(Remote.class);
} catch (ClassNotFoundException e) {
// should never reach here
- throw (InternalError) new InternalError(e.getMessage()).initCause(e);
+ throw new InternalError(e.getMessage(), e);
}
rmiServerImplStubClass = serverStubClass;
}
@@ -395,18 +395,10 @@
} catch (MalformedObjectNameException e) {
// should not reach here
throw new InternalError(e.getMessage());
- } catch (IntrospectionException e) {
- InternalError ie = new InternalError(e.getMessage());
- ie.initCause(e);
- throw ie;
- } catch (InstanceNotFoundException e) {
- InternalError ie = new InternalError(e.getMessage());
- ie.initCause(e);
- throw ie;
- } catch (ReflectionException e) {
- InternalError ie = new InternalError(e.getMessage());
- ie.initCause(e);
- throw ie;
+ } catch (IntrospectionException |
+ InstanceNotFoundException |
+ ReflectionException e) {
+ throw new InternalError(e.getMessage(), e);
}
if (hasPlatformMXBeans) {
--- a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java Wed Jul 05 17:49:56 2017 +0200
@@ -40,6 +40,7 @@
package com.sun.nio.zipfs;
+import java.io.BufferedOutputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.EOFException;
@@ -1174,7 +1175,6 @@
// sync the zip file system, if there is any udpate
private void sync() throws IOException {
//System.out.printf("->sync(%s) starting....!%n", toString());
-
// check ex-closer
if (!exChClosers.isEmpty()) {
for (ExChannelCloser ecc : exChClosers) {
@@ -1188,84 +1188,84 @@
if (!hasUpdate)
return;
Path tmpFile = createTempFileInSameDirectoryAs(zfpath);
- OutputStream os = Files.newOutputStream(tmpFile, WRITE);
- ArrayList<Entry> elist = new ArrayList<>(inodes.size());
- long written = 0;
- byte[] buf = new byte[8192];
- Entry e = null;
+ try (OutputStream os = new BufferedOutputStream(Files.newOutputStream(tmpFile, WRITE)))
+ {
+ ArrayList<Entry> elist = new ArrayList<>(inodes.size());
+ long written = 0;
+ byte[] buf = new byte[8192];
+ Entry e = null;
- // write loc
- for (IndexNode inode : inodes.values()) {
- if (inode instanceof Entry) { // an updated inode
- e = (Entry)inode;
- try {
- if (e.type == Entry.COPY) {
- // entry copy: the only thing changed is the "name"
- // and "nlen" in LOC header, so we udpate/rewrite the
- // LOC in new file and simply copy the rest (data and
- // ext) without enflating/deflating from the old zip
- // file LOC entry.
- written += copyLOCEntry(e, true, os, written, buf);
- } else { // NEW, FILECH or CEN
- e.locoff = written;
- written += e.writeLOC(os); // write loc header
- if (e.bytes != null) { // in-memory, deflated
- os.write(e.bytes); // already
- written += e.bytes.length;
- } else if (e.file != null) { // tmp file
- try (InputStream is = Files.newInputStream(e.file)) {
- int n;
- if (e.type == Entry.NEW) { // deflated already
- while ((n = is.read(buf)) != -1) {
- os.write(buf, 0, n);
- written += n;
+ // write loc
+ for (IndexNode inode : inodes.values()) {
+ if (inode instanceof Entry) { // an updated inode
+ e = (Entry)inode;
+ try {
+ if (e.type == Entry.COPY) {
+ // entry copy: the only thing changed is the "name"
+ // and "nlen" in LOC header, so we udpate/rewrite the
+ // LOC in new file and simply copy the rest (data and
+ // ext) without enflating/deflating from the old zip
+ // file LOC entry.
+ written += copyLOCEntry(e, true, os, written, buf);
+ } else { // NEW, FILECH or CEN
+ e.locoff = written;
+ written += e.writeLOC(os); // write loc header
+ if (e.bytes != null) { // in-memory, deflated
+ os.write(e.bytes); // already
+ written += e.bytes.length;
+ } else if (e.file != null) { // tmp file
+ try (InputStream is = Files.newInputStream(e.file)) {
+ int n;
+ if (e.type == Entry.NEW) { // deflated already
+ while ((n = is.read(buf)) != -1) {
+ os.write(buf, 0, n);
+ written += n;
+ }
+ } else if (e.type == Entry.FILECH) {
+ // the data are not deflated, use ZEOS
+ try (OutputStream os2 = new EntryOutputStream(e, os)) {
+ while ((n = is.read(buf)) != -1) {
+ os2.write(buf, 0, n);
+ }
+ }
+ written += e.csize;
+ if ((e.flag & FLAG_DATADESCR) != 0)
+ written += e.writeEXT(os);
}
- } else if (e.type == Entry.FILECH) {
- // the data are not deflated, use ZEOS
- try (OutputStream os2 = new EntryOutputStream(e, os)) {
- while ((n = is.read(buf)) != -1) {
- os2.write(buf, 0, n);
- }
- }
- written += e.csize;
- if ((e.flag & FLAG_DATADESCR) != 0)
- written += e.writeEXT(os);
}
+ Files.delete(e.file);
+ tmppaths.remove(e.file);
+ } else {
+ // dir, 0-length data
}
- Files.delete(e.file);
- tmppaths.remove(e.file);
- } else {
- // dir, 0-length data
}
+ elist.add(e);
+ } catch (IOException x) {
+ x.printStackTrace(); // skip any in-accurate entry
}
- elist.add(e);
- } catch (IOException x) {
- x.printStackTrace(); // skip any in-accurate entry
- }
- } else { // unchanged inode
- if (inode.pos == -1) {
- continue; // pseudo directory node
- }
- e = Entry.readCEN(this, inode.pos);
- try {
- written += copyLOCEntry(e, false, os, written, buf);
- elist.add(e);
- } catch (IOException x) {
- x.printStackTrace(); // skip any wrong entry
+ } else { // unchanged inode
+ if (inode.pos == -1) {
+ continue; // pseudo directory node
+ }
+ e = Entry.readCEN(this, inode.pos);
+ try {
+ written += copyLOCEntry(e, false, os, written, buf);
+ elist.add(e);
+ } catch (IOException x) {
+ x.printStackTrace(); // skip any wrong entry
+ }
}
}
+
+ // now write back the cen and end table
+ end.cenoff = written;
+ for (Entry entry : elist) {
+ written += entry.writeCEN(os);
+ }
+ end.centot = elist.size();
+ end.cenlen = written - end.cenoff;
+ end.write(os, written);
}
-
- // now write back the cen and end table
- end.cenoff = written;
- for (Entry entry : elist) {
- written += entry.writeCEN(os);
- }
- end.centot = elist.size();
- end.cenlen = written - end.cenoff;
- end.write(os, written);
- os.close();
-
if (!streams.isEmpty()) {
//
// TBD: ExChannelCloser should not be necessary if we only
@@ -1968,7 +1968,7 @@
writeBytes(os, name);
if (elen64 != 0) {
writeShort(os, EXTID_ZIP64);// Zip64 extra
- writeShort(os, elen64); // size of "this" extra block
+ writeShort(os, elen64 - 4); // size of "this" extra block
if (size0 == ZIP64_MINVAL)
writeLong(os, size);
if (csize0 == ZIP64_MINVAL)
--- a/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java Wed Jul 05 17:49:56 2017 +0200
@@ -1532,6 +1532,10 @@
}
public synchronized void addPropertyChangeListener(String name, PropertyChangeListener pcl) {
+ if (name == null) {
+ // See JavaDoc for the Toolkit.addPropertyChangeListener() method
+ return;
+ }
initXSettingsIfNeeded(name);
super.addPropertyChangeListener(name, pcl);
}
--- a/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java Wed Jul 05 17:49:56 2017 +0200
@@ -95,11 +95,11 @@
}
// Now check for XRender system property
- boolean xRenderRequested = false;
+ boolean xRenderRequested = true;
String xProp = System.getProperty("sun.java2d.xrender");
if (xProp != null) {
- if (xProp.equals("true") || xProp.equals("t")) {
- xRenderRequested = true;
+ if (xProp.equals("false") || xProp.equals("f")) {
+ xRenderRequested = false;
} else if (xProp.equals("True") || xProp.equals("T")) {
xRenderRequested = true;
xRenderVerbose = true;
--- a/jdk/src/solaris/classes/sun/nio/ch/InheritedChannel.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/solaris/classes/sun/nio/ch/InheritedChannel.java Wed Jul 05 17:49:56 2017 +0200
@@ -166,8 +166,8 @@
// is implemented.
Class paramTypes[] = { int.class };
- Constructor ctr = Reflect.lookupConstructor("java.io.FileDescriptor",
- paramTypes);
+ Constructor<?> ctr = Reflect.lookupConstructor("java.io.FileDescriptor",
+ paramTypes);
Object args[] = { new Integer(fdVal) };
FileDescriptor fd = (FileDescriptor)Reflect.invoke(ctr, args);
--- a/jdk/src/solaris/classes/sun/nio/fs/LinuxWatchService.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/solaris/classes/sun/nio/fs/LinuxWatchService.java Wed Jul 05 17:49:56 2017 +0200
@@ -58,7 +58,10 @@
try {
ifd = inotifyInit();
} catch (UnixException x) {
- throw new IOException(x.errorString());
+ String msg = (x.errno() == EMFILE) ?
+ "User limit of inotify instances reached or too many open files" :
+ x.errorString();
+ throw new IOException(msg);
}
// configure inotify to be non-blocking
--- a/jdk/src/solaris/lib/content-types.properties Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/solaris/lib/content-types.properties Wed Jul 05 17:49:56 2017 +0200
@@ -225,6 +225,10 @@
icon=png;\
action=browser
+image/bmp: \
+ description=Bitmap Image;\
+ file_extensions=.bmp;
+
text/html: \
description=HTML Document;\
file_extensions=.htm,.html;\
--- a/jdk/src/solaris/native/sun/nio/fs/genUnixConstants.c Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/solaris/native/sun/nio/fs/genUnixConstants.c Wed Jul 05 17:49:56 2017 +0200
@@ -108,6 +108,7 @@
DEF(EROFS);
DEF(ENODATA);
DEF(ERANGE);
+ DEF(EMFILE);
// flags used with openat/unlinkat/etc.
#if defined(AT_SYMLINK_NOFOLLOW) && defined(AT_REMOVEDIR)
--- a/jdk/src/windows/classes/sun/awt/windows/WToolkit.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/windows/classes/sun/awt/windows/WToolkit.java Wed Jul 05 17:49:56 2017 +0200
@@ -879,6 +879,10 @@
}
public synchronized void addPropertyChangeListener(String name, PropertyChangeListener pcl) {
+ if (name == null) {
+ // See JavaDoc for the Toolkit.addPropertyChangeListener() method
+ return;
+ }
if ( WDesktopProperties.isWindowsProperty(name)
|| name.startsWith(awtPrefix)
|| name.startsWith(dndPrefix))
--- a/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java Wed Jul 05 17:49:56 2017 +0200
@@ -55,9 +55,7 @@
try {
return new Iocp(null, ThreadPool.createDefault()).start();
} catch (IOException ioe) {
- InternalError e = new InternalError();
- e.initCause(ioe);
- throw e;
+ throw new InternalError(ioe);
}
}
}
--- a/jdk/src/windows/classes/sun/security/mscapi/KeyStore.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/windows/classes/sun/security/mscapi/KeyStore.java Wed Jul 05 17:49:56 2017 +0200
@@ -29,7 +29,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
-import java.math.BigInteger;
import java.security.AccessController;
import java.security.InvalidKeyException;
import java.security.KeyStoreSpi;
@@ -40,7 +39,6 @@
import java.security.cert.X509Certificate;
import java.security.cert.Certificate;
import java.security.cert.CertificateException;
-import java.security.cert.CertificateEncodingException;
import java.security.cert.CertificateFactory;
import java.security.interfaces.RSAPrivateCrtKey;
import java.util.ArrayList;
@@ -564,20 +562,20 @@
*
* @return enumeration of the alias names
*/
- public Enumeration engineAliases() {
+ public Enumeration<String> engineAliases() {
- final Iterator iter = entries.iterator();
+ final Iterator<KeyEntry> iter = entries.iterator();
- return new Enumeration()
+ return new Enumeration<String>()
{
public boolean hasMoreElements()
{
return iter.hasNext();
}
- public Object nextElement()
+ public String nextElement()
{
- KeyEntry entry = (KeyEntry) iter.next();
+ KeyEntry entry = iter.next();
return entry.getAlias();
}
};
@@ -591,10 +589,10 @@
* @return true if the alias exists, false otherwise
*/
public boolean engineContainsAlias(String alias) {
- for (Enumeration enumerator = engineAliases();
+ for (Enumeration<String> enumerator = engineAliases();
enumerator.hasMoreElements();)
{
- String a = (String) enumerator.nextElement();
+ String a = enumerator.nextElement();
if (a.equals(alias))
return true;
@@ -774,7 +772,8 @@
* certificates and stores the result into a key entry.
*/
private void generateCertificateChain(String alias,
- Collection certCollection, Collection<KeyEntry> entries)
+ Collection<? extends Certificate> certCollection,
+ Collection<KeyEntry> entries)
{
try
{
@@ -782,7 +781,8 @@
new X509Certificate[certCollection.size()];
int i = 0;
- for (Iterator iter=certCollection.iterator(); iter.hasNext(); i++)
+ for (Iterator<? extends Certificate> iter =
+ certCollection.iterator(); iter.hasNext(); i++)
{
certChain[i] = (X509Certificate) iter.next();
}
@@ -805,7 +805,8 @@
*/
private void generateRSAKeyAndCertificateChain(String alias,
long hCryptProv, long hCryptKey, int keyLength,
- Collection certCollection, Collection<KeyEntry> entries)
+ Collection<? extends Certificate> certCollection,
+ Collection<KeyEntry> entries)
{
try
{
@@ -813,7 +814,8 @@
new X509Certificate[certCollection.size()];
int i = 0;
- for (Iterator iter=certCollection.iterator(); iter.hasNext(); i++)
+ for (Iterator<? extends Certificate> iter =
+ certCollection.iterator(); iter.hasNext(); i++)
{
certChain[i] = (X509Certificate) iter.next();
}
@@ -837,8 +839,8 @@
* @param data Byte data.
* @param certCollection Collection of certificates.
*/
- private void generateCertificate(byte[] data, Collection certCollection)
- {
+ private void generateCertificate(byte[] data,
+ Collection<Certificate> certCollection) {
try
{
ByteArrayInputStream bis = new ByteArrayInputStream(data);
@@ -849,7 +851,8 @@
}
// Generate certificate
- Collection c = certificateFactory.generateCertificates(bis);
+ Collection<? extends Certificate> c =
+ certificateFactory.generateCertificates(bis);
certCollection.addAll(c);
}
catch (CertificateException e)
--- a/jdk/src/windows/classes/sun/security/mscapi/PRNG.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/windows/classes/sun/security/mscapi/PRNG.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -37,8 +37,7 @@
public final class PRNG extends SecureRandomSpi
implements java.io.Serializable {
- // TODO - generate the serialVersionUID
- //private static final long serialVersionUID = XXX;
+ private static final long serialVersionUID = 4129268715132691532L;
/*
* The CryptGenRandom function fills a buffer with cryptographically random
--- a/jdk/src/windows/classes/sun/security/mscapi/RSAPrivateKey.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/windows/classes/sun/security/mscapi/RSAPrivateKey.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -35,6 +35,8 @@
*/
class RSAPrivateKey extends Key implements PrivateKey
{
+ private static final long serialVersionUID = 8113152807912338063L;
+
/**
* Construct an RSAPrivateKey object.
*/
--- a/jdk/src/windows/classes/sun/security/mscapi/RSAPublicKey.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/windows/classes/sun/security/mscapi/RSAPublicKey.java Wed Jul 05 17:49:56 2017 +0200
@@ -26,11 +26,9 @@
package sun.security.mscapi;
import java.math.BigInteger;
-import java.security.InvalidKeyException;
import java.security.KeyException;
import java.security.KeyRep;
import java.security.ProviderException;
-import java.security.PublicKey;
import sun.security.rsa.RSAPublicKeyImpl;
@@ -41,6 +39,8 @@
*/
class RSAPublicKey extends Key implements java.security.interfaces.RSAPublicKey
{
+ private static final long serialVersionUID = -2289561342425825391L;
+
private byte[] publicKeyBlob = null;
private byte[] encoding = null;
private BigInteger modulus = null;
--- a/jdk/src/windows/classes/sun/security/mscapi/RSASignature.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/windows/classes/sun/security/mscapi/RSASignature.java Wed Jul 05 17:49:56 2017 +0200
@@ -30,14 +30,10 @@
import java.security.PrivateKey;
import java.security.InvalidKeyException;
import java.security.InvalidParameterException;
-import java.security.InvalidAlgorithmParameterException;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.ProviderException;
import java.security.MessageDigest;
-import java.security.SecureRandom;
-import java.security.Signature;
-import java.security.SignatureSpi;
import java.security.SignatureException;
import java.math.BigInteger;
@@ -474,6 +470,7 @@
* #engineSetParameter(java.security.spec.AlgorithmParameterSpec)
* engineSetParameter}.
*/
+ @Deprecated
protected void engineSetParameter(String param, Object value)
throws InvalidParameterException
{
@@ -503,6 +500,7 @@
*
* @deprecated
*/
+ @Deprecated
protected Object engineGetParameter(String param)
throws InvalidParameterException
{
--- a/jdk/src/windows/classes/sun/security/mscapi/SunMSCAPI.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/windows/classes/sun/security/mscapi/SunMSCAPI.java Wed Jul 05 17:49:56 2017 +0200
@@ -28,7 +28,6 @@
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.security.Provider;
-import java.security.ProviderException;
import java.util.HashMap;
import java.util.Map;
@@ -62,8 +61,9 @@
// if there is no security manager installed, put directly into
// the provider. Otherwise, create a temporary map and use a
// doPrivileged() call at the end to transfer the contents
- final Map map = (System.getSecurityManager() == null)
- ? (Map)this : new HashMap();
+ final Map<Object, Object> map =
+ (System.getSecurityManager() == null)
+ ? this : new HashMap<Object, Object>();
/*
* Secure random
--- a/jdk/src/windows/lib/content-types.properties Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/windows/lib/content-types.properties Wed Jul 05 17:49:56 2017 +0200
@@ -222,6 +222,10 @@
icon=png;\
action=browser
+image/bmp: \
+ description=Bitmap Image;\
+ file_extensions=.bmp;
+
text/html: \
description=HTML Document;\
file_extensions=.htm,.html;\
--- a/jdk/src/windows/native/java/lang/java_props_md.c Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/src/windows/native/java/lang/java_props_md.c Wed Jul 05 17:49:56 2017 +0200
@@ -563,6 +563,18 @@
{
char * display_encoding;
+ // Windows UI Language selection list only cares "language"
+ // information of the UI Language. For example, the list
+ // just lists "English" but it actually means "en_US", and
+ // the user cannot select "en_GB" (if exists) in the list.
+ // So, this hack is to use the user LCID region information
+ // for the UI Language, if the "language" portion of those
+ // two locales are the same.
+ if (PRIMARYLANGID(LANGIDFROMLCID(userDefaultLCID)) ==
+ PRIMARYLANGID(LANGIDFROMLCID(userDefaultUILang))) {
+ userDefaultUILang = userDefaultLCID;
+ }
+
SetupI18nProps(userDefaultUILang,
&sprops.language,
&sprops.script,
--- a/jdk/test/Makefile Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/Makefile Wed Jul 05 17:49:56 2017 +0200
@@ -544,7 +544,7 @@
jdk_security3: $(call TestDirs, com/sun/security lib/security \
javax/security sun/security)
$(call SharedLibraryPermissions,sun/security)
- $(call RunOthervmBatch)
+ $(call RunSamevmBatch)
# All security tests
jdk_security: jdk_security1 jdk_security2 jdk_security3
--- a/jdk/test/ProblemList.txt Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/ProblemList.txt Wed Jul 05 17:49:56 2017 +0200
@@ -198,10 +198,19 @@
# requires junit
java/lang/invoke/InvokeDynamicPrintArgs.java generic-all
+# 7079093
+java/lang/instrument/ManifestTest.sh windows-all
+
############################################################################
# jdk_management
+# 6944188
+java/lang/management/ThreadMXBean/ThreadStateTest.java generic-all
+
+# 7067973
+java/lang/management/MemoryMXBean/CollectionUsageThreshold.java generic-all
+
# Failing, bug was filed: 6959636
javax/management/loading/LibraryLoader/LibraryLoaderTest.java generic-all
@@ -362,6 +371,15 @@
# Filed 7036666
com/sun/net/httpserver/Test9a.java generic-all
+# 7079145 java/net/ipv6tests/UdpTest.java hang at IPv6 only data exchange
+java/net/ipv6tests/UdpTest.java linux-all
+
+# 7079012
+java/net/NetworkInterface/NetParamsTest.java solaris-all
+
+# 7081476
+java/net/InetSocketAddress/B6469803.java generic-all
+
############################################################################
# jdk_io
@@ -369,6 +387,12 @@
# 6962637
java/io/File/MaxPathLength.java windows-all
+# 6671616
+java/io/File/BlockIsDirectory.java solaris-all
+
+# 7076644
+java/io/File/Basic.java windows-all
+
############################################################################
# jdk_nio
@@ -376,6 +400,9 @@
# 6963118
java/nio/channels/Selector/Wakeup.java windows-all
+# 7076700
+java/nio/channels/SocketChannel/AdaptSocket.java generic-all
+
############################################################################
# jdk_rmi
@@ -450,73 +477,20 @@
# jdk_security
-# Filed 6986868
-sun/security/tools/jarsigner/crl.sh generic-all
-
-# Filed 6951285, not sure how often this fails, last was Linux 64bit Fedora 9
-sun/security/krb5/auto/MaxRetries.java generic-all
-
-# Filed 6950930, fails on windows 32bit c1 and windows 64bit
-sun/security/krb5/auto/IgnoreChannelBinding.java windows-all
-
-# Filed 6950931, failing on all windows systems
-sun/security/tools/jarsigner/crl.sh windows-all
-
-# Filed 6950929, only seemed to fail on solaris sparcv9 (-d64)
-# Failed on Linux -server 32bit too, making generic
-sun/security/krb5/auto/BadKdc4.java generic-all
-
# Failing on Solaris i586, 3/9/2010, not a -samevm issue (jdk_security3)
sun/security/pkcs11/Secmod/AddPrivateKey.java solaris-i586
sun/security/pkcs11/ec/ReadCertificates.java solaris-i586
sun/security/pkcs11/ec/ReadPKCS12.java solaris-i586
sun/security/pkcs11/ec/TestCurves.java solaris-i586
sun/security/pkcs11/ec/TestECDSA.java solaris-i586
-sun/security/pkcs11/ec/TestECGenSpec.java solaris-i586
-sun/security/pkcs11/ec/TestKeyFactory.java solaris-i586
-
-# Failing on Solaris X64 (-d64 -server) with:
-# GSSException: Failure unspecified at GSS-API level
-# (Mechanism level: Specified version of key is not available (44))
-sun/security/krb5/auto/BasicKrb5Test.java generic-all
-
-# Solaris X86 failures, readjar.jks: No such file or directory
-sun/security/tools/keytool/readjar.sh generic-all
-
-# Fails with -ea -esa, but only on Solaris sparc? Suspect it is timing out
-sun/security/tools/keytool/standard.sh generic-all
-
-# Fails on Solaris 10 X64, address already in use
-sun/security/krb5/auto/HttpNegotiateServer.java generic-all
-
-# Fails on almost all platforms
-# java.lang.UnsupportedClassVersionError: SerialTest :
-# Unsupported major.minor version 51.0
-# at java.lang.ClassLoader.defineClass1(Native Method)
-sun/security/util/Oid/S11N.sh generic-all
+#sun/security/pkcs11/ec/TestECGenSpec.java solaris-i586
+#sun/security/pkcs11/ec/TestKeyFactory.java solaris-i586
+sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java solaris-i586
-# Fails on Fedora 9 32bit
-# GSSException: Failure unspecified at GSS-API level (Mechanism level:
-# Invalid argument (400) - Cannot find key of appropriate type to decrypt
-# AP REP - DES CBC mode with MD5)
-# at sun.security.jgss.krb5.Krb5Context.acceptSecContext(Krb5Context.java:778)
-sun/security/krb5/auto/NonMutualSpnego.java generic-all
-
-# Fails on Solaris 10 sparc, GSSException: Failure unspecified at GSS-API level
-# Also fails on Windows 2000 similar way
-sun/security/krb5/auto/ok-as-delegate.sh generic-all
+# Directly references PKCS11 class
+sun/security/pkcs11/Provider/Absolute.java windows-x64
-# Fails on Windows 2000, GSSException: Failure unspecified at GSS-API level
-# (Mechanism level: Request is a replay (34))
-sun/security/krb5/auto/ok-as-delegate-xrealm.sh generic-all
-
-# Fails on Windows 2000, ExceptionInInitializerError
-sun/security/mscapi/AccessKeyStore.sh generic-all
-
-# Fails on Solaris 10, KrbException: Additional pre-authentication required (25)
-sun/security/krb5/auto/basic.sh generic-all
-
-# Fails on Fedora 9 64bit, PKCS11Exception: CKR_DEVICE_ERROR
+# Fails on Fedora 9/Ubuntu 10.04 64bit, PKCS11Exception: CKR_DEVICE_ERROR
sun/security/pkcs11/KeyAgreement/TestDH.java generic-all
# Run too slow on Solaris 10 sparc
@@ -525,18 +499,10 @@
sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/ServerTimeout.java solaris-sparc
sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/ReadTimeout.java solaris-sparc
sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/NotifyHandshakeTest.sh solaris-sparc
-sun/security/tools/keytool/AltProviderPath.sh solaris-sparc
# Solaris 10 sparc, passed/failed confusion? java.security.ProviderException: update() failed
sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/AsyncSSLSocketClose.java generic-all
-# Seem really slow on Solaris sparc, being excluded just for timing reasons
-sun/security/tools/jarsigner/AlgOptions.sh solaris-sparc
-sun/security/tools/jarsigner/nameclash.sh solaris-sparc
-sun/security/krb5/auto/basic.sh solaris-sparc
-sun/security/provider/PolicyFile/getinstance/getinstance.sh solaris-sparc
-sun/security/tools/jarsigner/samename.sh solaris-sparc
-
# Othervm, sparc, NoRouteToHostException: Cannot assign requested address
sun/security/ssl/javax/net/ssl/NewAPIs/SessionCacheSizeTests.java generic-all
@@ -544,48 +510,21 @@
# Solaris sparc and sparcv9 -server, timeout
sun/security/ssl/javax/net/ssl/NewAPIs/SessionTimeOutTests.java generic-all
-# Failed on solaris 10 sparc, othervm mode, "js.jks: No such file or directory"
-# Also, cannot verify signature on solaris i586 -server
-sun/security/tools/jarsigner/concise_jarsigner.sh generic-all
-
# Various failures on Linux Fedora 9 X64, othervm mode
-lib/security/cacerts/VerifyCACerts.java generic-all
sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/TestAllSuites.java generic-all
sun/security/ssl/sanity/ciphersuites/CheckCipherSuites.java generic-all
-sun/security/tools/jarsigner/oldsig.sh generic-all
# Various failures on Linux Fedora 9 X64, othervm mode
sun/security/ssl/sanity/interop/ClientJSSEServerJSSE.java generic-all
-# Solaris sparcv9: Failed to parse input emptysubject.jks: No such file or directory
-sun/security/tools/keytool/emptysubject.sh generic-all
-
-# Fails on OpenSolaris, missing classes, slow on Solaris sparc
-sun/security/ec/TestEC.java generic-all
-
-# Problems with windows x64
-sun/security/mscapi/IsSunMSCAPIAvailable.sh windows-x64
-sun/security/mscapi/RSAEncryptDecrypt.sh windows-x64
-
-# Exception in test solaris-sparc -client -server, no windows
-sun/security/pkcs11/KeyGenerator/TestKeyGenerator.java solaris-all
+# 7079203 sun/security/tools/keytool/printssl.sh fails on solaris with timeout
+sun/security/tools/keytool/printssl.sh solaris-all
-# Solaris sparc client, fails to compile?
-sun/security/pkcs11/KeyStore/SecretKeysBasic.sh solaris-all
-
-# Fails on OpenSolaris java.net.BindException: Address already in use
-sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java generic-all
+# 7054637
+sun/security/tools/jarsigner/ec.sh solaris-all
-# Timeout on solaris-sparcv9 or ArrayIndexOutOfBoundsException?
-sun/security/rsa/TestKeyPairGeneratorLength.java solaris-all
-sun/security/rsa/TestSignatures.java solaris-all
-
-# Do not seem to run on windows machines? dll missing?
-sun/security/tools/jarsigner/emptymanifest.sh windows-all
-
-# Files does not exist or no encoding? solaris-sparcv9
-sun/security/tools/keytool/importreadall.sh solaris-all
-sun/security/tools/keytool/selfissued.sh solaris-all
+# 7081817
+sun/security/provider/certpath/X509CertPath/IllegalCertiticates.java generic-all
############################################################################
--- a/jdk/test/com/sun/security/auth/login/ConfigFile/IllegalURL.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/com/sun/security/auth/login/ConfigFile/IllegalURL.java Wed Jul 05 17:49:56 2017 +0200
@@ -43,8 +43,9 @@
static void use(String f) throws Exception {
System.out.println("Testing " + f + "...");
System.setProperty("java.security.auth.login.config", f);
- try {
- new FileInputStream(new URL(f).getFile().replace('/', File.separatorChar));
+ try (FileInputStream fis =
+ new FileInputStream(new URL(f).getFile().replace('/', File.separatorChar))) {
+ // do nothing
} catch (Exception e) {
System.out.println("Even old implementation does not support it. Ignored.");
return;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/com/sun/security/sasl/ntlm/Conformance.java Wed Jul 05 17:49:56 2017 +0200
@@ -0,0 +1,104 @@
+/*
+ * 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 7043847 7043860 7043882 7043938 7043959
+ * @summary NTML impl of SaslServer conformance errors
+ */
+import java.io.IOException;
+import javax.security.sasl.*;
+import java.util.*;
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+public class Conformance {
+
+ public static void main(String[] args) throws Exception {
+ try {
+ Sasl.createSaslClient(new String[] {"NTLM"}, "abc", "ldap",
+ "server", new HashMap<String, Object>(), null);
+ } catch (SaslException se) {
+ System.out.println(se);
+ }
+ try {
+ Sasl.createSaslServer("NTLM", "ldap",
+ "server", new HashMap<String, Object>(), null);
+ } catch (SaslException se) {
+ System.out.println(se);
+ }
+ try {
+ Sasl.createSaslClient(new String[] {"NTLM"}, "abc", "ldap",
+ "server", null, new CallbackHandler() {
+ @Override
+ public void handle(Callback[] callbacks) throws
+ IOException, UnsupportedCallbackException { }
+ });
+ } catch (SaslException se) {
+ System.out.println(se);
+ }
+ try {
+ SaslServer saslServer =
+ Sasl.createSaslServer("NTLM", "ldap", "abc", null, new CallbackHandler() {
+ @Override
+ public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { }
+ });
+ System.err.println("saslServer = " + saslServer);
+ System.err.println("saslServer.isComplete() = " + saslServer.isComplete());
+ // IllegalStateException is expected here
+ saslServer.getNegotiatedProperty("prop");
+ System.err.println("No IllegalStateException");
+ } catch (IllegalStateException se) {
+ System.out.println(se);
+ }
+ try {
+ SaslServer saslServer =
+ Sasl.createSaslServer("NTLM", "ldap", "abc", null, new CallbackHandler() {
+ @Override
+ public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { }
+ });
+ System.err.println("saslServer = " + saslServer);
+ System.err.println("saslServer.isComplete() = " + saslServer.isComplete());
+ // IllegalStateException is expected here
+ saslServer.getAuthorizationID();
+ System.err.println("No IllegalStateException");
+ } catch (IllegalStateException se) {
+ System.out.println(se);
+ }
+ try {
+ SaslServer saslServer =
+ Sasl.createSaslServer("NTLM", "ldap", "abc", null, new CallbackHandler() {
+ @Override
+ public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { }
+ });
+ System.err.println("saslServer = " + saslServer);
+ System.err.println("saslServer.isComplete() = " + saslServer.isComplete());
+ // IllegalStateException is expected here
+ saslServer.wrap(new byte[0], 0, 0);
+ System.err.println("No IllegalStateException");
+ } catch (IllegalStateException se) {
+ System.out.println(se);
+ }
+ }
+}
--- a/jdk/test/java/io/IOException/LastErrorString.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/java/io/IOException/LastErrorString.java Wed Jul 05 17:49:56 2017 +0200
@@ -23,6 +23,7 @@
/* @test
@bug 4167937
+ @ignore Test truncates system files when run as root, see 7042603
@summary Test code paths that use the JVM_LastErrorString procedure
*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/io/etc/FailingFlushAndClose.java Wed Jul 05 17:49:56 2017 +0200
@@ -0,0 +1,268 @@
+/*
+ * 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.
+ */
+
+import java.io.*;
+
+/**
+ * @test
+ * @bug 7015589
+ * @summary Test that buffering streams are considered closed even when the
+ * close or flush from the underlying stream fails.
+ */
+
+public class FailingFlushAndClose {
+
+ static int failed;
+
+ static void fail(String msg) {
+ System.err.println("FAIL: " + msg);
+ failed++;
+ }
+
+ static void failWithIOE(String msg) throws IOException {
+ fail(msg);
+ throw new IOException(msg);
+ }
+
+ static class FailingCloseInputStream extends InputStream {
+ boolean closed;
+ @Override
+ public int read()throws IOException {
+ if (closed)
+ failWithIOE("input stream is closed");
+ return 1;
+ }
+ @Override
+ public void close() throws IOException {
+ if (!closed) {
+ closed = true;
+ throw new IOException("close failed");
+ }
+ }
+ }
+
+ static class FailingCloseOutputStream extends OutputStream {
+ boolean closed;
+ @Override
+ public void write(int b) throws IOException {
+ if (closed)
+ failWithIOE("output stream is closed");
+ }
+ @Override
+ public void flush() throws IOException {
+ if (closed)
+ failWithIOE("output stream is closed");
+ }
+ @Override
+ public void close() throws IOException {
+ if (!closed) {
+ closed = true;
+ throw new IOException("close failed");
+ }
+ }
+ }
+
+ static class FailingFlushOutputStream extends OutputStream {
+ boolean closed;
+ @Override
+ public void write(int b) throws IOException {
+ if (closed)
+ failWithIOE("output stream is closed");
+ }
+ @Override
+ public void flush() throws IOException {
+ if (closed) {
+ failWithIOE("output stream is closed");
+ } else {
+ throw new IOException("flush failed");
+ }
+ }
+ @Override
+ public void close() throws IOException {
+ closed = true;
+ }
+ }
+
+ static class FailingCloseReader extends Reader {
+ boolean closed;
+ @Override
+ public int read(char[] cbuf, int off, int len) throws IOException {
+ if (closed)
+ failWithIOE("reader is closed");
+ return 1;
+ }
+ @Override
+ public void close() throws IOException {
+ if (!closed) {
+ closed = true;
+ throw new IOException("close failed");
+ }
+ }
+ }
+
+ static class FailingCloseWriter extends Writer {
+ boolean closed;
+ @Override
+ public void write(char[] cbuf, int off, int len) throws IOException {
+ if (closed)
+ failWithIOE("writer is closed");
+ }
+ @Override
+ public void flush() throws IOException {
+ if (closed)
+ failWithIOE("writer is closed");
+ }
+ @Override
+ public void close() throws IOException {
+ if (!closed) {
+ closed = true;
+ throw new IOException("close failed");
+ }
+ }
+ }
+
+ static class FailingFlushWriter extends Writer {
+ boolean closed;
+ @Override
+ public void write(char[] cbuf, int off, int len) throws IOException {
+ if (closed)
+ failWithIOE("writer is closed");
+ }
+ @Override
+ public void flush() throws IOException {
+ if (closed) {
+ failWithIOE("writer is closed");
+ } else {
+ throw new IOException("flush failed");
+ }
+ }
+ @Override
+ public void close() throws IOException {
+ if (!closed) {
+ closed = true;
+ throw new IOException("close failed");
+ }
+ }
+ }
+
+ static void testFailingClose(InputStream in) throws IOException {
+ System.out.println(in.getClass());
+ in.read(new byte[100]);
+ try {
+ in.close();
+ fail("close did not fail");
+ } catch (IOException expected) { }
+ try {
+ in.read(new byte[100]);
+ fail("read did not fail");
+ } catch (IOException expected) { }
+ }
+
+ static void testFailingClose(OutputStream out) throws IOException {
+ System.out.println(out.getClass());
+ out.write(1);
+ try {
+ out.close();
+ fail("close did not fail");
+ } catch (IOException expected) { }
+ try {
+ out.write(1);
+ if (!(out instanceof BufferedOutputStream))
+ fail("write did not fail");
+ } catch (IOException expected) { }
+ }
+
+ static void testFailingFlush(OutputStream out) throws IOException {
+ System.out.println(out.getClass());
+ out.write(1);
+ try {
+ out.flush();
+ fail("flush did not fail");
+ } catch (IOException expected) { }
+ if (out instanceof BufferedOutputStream) {
+ out.write(1);
+ try {
+ out.close();
+ fail("close did not fail");
+ } catch (IOException expected) { }
+ }
+ }
+
+ static void testFailingClose(Reader r) throws IOException {
+ System.out.println(r.getClass());
+ r.read(new char[100]);
+ try {
+ r.close();
+ fail("close did not fail");
+ } catch (IOException expected) { }
+ try {
+ r.read(new char[100]);
+ fail("read did not fail");
+ } catch (IOException expected) { }
+ }
+
+ static void testFailingClose(Writer w) throws IOException {
+ System.out.println(w.getClass());
+ w.write("message");
+ try {
+ w.close();
+ fail("close did not fail");
+ } catch (IOException expected) { }
+ try {
+ w.write("another message");
+ fail("write did not fail");
+ } catch (IOException expected) { }
+ }
+
+ static void testFailingFlush(Writer w) throws IOException {
+ System.out.println(w.getClass());
+ w.write("message");
+ try {
+ w.flush();
+ fail("flush did not fail");
+ } catch (IOException expected) { }
+ if (w instanceof BufferedWriter) {
+ // assume this message will be buffered
+ w.write("another message");
+ try {
+ w.close();
+ fail("close did not fail");
+ } catch (IOException expected) { }
+ }
+ }
+
+ public static void main(String[] args) throws IOException {
+
+ testFailingClose(new BufferedInputStream(new FailingCloseInputStream()));
+ testFailingClose(new BufferedOutputStream(new FailingCloseOutputStream()));
+
+ testFailingClose(new BufferedReader(new FailingCloseReader()));
+ testFailingClose(new BufferedWriter(new FailingCloseWriter()));
+
+ testFailingFlush(new BufferedOutputStream(new FailingFlushOutputStream()));
+ testFailingFlush(new BufferedWriter(new FailingFlushWriter()));
+
+ if (failed > 0)
+ throw new RuntimeException(failed + " test(s) failed - see log for details");
+ }
+}
--- a/jdk/test/java/lang/Math/Tests.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/java/lang/Math/Tests.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -35,20 +35,30 @@
public class Tests {
private Tests(){}; // do not instantiate
- private static String toHexString(float f) {
+ public static String toHexString(float f) {
if (!Float.isNaN(f))
return Float.toHexString(f);
else
return "NaN(0x" + Integer.toHexString(Float.floatToRawIntBits(f)) + ")";
}
- private static String toHexString(double d) {
+ public static String toHexString(double d) {
if (!Double.isNaN(d))
return Double.toHexString(d);
else
return "NaN(0x" + Long.toHexString(Double.doubleToRawLongBits(d)) + ")";
}
+ /**
+ * Return the floating-point value next larger in magnitude.
+ */
+ public static double nextOut(double d) {
+ if (d > 0.0)
+ return Math.nextUp(d);
+ else
+ return -Math.nextUp(-d);
+ }
+
public static int test(String testName, float input,
boolean result, boolean expected) {
if (expected != result) {
@@ -338,4 +348,24 @@
else
return 0;
}
+
+ // For a successful test, the result must be within the upper and
+ // lower bounds.
+ public static int testBounds(String testName, double input, double result,
+ double bound1, double bound2) {
+ if ((result >= bound1 && result <= bound2) ||
+ (result <= bound1 && result >= bound2))
+ return 0;
+ else {
+ double lowerBound = Math.min(bound1, bound2);
+ double upperBound = Math.max(bound1, bound2);
+ System.err.println("Failure for " + testName + ":\n" +
+ "\tFor input " + input + "\t(" + toHexString(input) + ")\n" +
+ "\tgot " + result + "\t(" + toHexString(result) + ");\n" +
+ "\toutside of range\n" +
+ "\t[" + lowerBound + "\t(" + toHexString(lowerBound) + "), " +
+ upperBound + "\t(" + toHexString(upperBound) + ")]");
+ return 1;
+ }
+ }
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/Math/WorstCaseTests.java Wed Jul 05 17:49:56 2017 +0200
@@ -0,0 +1,435 @@
+/*
+ * 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 4900206
+ * @summary Test worst case behavior of exp, log, sin, cos, etc.
+ * @build Tests
+ * @build WorstCaseTests
+ * @run main WorstCaseTests
+ * @run main/othervm -Xcomp WorstCaseTests
+ * @author Joseph D. Darcy
+ */
+
+/**
+ * Use "Table Maker's Dilemma" results from Jean-Michel Muller and
+ * Vincent Lefèvre, to test the math library. See
+ * http://perso.ens-lyon.fr/jean-michel.muller/TMD.html for original
+ * test vectors from 2000 and see
+ * http://perso.ens-lyon.fr/jean-michel.muller/TMDworstcases.pdf with
+ * additional test vectors from 2003. The latter link also contains
+ * some information about the methodology used to produce the test
+ * vectors.
+ *
+ * Most of the Java math library methods tested here have a 1-ulp
+ * error bound from their specifications. This implies the returned
+ * value must be one of the two representable floating-point numbers
+ * bracketing the exact result. The expected value in the test
+ * vectors below is the truncation of the exact value. Therefore, the
+ * computed result must either be that value or the value next larger
+ * in magnitude. The hyperbolic transcendental functions sinh and cosh
+ * have a larger 2.5 ulp error bound in their specification, but the
+ * JDK implementation complies with a 1 ulp bound on the worst-case
+ * values. Therefore, no addition leeway is afforded when testing
+ * sinh and cosh.
+ */
+public class WorstCaseTests {
+ private WorstCaseTests() {throw new AssertionError("No instances for you.");}
+
+ public static void main(String... args) {
+ int failures = 0;
+
+ failures += testWorstExp();
+ failures += testWorstLog();
+ failures += testWorstSin();
+ failures += testWorstAsin();
+ failures += testWorstCos();
+ failures += testWorstAcos();
+ failures += testWorstTan();
+ failures += testWorstAtan();
+ failures += testWorstPow2();
+ failures += testWorstSinh();
+ failures += testWorstCosh();
+
+ if (failures > 0) {
+ System.err.printf("Testing worst cases incurred %d failures.%n", failures);
+ throw new RuntimeException();
+ }
+ }
+
+ private static int testWorstExp() {
+ int failures = 0;
+ double [][] testCases = {
+ {-0x1.E8BDBFCD9144Ep3, 0x1.F3E558CF4DE54p-23},
+ {-0x1.71E0B869B5E79p2, 0x1.951C6DC5D24E2p-9},
+ {-0x1.02393D5976769p1, 0x1.1064B2C103DDAp-3},
+ {-0x1.2A9CAD9998262p0, 0x1.3EF1E9B3A81C7p-2},
+ {-0x1.CC37EF7DE7501p0, 0x1.534D4DE870713p-3},
+ {-0x1.22E24FA3D5CF9p-1, 0x1.2217147B85EA9p-1},
+ {-0x1.DC2B5DF1F7D3Dp-1, 0x1.9403FD0EE51C8p-2},
+ {-0x1.290EA09E36479p-3, 0x1.BADED30CBF1C3p-1},
+ {-0x1.A2FEFEFD580DFp-13, 0x1.FFE5D0BB7EABFp-1},
+ {-0x1.ED318EFB627EAp-27, 0x1.FFFFFF84B39C4p-1},
+ {-0x1.4BD46601AE1EFp-31, 0x1.FFFFFFFAD0AE6p-1},
+ {-0x1.1000000000242p-42, 0x1.FFFFFFFFFF780p-1},
+ {-0x1.2000000000288p-42, 0x1.FFFFFFFFFF700p-1},
+ {-0x1.8000000000012p-48, 0x1.FFFFFFFFFFFD0p-1},
+ {-0x1.0000000000001p-51, 0x1.FFFFFFFFFFFFCp-1},
+
+ {+0x1.FFFFFFFFFFFFFp-53, 0x1.0000000000000p0},
+ {+0x1.FFFFFFFFFFFE0p-48, 0x1.000000000001Fp0},
+ {+0x1.7FFE7FFEE0024p-32, 0x1.000000017FFE8p0},
+ {+0x1.80017FFEDFFDCp-32, 0x1.0000000180017p0},
+ {+0x1.9E9CBBFD6080Bp-31, 0x1.000000033D397p0},
+ {+0x1.D7A7D893609E5p-26, 0x1.00000075E9F64p0},
+ {+0x1.BA07D73250DE7p-14, 0x1.0006E83736F8Cp0},
+ {+0x1.D77FD13D27FFFp-11, 0x1.003AF6C37C1D3p0},
+ {+0x1.6A4D1AF9CC989p-8, 0x1.016B4DF3299D7p0},
+ {+0x1.ACCFBE46B4EF0p-1, 0x2.4F85C9783DCE0p0},
+ {+0x1.ACA7AE8DA5A7Bp0, 0x5.55F52B35F955Ap0},
+ {+0x1.D6336A88077AAp0, 0x6.46A37FD503FDCp0},
+ {+0x2.85DC78FB8928Cp0, 0xC.76F2496CB038Fp0},
+ {+0x1.76E7E5D7B6EACp3, 0x1.DE7CD6751029Ap16},
+ {+0x1.A8EAD058BC6B8p3, 0x1.1D71965F516ADp19},
+ {+0x1.1D5C2DAEBE367p4, 0x1.A8C02E974C314p25},
+ {+0x1.C44CE0D716A1Ap4, 0x1.B890CA8637AE1p40},
+ };
+
+ for(double[] testCase: testCases) {
+ failures += testExpCase(testCase[0], testCase[1]);
+ }
+
+ return failures;
+ }
+
+ private static int testExpCase(double input, double expected) {
+ int failures = 0;
+ double out = Tests.nextOut(expected);
+ failures += Tests.testBounds("Math.exp", input, Math.exp(input), expected, out);
+ failures += Tests.testBounds("StrictMath.exp", input, StrictMath.exp(input), expected, out);
+ return failures;
+ }
+
+ private static int testWorstLog() {
+ int failures = 0;
+ double [][] testCases = {
+ {+0x1.0000000000001p0, +0x1.FFFFFFFFFFFFFp-53},
+ {+0x2.0012ECB039C9Cp0, +0x1.62F71C4656B60p-1},
+ {+0x6.46A37FD503FDCp0, +0x1.D6336A88077A9p+0},
+ {+0x7.78DFECC7F57Fp0, +0x2.02DD059DB46Bp+0},
+ {+0x9.588CCF24BB9C8p0, +0x2.3C24DEBB2BE7p+0},
+ {+0xA.AF87550D97E4p0, +0x2.5E706595A7ABEp+0},
+ {+0xC.76F2496CB039p0, +0x2.85DC78FB8928Cp+0},
+ {+0x11.1867637CBD03p0, +0x2.D6BBEFC79A842p+0},
+ {+0x13.D9D7D597A9DDp0, +0x2.FCFE12AE07DDCp+0},
+ {+0x17.F3825778AAAFp0, +0x3.2D0F907F5E00Cp+0},
+ {+0x1AC.50B409C8AEEp0, +0x6.0F52F37AECFCCp+0},
+ {+0x1.DE7CD6751029Ap16, +0x1.76E7E5D7B6EABp+3},
+ };
+
+ for(double[] testCase: testCases) {
+ failures += testLogCase(testCase[0], testCase[1]);
+ }
+
+ return failures;
+ }
+
+ private static int testLogCase(double input, double expected) {
+ int failures = 0;
+ double out = Tests.nextOut(expected);
+ failures += Tests.testBounds("Math.log", input, Math.log(input), expected, out);
+ failures += Tests.testBounds("StrictMath.log", input, StrictMath.log(input), expected, out);
+ return failures;
+ }
+
+ private static int testWorstSin() {
+ int failures = 0;
+ double [][] testCases = {
+ {+0x1.E0000000001C2p-20, +0x1.DFFFFFFFFF02Ep-20},
+ {+0x1.598BAE9E632F6p-7, +0x1.598A0AEA48996p-7},
+
+ {+0x1.9283586503FEp-5, +0x1.9259E3708BD39p-5},
+ {+0x1.D7BDCD778049Fp-5, +0x1.D77B117F230D5p-5},
+ {+0x1.A202B3FB84788p-4, +0x1.A1490C8C06BA6p-4},
+ {+0x1.D037CB27EE6DFp-3, +0x1.CC40C3805229Ap-3},
+ {+0x1.D5064E6FE82C5p-3, +0x1.D0EF799001BA9p-3},
+ {+0x1.FE767739D0F6Dp-2, +0x1.E9950730C4695p-2},
+ {+0x1.D98C4C612718Dp-1, +0x1.98DCD09337792p-1},
+ {+0x1.921FB54442D18p-0, +0x1.FFFFFFFFFFFFFp-1},
+
+ {+0x1.6756745770A51p+1, +0x1.4FF350E412821p-2},
+ };
+
+ for(double[] testCase: testCases) {
+ failures += testSinCase(testCase[0], testCase[1]);
+ }
+
+ return failures;
+ }
+
+ private static int testSinCase(double input, double expected) {
+ int failures = 0;
+ double out = Tests.nextOut(expected);
+ failures += Tests.testBounds("Math.sin", input, Math.sin(input), expected, out);
+ failures += Tests.testBounds("StrictMath.sin", input, StrictMath.sin(input), expected, out);
+ return failures;
+ }
+
+ private static int testWorstAsin() {
+ int failures = 0;
+ double [][] testCases = {
+ {+0x1.DFFFFFFFFF02Ep-20, +0x1.E0000000001C1p-20},
+ {+0x1.DFFFFFFFFC0B8p-19, +0x1.E000000000707p-19},
+
+ {+0x1.9259E3708BD3Ap-5, +0x1.9283586503FEp-5},
+ {+0x1.D77B117F230D6p-5, +0x1.D7BDCD778049Fp-5},
+ {+0x1.A1490C8C06BA7p-4, +0x1.A202B3FB84788p-4},
+ {+0x1.9697CB602C582p-3, +0x1.994FFB5DAF0F9p-3},
+ {+0x1.D0EF799001BA9p-3, +0x1.D5064E6FE82C4p-3},
+ {+0x1.E9950730C4696p-2, +0x1.FE767739D0F6Dp-2},
+ {+0x1.1ED06D50F7E88p-1, +0x1.30706F699466Dp-1},
+ {+0x1.D5B05A89D3E77p-1, +0x1.29517AB4C132Ap+0},
+ {+0x1.E264357EA0E29p-1, +0x1.3AA301F6EBB1Dp+0},
+ };
+
+ for(double[] testCase: testCases) {
+ failures += testAsinCase(testCase[0], testCase[1]);
+ }
+
+ return failures;
+ }
+
+ private static int testAsinCase(double input, double expected) {
+ int failures = 0;
+ double out = Tests.nextOut(expected);
+ failures += Tests.testBounds("Math.asin", input, Math.asin(input), expected, out);
+ failures += Tests.testBounds("StrictMath.asin", input, StrictMath.asin(input), expected, out);
+ return failures;
+ }
+
+ private static int testWorstCos() {
+ int failures = 0;
+ double [][] testCases = {
+ {+0x1.8000000000009p-23, +0x0.FFFFFFFFFFFB8p+0},
+ {+0x1.8000000000024p-22, +0x0.FFFFFFFFFFEE0p+0},
+ {+0x1.2000000000F30p-18, +0x0.FFFFFFFFF5E00p+0},
+ {+0x1.06B505550E6B2p-9, +0x0.FFFFDE4D1FDFFp+0},
+ {+0x1.97CCD3D2C438Fp-6, +0x0.FFEBB35D43854p+0},
+
+ {+0x1.549EC0C0C5AFAp-5, +0x1.FF8EB6A91ECB0p-1},
+ {+0x1.16E534EE36580p-4, +0x1.FED0476FC75C9p-1},
+ {+0x1.EFEEF61D39AC2p-3, +0x1.F10FC61E2C78Ep-1},
+ {+0x1.FEB1F7920E248p-2, +0x1.C1A27AE836F12p-1},
+ {+0x1.7CB7648526F99p-1, +0x1.78DAF01036D0Cp-1},
+ {+0x1.C65A170474549p-1, +0x1.434A3645BE208p-1},
+ {+0x1.6B8A6273D7C21p+0, +0x1.337FC5B072C52p-3},
+ };
+
+ for(double[] testCase: testCases) {
+ failures += testCosCase(testCase[0], testCase[1]);
+ }
+
+ return failures;
+ }
+
+ private static int testCosCase(double input, double expected) {
+ int failures = 0;
+ double out = Tests.nextOut(expected);
+ failures += Tests.testBounds("Math.cos", input, Math.cos(input), expected, out);
+ failures += Tests.testBounds("StrictMath.cos", input, StrictMath.cos(input), expected, out);
+ return failures;
+ }
+
+ private static int testWorstAcos() {
+ int failures = 0;
+ double [][] testCases = {
+ {+0x1.FD737BE914578p-11, +0x1.91E006D41D8D8p+0},
+ {+0x1.4182199998587p-1, +0x1.C8A538AE83D1Fp-1},
+ {+0x1.E45A1C93651ECp-1, +0x1.520DC553F6B23p-2},
+ {+0x1.F10FC61E2C78Fp-1, +0x1.EFEEF61D39AC1p-3},
+ };
+
+ for(double[] testCase: testCases) {
+ failures += testAcosCase(testCase[0], testCase[1]);
+ }
+
+ return failures;
+ }
+
+ private static int testAcosCase(double input, double expected) {
+ int failures = 0;
+ double out = Tests.nextOut(expected);
+ failures += Tests.testBounds("Math.acos", input, Math.acos(input), expected, out);
+ failures += Tests.testBounds("StrictMath.acos", input, StrictMath.acos(input), expected, out);
+ return failures;
+ }
+
+ private static int testWorstTan() {
+ int failures = 0;
+ double [][] testCases = {
+ {+0x1.DFFFFFFFFFF1Fp-22, +0x1.E000000000151p-22},
+ {+0x1.67FFFFFFFA114p-18, +0x1.6800000008E61p-18},
+
+ {+0x1.50486B2F87014p-5, +0x1.5078CEBFF9C72p-5},
+ {+0x1.52C39EF070CADp-4, +0x1.5389E6DF41978p-4},
+ {+0x1.A33F32AC5CEB5p-3, +0x1.A933FE176B375p-3},
+ {+0x1.D696BFA988DB9p-2, +0x1.FAC71CD34EEA6p-2},
+ {+0x1.46AC372243536p-1, +0x1.7BA49F739829Ep-1},
+ {+0x0.A3561B9121A9Bp+0, +0x0.BDD24FB9CC14Fp+0},
+ };
+
+ for(double[] testCase: testCases) {
+ failures += testTanCase(testCase[0], testCase[1]);
+ }
+
+ return failures;
+ }
+
+ private static int testTanCase(double input, double expected) {
+ int failures = 0;
+ double out = Tests.nextOut(expected);
+ failures += Tests.testBounds("Math.tan", input, Math.tan(input), expected, out);
+ failures += Tests.testBounds("StrictMath.tan", input, StrictMath.tan(input), expected, out);
+ return failures;
+ }
+
+ private static int testWorstAtan() {
+ int failures = 0;
+ double [][] testCases = {
+ {+0x1.E000000000546p-21, +0x1.DFFFFFFFFFC7Cp-21},
+ {+0x1.22E8D75E2BC7Fp-11, +0x1.22E8D5694AD2Bp-11},
+
+ {+0x1.0FC9F1FABE658p-5, +0x1.0FB06EDE9973Ap-5},
+ {+0x1.1BBE9C255698Dp-5, +0x1.1BA1951DB1D6Dp-5},
+ {+0x1.8DDD25AB90CA1p-5, +0x1.8D8D2D4BD6FA2p-5},
+ {+0x1.5389E6DF41979p-4, +0x1.52C39EF070CADp-4},
+ {+0x1.A933FE176B375p-3, +0x1.A33F32AC5CEB4p-3},
+ {+0x1.0F6E5D9960397p-2, +0x1.09544B71AD4A6p-2},
+ {+0x1.7BA49F739829Fp-1, +0x1.46AC372243536p-1},
+
+ {+0x0.BDD24FB9CC14F8p+0, +0x0.A3561B9121A9Bp+0},
+ };
+
+ for(double[] testCase: testCases) {
+ failures += testAtanCase(testCase[0], testCase[1]);
+ }
+
+ return failures;
+ }
+
+ private static int testAtanCase(double input, double expected) {
+ int failures = 0;
+ double out = Tests.nextOut(expected);
+ failures += Tests.testBounds("Math.atan", input, Math.atan(input), expected, out);
+ failures += Tests.testBounds("StrictMath.atan", input, StrictMath.atan(input), expected, out);
+ return failures;
+ }
+
+ private static int testWorstPow2() {
+ int failures = 0;
+ double [][] testCases = {
+ {+0x1.16A76EC41B516p-1, +0x1.7550685A42C63p+0},
+ {+0x1.3E34FA6AB969Ep-1, +0x1.89D948A94FE16p+0},
+ {+0x1.4A63FF1D53F53p-1, +0x1.90661DA12D528p+0},
+ {+0x1.B32A6C92D1185p-1, +0x1.CD6B37EDECEAFp+0},
+
+ {+0x1.25DD9EEDAC79Ap+0, +0x1.1BA39FF28E3E9p+1},
+ };
+
+ for(double[] testCase: testCases) {
+ failures += testPow2Case(testCase[0], testCase[1]);
+ }
+
+ return failures;
+ }
+
+ private static int testPow2Case(double input, double expected) {
+ int failures = 0;
+ double out = Tests.nextOut(expected);
+ failures += Tests.testBounds("Math.pow2", input, Math.pow(2, input), expected, out);
+ failures += Tests.testBounds("StrictMath.pow2", input, StrictMath.pow(2, input), expected, out);
+ return failures;
+ }
+
+ // 2.5 ulp error bound in the specification; the implementation
+ // does better on the tested values.
+ private static int testWorstSinh() {
+ int failures = 0;
+ double [][] testCases = {
+ {+0x1.DFFFFFFFFFE3Ep-20, +0x1.E000000000FD1p-20},
+ {+0x1.DFFFFFFFFE3E0p-18, +0x1.E00000000FD1Fp-18},
+ {+0x1.135E31FDD05D3p-5, +0x1.136B78B25CC57p-5},
+ {+0x1.0DC68D5E8F959p-3, +0x1.0E8E73DC4FEE3p-3},
+ {+0x1.616CC75D49226p-2, +0x1.687BD068C1C1Ep-2},
+ {+0x1.3FFC12B81CBC2p+0, +0x1.9A0FF413A1AF2p+0},
+ {+0x2.FE008C44BACA2p+0, +0x9.F08A43ED03AEp+0},
+ {+0x1.C089FCF166171p+4, +0x1.5C452E0E37569p+39},
+ {+0x1.E07E71BFCF06Fp+5, +0x1.91EC4412C344Fp+85},
+ {+0x1.54CD1FEA7663Ap+7, +0x1.C90810D354618p+244},
+ {+0x1.D6479EBA7C971p+8, +0x1.62A88613629B5p+677},
+ };
+
+ for(double[] testCase: testCases) {
+ failures += testSinhCase(testCase[0], testCase[1]);
+ }
+
+ return failures;
+ }
+
+ private static int testSinhCase(double input, double expected) {
+ int failures = 0;
+ double out = Tests.nextOut(expected);
+ failures += Tests.testBounds("Math.sinh", input, Math.sinh(input), expected, out);
+ failures += Tests.testBounds("StrictMath.sinh", input, StrictMath.sinh(input), expected, out);
+ return failures;
+ }
+
+ // 2.5 ulp error bound in the specification; the implementation
+ // does better on the tested values.
+ private static int testWorstCosh() {
+ int failures = 0;
+ double [][] testCases = {
+ {+0x1.17D8A9F206217p-6, +0x1.00098F5F09BE3p+0},
+ {+0x1.BF0305E2C6C37p-3, +0x1.061F4C39E16F2p+0},
+ {+0x1.03923F2B47C07p-1, +0x1.219C1989E3372p+0},
+ {+0x1.A6031CD5F93BAp-1, +0x1.5BFF041B260FDp+0},
+ {+0x1.104B648F113A1p+0, +0x1.9EFDCA62B7009p+0},
+ {+0x1.EA5F2F2E4B0C5p+1, +0x17.10DB0CD0FED5p+0},
+ };
+
+ for(double[] testCase: testCases) {
+ failures += testCoshCase(testCase[0], testCase[1]);
+ }
+
+ return failures;
+ }
+
+ private static int testCoshCase(double input, double expected) {
+ int failures = 0;
+ double out = Tests.nextOut(expected);
+ failures += Tests.testBounds("Math.cosh", input, Math.cosh(input), expected, out);
+ failures += Tests.testBounds("StrictMath.cosh", input, StrictMath.cosh(input), expected, out);
+ return failures;
+ }
+}
--- a/jdk/test/java/lang/ProcessBuilder/Basic.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/java/lang/ProcessBuilder/Basic.java Wed Jul 05 17:49:56 2017 +0200
@@ -1803,7 +1803,7 @@
p.getInputStream().close();
p.getErrorStream().close();
- p.getOutputStream().close();
+ try { p.getOutputStream().close(); } catch (IOException flushFailed) { }
InputStream[] streams = { p.getInputStream(), p.getErrorStream() };
for (final InputStream in : streams) {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/management/ManagementFactory/GetObjectName.java Wed Jul 05 17:49:56 2017 +0200
@@ -0,0 +1,75 @@
+/*
+ * 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 7068328
+ * @summary Test if getObjectName handles properly when called by
+ * multiple threads simultaneously. Run in othervm mode to
+ * make sure the object name is not initialized to begin with.
+ * @run main/othervm GetObjectName
+ */
+
+import java.lang.management.BufferPoolMXBean;
+import java.lang.management.ManagementFactory;
+import java.lang.management.PlatformLoggingMXBean;
+import java.lang.management.PlatformManagedObject;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.TimeUnit;
+
+public class GetObjectName {
+ private static boolean failed = false;
+ public static void main(String[] args) throws Exception {
+ int tasks = 10000;
+ ExecutorService executor = Executors.newFixedThreadPool(10);
+ submitTasks(executor, tasks);
+ executor.shutdown();
+ executor.awaitTermination(10, TimeUnit.SECONDS);
+ if (!failed) {
+ System.out.println("Test passed.");
+ }
+ }
+
+ static void submitTasks(ExecutorService executor, int count) {
+ for (int i=0; i < count && !failed; i++) {
+ executor.execute(new Runnable() {
+ @Override
+ public void run() {
+ List<PlatformManagedObject> mbeans = new ArrayList<>();
+ mbeans.add(ManagementFactory.getPlatformMXBean(PlatformLoggingMXBean.class));
+ mbeans.addAll(ManagementFactory.getPlatformMXBeans(BufferPoolMXBean.class));
+ for (PlatformManagedObject pmo : mbeans) {
+ // Name should not be null
+ if (pmo.getObjectName() == null) {
+ failed = true;
+ throw new RuntimeException("TEST FAILED: getObjectName() returns null");
+ }
+ }
+ }
+ });
+ }
+ }
+}
--- a/jdk/test/java/lang/reflect/Generics/Probe.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/java/lang/reflect/Generics/Probe.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2010, 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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 5003916 6704655 6873951
+ * @bug 5003916 6704655 6873951 6476261
* @summary Testing parsing of signatures attributes of nested classes
* @author Joseph D. Darcy
*/
@@ -38,12 +38,12 @@
"java.util.concurrent.ConcurrentHashMap$KeyIterator",
"java.util.concurrent.ConcurrentHashMap$ValueIterator",
"java.util.AbstractList$ListItr",
-// "java.util.EnumMap$EntryIterator",
-// "java.util.EnumMap$KeyIterator",
-// "java.util.EnumMap$ValueIterator",
-// "java.util.IdentityHashMap$EntryIterator",
-// "java.util.IdentityHashMap$KeyIterator",
-// "java.util.IdentityHashMap$ValueIterator",
+ "java.util.EnumMap$EntryIterator",
+ "java.util.EnumMap$KeyIterator",
+ "java.util.EnumMap$ValueIterator",
+ "java.util.IdentityHashMap$EntryIterator",
+ "java.util.IdentityHashMap$KeyIterator",
+ "java.util.IdentityHashMap$ValueIterator",
"java.util.WeakHashMap$EntryIterator",
"java.util.WeakHashMap$KeyIterator",
"java.util.WeakHashMap$ValueIterator",
@@ -52,12 +52,12 @@
"java.util.HashMap$ValueIterator",
"java.util.LinkedHashMap$EntryIterator",
"java.util.LinkedHashMap$KeyIterator",
- "java.util.LinkedHashMap$ValueIterator"})
+ "java.util.LinkedHashMap$ValueIterator",
+ "javax.swing.JComboBox$AccessibleJComboBox"})
public class Probe {
public static void main (String... args) throws Throwable {
Classes classesAnnotation = (Probe.class).getAnnotation(Classes.class);
- List<String> names =
- new ArrayList<String>(asList(classesAnnotation.value()));
+ List<String> names = new ArrayList<>(asList(classesAnnotation.value()));
int errs = 0;
for(String name: names) {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/reflect/Generics/SignatureTest.java Wed Jul 05 17:49:56 2017 +0200
@@ -0,0 +1,50 @@
+/*
+ * 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 6476261
+ * @summary More testing of parsing of signatures attributes of nested classes
+ */
+
+import java.lang.reflect.*;
+
+public class SignatureTest<T> {
+ class Inner1 {
+ class Inner11 {
+ }
+ }
+
+ public void f(SignatureTest<String>.Inner1.Inner11 x) {}
+ public void g(SignatureTest<String>.Inner1 x) {}
+
+ public static void main(String[] args) throws Exception {
+ Class clazz = SignatureTest.class;
+ for (Method m : clazz.getDeclaredMethods()) {
+ System.out.println();
+ System.out.println(m.toString());
+ System.out.println(m.toGenericString());
+ System.out.println(m.getGenericParameterTypes());
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/reflect/Generics/TestBadSignatures.java Wed Jul 05 17:49:56 2017 +0200
@@ -0,0 +1,54 @@
+/*
+ * 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 6832374 7052898
+ * @summary Test bad signatures get a GenericSignatureFormatError thrown.
+ * @author Joseph D. Darcy
+ */
+
+import java.lang.reflect.*;
+import sun.reflect.generics.parser.SignatureParser;
+
+public class TestBadSignatures {
+ public static void main(String[] args) {
+ String[] badSignatures = {
+ // Missing ":" after first type bound
+ "<T:Lfoo/tools/nsc/symtab/Names;Lfoo/tools/nsc/symtab/Symbols;",
+
+ // Arrays improperly indicated for exception information
+ "<E:Ljava/lang/Exception;>(TE;[Ljava/lang/RuntimeException;)V^[TE;",
+ };
+
+ for(String badSig : badSignatures) {
+ try {
+ SignatureParser.make().parseMethodSig(badSig);
+ throw new RuntimeException("Expected GenericSignatureFormatError for " +
+ badSig);
+ } catch(GenericSignatureFormatError gsfe) {
+ System.out.println(gsfe.toString()); // Expected
+ }
+ }
+ }
+}
--- a/jdk/test/java/net/CookieHandler/TestHttpCookie.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/java/net/CookieHandler/TestHttpCookie.java Wed Jul 05 17:49:56 2017 +0200
@@ -362,12 +362,13 @@
eq(c1, c2, false);
header("Test domainMatches()");
- dm(".foo.com", "y.x.foo.com", false);
- dm(".foo.com", "x.foo.com", true);
- dm(".com", "whatever.com", false);
- dm(".com.", "whatever.com", false);
- dm(".ajax.com", "ajax.com", true);
- dm(".local", "example.local", true);
+ dm(".foo.com", "y.x.foo.com", false);
+ dm(".foo.com", "x.foo.com", true);
+ dm(".com", "whatever.com", false);
+ dm(".com.", "whatever.com", false);
+ dm(".ajax.com", "ajax.com", true);
+ dm(".local", "example.local", true);
+ dm("example.local", "example", true);
// bug 6277808
testCount++;
--- a/jdk/test/java/net/NetworkInterface/NetParamsTest.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/java/net/NetworkInterface/NetParamsTest.java Wed Jul 05 17:49:56 2017 +0200
@@ -45,7 +45,9 @@
System.out.println("\tPoint to Point: " + netif.isPointToPoint());
System.out.println("\tVirtual: " + netif.isVirtual());
if (netif.isVirtual()) {
- System.out.println("\tParent Interface: " + netif.getParent().getName());
+ NetworkInterface parent = netif.getParent();
+ String parentName = parent == null ? "null" : parent.getName();
+ System.out.println("\tParent Interface: " + parentName);
}
System.out.println("\tMulticast: " + netif.supportsMulticast());
--- a/jdk/test/java/nio/channels/DatagramChannel/NetworkConfiguration.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/java/nio/channels/DatagramChannel/NetworkConfiguration.java Wed Jul 05 17:49:56 2017 +0200
@@ -57,11 +57,22 @@
return ip6Interfaces.get(nif);
}
+ // IPv6 not supported for Windows XP/Server 2003
+ static boolean isIPv6Supported() {
+ if (System.getProperty("os.name").startsWith("Windows")) {
+ String ver = System.getProperty("os.version");
+ int major = Integer.parseInt(ver.split("\\.")[0]);
+ return (major >= 6);
+ }
+ return true;
+ }
+
static NetworkConfiguration probe() throws IOException {
Map<NetworkInterface,List<InetAddress>> ip4Interfaces =
new HashMap<NetworkInterface,List<InetAddress>>();
Map<NetworkInterface,List<InetAddress>> ip6Interfaces =
new HashMap<NetworkInterface,List<InetAddress>>();
+ boolean isIPv6Supported = isIPv6Supported();
// find the interfaces that support IPv4 and IPv6
List<NetworkInterface> nifs = Collections
@@ -81,7 +92,7 @@
}
list.add(addr);
ip4Interfaces.put(nif, list);
- } else if (addr instanceof Inet6Address) {
+ } else if (isIPv6Supported && (addr instanceof Inet6Address)) {
List<InetAddress> list = ip6Interfaces.get(nif);
if (list == null) {
list = new LinkedList<InetAddress>();
--- a/jdk/test/java/nio/channels/DatagramChannel/SelectWhenRefused.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/java/nio/channels/DatagramChannel/SelectWhenRefused.java Wed Jul 05 17:49:56 2017 +0200
@@ -22,7 +22,7 @@
*/
/* @test
- * @bug 6935563
+ * @bug 6935563 7044870
* @summary Test that Selector does not select an unconnected DatagramChannel when
* ICMP port unreachable received
*/
@@ -35,14 +35,15 @@
public class SelectWhenRefused {
public static void main(String[] args) throws IOException {
- DatagramChannel dc = DatagramChannel.open().bind(new InetSocketAddress(0));
- int port = dc.socket().getLocalPort();
- dc.close();
+ DatagramChannel dc1 = DatagramChannel.open().bind(new InetSocketAddress(0));
+ int port = dc1.socket().getLocalPort();
// datagram sent to this address should be refused
SocketAddress refuser = new InetSocketAddress(InetAddress.getLocalHost(), port);
- dc = DatagramChannel.open().bind(new InetSocketAddress(0));
+ DatagramChannel dc = DatagramChannel.open().bind(new InetSocketAddress(0));
+ dc1.close();
+
Selector sel = Selector.open();
try {
dc.configureBlocking(false);
@@ -52,6 +53,10 @@
sendDatagram(dc, refuser);
int n = sel.select(2000);
if (n > 0) {
+ sel.selectedKeys().clear();
+ // BindException will be thrown if another service is using
+ // our expected refuser port, cannot run just exit.
+ DatagramChannel.open().bind(refuser).close();
throw new RuntimeException("Unexpected wakeup");
}
@@ -80,6 +85,8 @@
throw new RuntimeException("Unexpected wakeup after disconnect");
}
+ } catch(BindException e) {
+ // Do nothing, some other test has used this port
} finally {
sel.close();
dc.close();
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/security/testlibrary/Providers.java Wed Jul 05 17:49:56 2017 +0200
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+
+import java.security.Provider;
+import java.security.Security;
+
+public class Providers {
+ public static void setAt(Provider p, int pos) throws Exception {
+ if (Security.getProvider(p.getName()) != null) {
+ Security.removeProvider(p.getName());
+ }
+ if (Security.insertProviderAt(p, pos) == -1) {
+ throw new Exception("cannot setAt");
+ }
+ }
+}
--- a/jdk/test/java/util/Locale/LocaleCategory.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/java/util/Locale/LocaleCategory.java Wed Jul 05 17:49:56 2017 +0200
@@ -56,6 +56,7 @@
Locale.getDefault().getVariant())).build();
checkDefault();
testGetSetDefault();
+ testBug7079486();
} finally {
// restore the reserved locale
Locale.setDefault(reservedLocale);
@@ -82,5 +83,24 @@
throw new RuntimeException("setDefault() should set all default locales for all categories");
}
}
+
+ static void testBug7079486() {
+ Locale zh_Hans_CN = Locale.forLanguageTag("zh-Hans-CN");
+
+ // make sure JRE has zh_Hans_CN localized string
+ if (zh_Hans_CN.getDisplayScript(Locale.US).equals(zh_Hans_CN.getDisplayScript(zh_Hans_CN))) {
+ return;
+ }
+
+ Locale.setDefault(Locale.US);
+ String en_script = zh_Hans_CN.getDisplayScript();
+
+ Locale.setDefault(Locale.Category.DISPLAY, zh_Hans_CN);
+ String zh_script = zh_Hans_CN.getDisplayScript();
+
+ if (en_script.equals(zh_script)) {
+ throw new RuntimeException("Locale.getDisplayScript() (no args) does not honor default DISPLAY locale");
+ }
+ }
}
--- a/jdk/test/java/util/Locale/LocaleCategory.sh Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/java/util/Locale/LocaleCategory.sh Wed Jul 05 17:49:56 2017 +0200
@@ -1,7 +1,7 @@
#!/bin/sh
#
# @test
-# @bug 4700857 6997928
+# @bug 4700857 6997928 7079486
# @summary tests for Locale.getDefault(Locale.Category) and
# Locale.setDefault(Locale.Category, Locale)
# @build LocaleCategory
--- a/jdk/test/java/util/zip/LargeZip.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/java/util/zip/LargeZip.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,173 +25,242 @@
import java.io.*;
import java.nio.*;
+import java.nio.file.*;
+import java.nio.file.attribute.*;
+import java.nio.file.spi.*;
import java.util.*;
import java.util.zip.*;
-public class LargeZip {
- // If true, don't delete large ZIP file created for test.
- static final boolean debug = System.getProperty("debug") != null;
+import static java.nio.file.StandardCopyOption.*;
- //static final int DATA_LEN = 1024 * 1024;
- static final int DATA_LEN = 80 * 1024;
- static final int DATA_SIZE = 8;
+public class LargeZip {
+ // If true, don't delete large ZIP file created for test.
+ static final boolean debug = System.getProperty("debug") != null;
- static long fileSize = 6L * 1024L * 1024L * 1024L; // 6GB
-
- static boolean userFile = false;
+ //static final int DATA_LEN = 1024 * 1024;
+ static final int DATA_LEN = 80 * 1024;
+ static final int DATA_SIZE = 8;
- static byte[] data;
- static File largeFile;
- static String lastEntryName;
+ static long fileSize = 6L * 1024L * 1024L * 1024L; // 6GB
+
+ static boolean userFile = false;
+ static byte[] data;
+ static File largeFile;
+ static String lastEntryName;
- /* args can be empty, in which case check a 3 GB file which is created for
- * this test (and then deleted). Or it can be a number, in which case
- * that designates the size of the file that's created for this test (and
- * then deleted). Or it can be the name of a file to use for the test, in
- * which case it is *not* deleted. Note that in this last case, the data
- * comparison might fail.
- */
- static void realMain (String[] args) throws Throwable {
- if (args.length > 0) {
- try {
- fileSize = Long.parseLong(args[0]);
- System.out.println("Testing with file of size " + fileSize);
- } catch (NumberFormatException ex) {
- largeFile = new File(args[0]);
- if (!largeFile.exists()) {
- throw new Exception("Specified file " + args[0] + " does not exist");
- }
- userFile = true;
- System.out.println("Testing with user-provided file " + largeFile);
- }
- }
- File testDir = null;
- if (largeFile == null) {
- testDir = new File(System.getProperty("test.scratch", "."),
- "LargeZip");
- if (testDir.exists()) {
- if (!testDir.delete()) {
- throw new Exception("Cannot delete already-existing test directory");
- }
- }
- check(!testDir.exists() && testDir.mkdirs());
- largeFile = new File(testDir, "largezip.zip");
- createLargeZip();
- }
+ /* args can be empty, in which case check a 3 GB file which is created for
+ * this test (and then deleted). Or it can be a number, in which case
+ * that designates the size of the file that's created for this test (and
+ * then deleted). Or it can be the name of a file to use for the test, in
+ * which case it is *not* deleted. Note that in this last case, the data
+ * comparison might fail.
+ */
+ static void realMain (String[] args) throws Throwable {
+ if (args.length > 0) {
+ try {
+ fileSize = Long.parseLong(args[0]);
+ System.out.println("Testing with file of size " + fileSize);
+ } catch (NumberFormatException ex) {
+ largeFile = new File(args[0]);
+ if (!largeFile.exists()) {
+ throw new Exception("Specified file " + args[0] + " does not exist");
+ }
+ userFile = true;
+ System.out.println("Testing with user-provided file " + largeFile);
+ }
+ }
+ File testDir = null;
+ if (largeFile == null) {
+ testDir = new File(System.getProperty("test.scratch", "."),
+ "LargeZip");
+ if (testDir.exists()) {
+ if (!testDir.delete()) {
+ throw new Exception("Cannot delete already-existing test directory");
+ }
+ }
+ check(!testDir.exists() && testDir.mkdirs());
+ largeFile = new File(testDir, "largezip.zip");
+ createLargeZip();
+ } else {
+ if (args.length > 1)
+ updateLargeZip(args[1]); // add new entry with zfs
+ }
+ readLargeZip1();
+ readLargeZip2();
- readLargeZip1();
- readLargeZip2();
+ if (!userFile && !debug) {
+ check(largeFile.delete());
+ check(testDir.delete());
+ }
+ }
+
+ static void createLargeZip() throws Throwable {
+ int iterations = DATA_LEN / DATA_SIZE;
+ ByteBuffer bb = ByteBuffer.allocate(DATA_SIZE);
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ for (int i = 0; i < iterations; i++) {
+ bb.putDouble(0, Math.random());
+ baos.write(bb.array(), 0, DATA_SIZE);
+ }
+ data = baos.toByteArray();
+
+ try (FileOutputStream fos = new FileOutputStream(largeFile);
+ BufferedOutputStream bos = new BufferedOutputStream(fos);
+ ZipOutputStream zos = new ZipOutputStream(bos))
+ {
+ long length = 0;
+ while (length < fileSize) {
+ ZipEntry ze = new ZipEntry("entry-" + length);
+ lastEntryName = ze.getName();
+ zos.putNextEntry(ze);
+ zos.write(data, 0, data.length);
+ zos.closeEntry();
+ length = largeFile.length();
+ }
+ System.out.println("Last entry written is " + lastEntryName);
+ }
+ }
+
+ private static byte buf[] = new byte[4096];
+
+ static void checkEntry(ZipEntry e, InputStream is) throws Throwable {
+ long N = 0;
+ int n = 0;
+ while ((n = is.read(buf)) >= 0) {
+ N += n;
+ }
+ check(N == e.getSize());
+ }
- if (!userFile && !debug) {
- check(largeFile.delete());
- check(testDir.delete());
- }
- }
+ static void readLargeZip1() throws Throwable {
+ ZipFile zipFile = new ZipFile(largeFile);
+ ZipEntry entry = null;
+ String entryName = null;
+ int count = 0;
+ System.out.println("ZipFile:");
+ Enumeration<? extends ZipEntry> entries = zipFile.entries();
+ while (entries.hasMoreElements()) {
+ entry = entries.nextElement();
+ entryName = entry.getName();
+ System.out.println(" checking " + entryName);
+ if (!entry.isDirectory()) {
+ try (InputStream zeis = zipFile.getInputStream(entry)) {
+ checkEntry(entry, zeis);
+ }
+ }
+ count++;
+ }
+ System.out.println("Number of entries read: " + count);
+ check(!entry.isDirectory());
+ if (userFile || check(entryName.equals(lastEntryName))) {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ InputStream is = zipFile.getInputStream(entry);
+ int len;
+ while ((len = is.read(buf)) >= 0) {
+ baos.write(buf, 0, len);
+ }
+ baos.close();
+ is.close();
+ if (!userFile)
+ check(Arrays.equals(data, baos.toByteArray()));
+ }
+ }
- static void createLargeZip() throws Throwable {
- int iterations = DATA_LEN / DATA_SIZE;
- ByteBuffer bb = ByteBuffer.allocate(DATA_SIZE);
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- for (int i = 0; i < iterations; i++) {
- bb.putDouble(0, Math.random());
- baos.write(bb.array(), 0, DATA_SIZE);
- }
- data = baos.toByteArray();
+ static void readLargeZip2() throws Throwable {
+ System.out.println("ZipInputStream:");
+ try (FileInputStream fis = new FileInputStream(largeFile);
+ BufferedInputStream bis = new BufferedInputStream(fis);
+ ZipInputStream zis = new ZipInputStream(bis))
+ {
+ ZipEntry entry = null;
+ String entryName = null;
+ int count = 0;
+ while ((entry = zis.getNextEntry()) != null) {
+ entryName = entry.getName();
- try (FileOutputStream fos = new FileOutputStream(largeFile);
- BufferedOutputStream bos = new BufferedOutputStream(fos);
- ZipOutputStream zos = new ZipOutputStream(bos))
- {
- long length = 0;
- while (length < fileSize) {
- ZipEntry ze = new ZipEntry("entry-" + length);
- lastEntryName = ze.getName();
- zos.putNextEntry(ze);
- zos.write(data, 0, data.length);
- zos.closeEntry();
- length = largeFile.length();
- }
- System.out.println("Last entry written is " + lastEntryName);
- }
- }
+ System.out.println(" checking " + entryName +
+ ", method=" + entry.getMethod());
+ if (entryName.equals(lastEntryName)) {
+ break;
+ }
+ if (!entry.isDirectory()) {
+ checkEntry(entry, zis);
+ }
+ count++;
+ }
+ System.out.println("Number of entries read: " + count);
+ System.out.println("Last entry read is " + entryName);
+ if (!userFile) {
+ check(!entry.isDirectory());
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ byte buf[] = new byte[4096];
+ int len;
+ while ((len = zis.read(buf)) >= 0) {
+ baos.write(buf, 0, len);
+ }
+ baos.close();
+ check(Arrays.equals(data, baos.toByteArray()));
+ check(zis.getNextEntry() == null);
+ }
+ }
+ }
- static void readLargeZip1() throws Throwable {
- ZipFile zipFile = new ZipFile(largeFile);
- ZipEntry entry = null;
- String entryName = null;
- int count = 0;
- Enumeration<? extends ZipEntry> entries = zipFile.entries();
- while (entries.hasMoreElements()) {
- entry = entries.nextElement();
- entryName = entry.getName();
- count++;
- }
- System.out.println("Number of entries read: " + count);
- System.out.println("Last entry read is " + entryName);
- check(!entry.isDirectory());
- if (check(entryName.equals(lastEntryName))) {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- InputStream is = zipFile.getInputStream(entry);
- byte buf[] = new byte[4096];
- int len;
- while ((len = is.read(buf)) >= 0) {
- baos.write(buf, 0, len);
- }
- baos.close();
- is.close();
- check(Arrays.equals(data, baos.toByteArray()));
- }
- }
+ private static void updateFile(FileSystem fs, Path src) throws IOException {
+ Path dst = fs.getPath(src.toString());
+ Path parent = dst.getParent();
+ if (parent != null && Files.notExists(parent))
+ Files.createDirectories(parent);
+ Files.copy(src, dst, REPLACE_EXISTING);
+ }
+
+ private static FileSystemProvider getZipFSProvider() {
+ for (FileSystemProvider provider : FileSystemProvider.installedProviders()) {
+ if ("jar".equalsIgnoreCase(provider.getScheme()))
+ return provider;
+ }
+ return null;
+ }
+
+ static void updateLargeZip(String pName) throws Throwable {
+ FileSystemProvider provider = getZipFSProvider();
+ if (provider == null) {
+ System.err.println("ZIP filesystem provider is not installed");
+ System.exit(1);
+ }
+ Map<String, Object> env = env = new HashMap<>();
+ try (FileSystem fs = provider.newFileSystem(largeFile.toPath(), env)) {
+ Path path = FileSystems.getDefault().getPath(pName);
+ Files.walkFileTree(
+ path,
+ new SimpleFileVisitor<Path>() {
+ @Override
+ public FileVisitResult visitFile(Path file,
+ BasicFileAttributes attrs)
+ throws IOException
+ {
+ updateFile(fs, file);
+ return FileVisitResult.CONTINUE;
+ }
+ });
+ }
+ }
- static void readLargeZip2() throws Throwable {
- try (FileInputStream fis = new FileInputStream(largeFile);
- BufferedInputStream bis = new BufferedInputStream(fis);
- ZipInputStream zis = new ZipInputStream(bis))
- {
- ZipEntry entry = null;
- String entryName = null;
- int count = 0;
- while ((entry = zis.getNextEntry()) != null) {
- entryName = entry.getName();
- if (entryName.equals(lastEntryName)) {
- break;
- }
- count++;
- }
- System.out.println("Number of entries read: " + count);
- System.out.println("Last entry read is " + entryName);
- check(!entry.isDirectory());
-
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
-
- byte buf[] = new byte[4096];
- int len;
- while ((len = zis.read(buf)) >= 0) {
- baos.write(buf, 0, len);
- }
- baos.close();
- check(Arrays.equals(data, baos.toByteArray()));
- check(zis.getNextEntry() == null);
- }
- }
-
-
- //--------------------- Infrastructure ---------------------------
- static volatile int passed = 0, failed = 0;
- static void pass() {passed++;}
- static void pass(String msg) {System.out.println(msg); passed++;}
- static void fail() {failed++; Thread.dumpStack();}
- static void fail(String msg) {System.out.println(msg); fail();}
- static void unexpected(Throwable t) {failed++; t.printStackTrace();}
- static void unexpected(Throwable t, String msg) {
- System.out.println(msg); failed++; t.printStackTrace();}
- static boolean check(boolean cond) {if (cond) pass(); else fail(); return cond;}
- static void equal(Object x, Object y) {
- if (x == null ? y == null : x.equals(y)) pass();
- else fail(x + " not equal to " + y);}
- public static void main(String[] args) throws Throwable {
- try {realMain(args);} catch (Throwable t) {unexpected(t);}
- System.out.println("\nPassed = " + passed + " failed = " + failed);
- if (failed > 0) throw new AssertionError("Some tests failed");}
+ //--------------------- Infrastructure ---------------------------
+ static volatile int passed = 0, failed = 0;
+ static void pass() {passed++;}
+ static void pass(String msg) {System.out.println(msg); passed++;}
+ static void fail() {failed++; Thread.dumpStack();}
+ static void fail(String msg) {System.out.println(msg); fail();}
+ static void unexpected(Throwable t) {failed++; t.printStackTrace();}
+ static void unexpected(Throwable t, String msg) {
+ System.out.println(msg); failed++; t.printStackTrace();}
+ static boolean check(boolean cond) {if (cond) pass(); else fail(); return cond;}
+ static void equal(Object x, Object y) {
+ if (x == null ? y == null : x.equals(y)) pass();
+ else fail(x + " not equal to " + y);}
+ public static void main(String[] args) throws Throwable {
+ try {realMain(args);} catch (Throwable t) {unexpected(t);}
+ System.out.println("\nPassed = " + passed + " failed = " + failed);
+ if (failed > 0) throw new AssertionError("Some tests failed");}
}
--- a/jdk/test/javax/naming/ldap/LdapName/CompareToEqualsTests.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/javax/naming/ldap/LdapName/CompareToEqualsTests.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -23,12 +23,14 @@
/*
* @test
- * @bug 4635618
+ * @bug 4635618 7059542
* @summary Support for manipulating LDAP Names
+ * JNDI name operations should be locale independent
*/
import javax.naming.ldap.*;
import java.util.ArrayList;
+import java.util.Locale;
import java.util.List;
import javax.naming.InvalidNameException;
@@ -39,52 +41,61 @@
public static void main(String args[])
throws Exception {
-
- /**
- * Test cases:
- * 1) Same RDNs.
- * 2) same RDN sequence with an AVA ordered differently.
- * 3) RDN sequences of a differing AVA.
- * 4) RDN sequence of different length.
- * 5) RDN sequence of different Case.
- * 6) Matching binary return values.
- * 7) Binary values that don't match.
- */
- String names1[] = new String [] {
+ Locale reservedLocale = Locale.getDefault();
+ try {
+ /**
+ * Test cases:
+ * 1) Same RDNs.
+ * 2) same RDN sequence with an AVA ordered differently.
+ * 3) RDN sequences of a differing AVA.
+ * 4) RDN sequence of different length.
+ * 5) RDN sequence of different Case.
+ * 6) Matching binary return values.
+ * 7) Binary values that don't match.
+ */
+ String names1[] = new String [] {
"ou=Sales+cn=Bob", "ou=Sales+cn=Bob", "ou=Sales+cn=Bob",
"ou=Sales+cn=Scott+c=US", "cn=config"};
- String names2[] = new String [] {
+ String names2[] = new String [] {
"ou=Sales+cn=Bob", "cn=Bob+ou=Sales", "ou=Sales+cn=Scott",
"ou=Sales+cn=Scott", "Cn=COnFIG"};
- int expectedResults[] = {0, 0, -1, -1, 0};
-
+ int expectedResults[] = {0, 0, -1, -1, 0};
- for (int i = 0; i < names1.length; i++) {
- checkResults(new LdapName(names1[i]),
+ for (Locale locale : Locale.getAvailableLocales()) {
+ // reset the default locale
+ Locale.setDefault(locale);
+
+ for (int i = 0; i < names1.length; i++) {
+ checkResults(new LdapName(names1[i]),
new LdapName(names2[i]), expectedResults[i]);
- }
+ }
- byte[] value = "abcxyz".getBytes();
- Rdn rdn1 = new Rdn("binary", value);
- ArrayList rdns1 = new ArrayList();
- rdns1.add(rdn1);
- LdapName l1 = new LdapName(rdns1);
+ byte[] value = "abcxyz".getBytes();
+ Rdn rdn1 = new Rdn("binary", value);
+ ArrayList rdns1 = new ArrayList();
+ rdns1.add(rdn1);
+ LdapName l1 = new LdapName(rdns1);
- Rdn rdn2 = new Rdn("binary", value);
- ArrayList rdns2 = new ArrayList();
- rdns2.add(rdn2);
- LdapName l2 = new LdapName(rdns2);
- checkResults(l1, l2, 0);
+ Rdn rdn2 = new Rdn("binary", value);
+ ArrayList rdns2 = new ArrayList();
+ rdns2.add(rdn2);
+ LdapName l2 = new LdapName(rdns2);
+ checkResults(l1, l2, 0);
+
+ l2 = new LdapName("binary=#61626378797A");
+ checkResults(l1, l2, 0);
- l2 = new LdapName("binary=#61626378797A");
- checkResults(l1, l2, 0);
+ l2 = new LdapName("binary=#61626378797B");
+ checkResults(l1, l2, -1);
- l2 = new LdapName("binary=#61626378797B");
- checkResults(l1, l2, -1);
-
- System.out.println("Tests passed");
+ System.out.println("Tests passed");
+ }
+ } finally {
+ // restore the reserved locale
+ Locale.setDefault(reservedLocale);
+ }
}
--- a/jdk/test/javax/security/auth/login/LoginContext/ResetConfigModule.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/javax/security/auth/login/LoginContext/ResetConfigModule.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,7 +25,6 @@
* @test
* @bug 4633622
* @summary bug in LoginContext when Configuration is subclassed
- *
* @build ResetConfigModule ResetModule
* @run main ResetConfigModule
*/
@@ -40,32 +39,42 @@
public static void main(String[] args) throws Exception {
- Configuration.setConfiguration(new MyConfig());
+ Configuration previousConf = Configuration.getConfiguration();
+ ClassLoader previousCL = Thread.currentThread().getContextClassLoader();
- LoginContext lc = new LoginContext("test");
try {
- lc.login();
- throw new SecurityException("test 1 failed");
- } catch (LoginException le) {
- if (le.getCause() != null &&
- le.getCause() instanceof SecurityException) {
- System.out.println("good so far");
- } else {
- throw le;
+ Thread.currentThread().setContextClassLoader(
+ ResetConfigModule.class.getClassLoader());
+ Configuration.setConfiguration(new MyConfig());
+
+ LoginContext lc = new LoginContext("test");
+ try {
+ lc.login();
+ throw new SecurityException("test 1 failed");
+ } catch (LoginException le) {
+ if (le.getCause() != null &&
+ le.getCause() instanceof SecurityException) {
+ System.out.println("good so far");
+ } else {
+ throw le;
+ }
}
- }
- LoginContext lc2 = new LoginContext("test2");
- try {
- lc2.login();
- throw new SecurityException("test 2 failed");
- } catch (LoginException le) {
- if (le.getCause() != null &&
- le.getCause() instanceof SecurityException) {
- System.out.println("test succeeded");
- } else {
- throw le;
+ LoginContext lc2 = new LoginContext("test2");
+ try {
+ lc2.login();
+ throw new SecurityException("test 2 failed");
+ } catch (LoginException le) {
+ if (le.getCause() != null &&
+ le.getCause() instanceof SecurityException) {
+ System.out.println("test succeeded");
+ } else {
+ throw le;
+ }
}
+ } finally {
+ Configuration.setConfiguration(previousConf);
+ Thread.currentThread().setContextClassLoader(previousCL);
}
}
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/security/auth/x500/X500Principal/Parse.java Wed Jul 05 17:49:56 2017 +0200
@@ -0,0 +1,73 @@
+/*
+ * 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 7024771
+ * @summary various X500Principal DN parsing tests
+ */
+
+import javax.security.auth.x500.X500Principal;
+
+public class Parse {
+
+ private static TestCase[] testCases = {
+ new TestCase("CN=prefix\\<>suffix", false)
+ };
+
+ public static void main(String args[]) throws Exception {
+ for (int i = 0; i < testCases.length; i++) {
+ testCases[i].run();
+ }
+ System.out.println("Test completed ok.");
+ }
+}
+
+class TestCase {
+
+ private String name;
+ private boolean expectedResult;
+
+ TestCase(String name, boolean expectedResult) {
+ this.name = name;
+ this.expectedResult = expectedResult;
+ }
+
+ void run() throws Exception {
+ Exception f = null;
+ try {
+ System.out.println("Parsing: \"" + name + "\"");
+ new X500Principal(name);
+ if (expectedResult == false) {
+ f = new Exception("Successfully parsed invalid name");
+ }
+ } catch (IllegalArgumentException e) {
+ if (expectedResult == true) {
+ throw e;
+ }
+ }
+ if (f != null) {
+ throw f;
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sql/rowset/serial/SerialBlob/SetBinaryStream.java Wed Jul 05 17:49:56 2017 +0200
@@ -0,0 +1,42 @@
+/*
+ * 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.
+ */
+import javax.sql.rowset.serial.SerialBlob;
+import javax.sql.rowset.serial.SerialException;
+
+/**
+ * @test
+ * @bug 7077451
+ * @summary tests if the correct exception is thrown when calling method setBinaryStream() on SerialBlob
+ */
+public class SetBinaryStream {
+
+ public static void main(String[] args) throws Exception {
+ SerialBlob blob = new SerialBlob(new byte[0]);
+ try {
+ blob.setBinaryStream(0);
+ } catch (SerialException e) {
+ System.out.println("Test PASSED");
+ }
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sql/rowset/serial/SerialClob/SetAsciiStream.java Wed Jul 05 17:49:56 2017 +0200
@@ -0,0 +1,42 @@
+/*
+ * 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.
+ */
+import javax.sql.rowset.serial.SerialClob;
+import javax.sql.rowset.serial.SerialException;
+
+/**
+ * @test
+ * @bug 7077451
+ * @summary tests if the correct exception is thrown when calling method setAsciiStream() on SerialClob
+ */
+public class SetAsciiStream {
+
+ public static void main(String[] args) throws Exception {
+ SerialClob clob = new SerialClob(new char[0]);
+ try {
+ clob.setAsciiStream(0);
+ } catch (SerialException e) {
+ System.out.println("Test PASSED");
+ }
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sql/rowset/serial/SerialClob/SetCharacterStream.java Wed Jul 05 17:49:56 2017 +0200
@@ -0,0 +1,42 @@
+/*
+ * 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.
+ */
+import javax.sql.rowset.serial.SerialClob;
+import javax.sql.rowset.serial.SerialException;
+
+/**
+ * @test
+ * @bug 7077451
+ * @summary tests if the correct exception is thrown when calling method setCharacterStream() on SerialClob
+ */
+public class SetCharacterStream {
+
+ public static void main(String[] args) throws Exception {
+ SerialClob clob = new SerialClob(new char[0]);
+ try {
+ clob.setCharacterStream(0);
+ } catch (SerialException e) {
+ System.out.println("Test PASSED");
+ }
+ }
+
+}
--- a/jdk/test/javax/swing/JPopupMenu/6694823/bug6694823.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/javax/swing/JPopupMenu/6694823/bug6694823.java Wed Jul 05 17:49:56 2017 +0200
@@ -69,7 +69,12 @@
toolkit.realSync();
System.out.println("Test passed!");
- frame.dispose();
+
+ SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ frame.dispose();
+ }
+ });
}
private static void createGui() {
@@ -88,30 +93,44 @@
frame.setSize(200, 200);
}
- private static void showPopup(final boolean shouldBeShifted) {
- SwingUtilities.invokeLater(new Runnable() {
+ private static void showPopup(final boolean shouldBeShifted) throws Exception {
+ SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
// Place frame just above the task bar
Dimension screenSize = toolkit.getScreenSize();
frame.setLocation(screenSize.width / 2,
screenSize.height - frame.getHeight() - screenInsets.bottom);
frame.setVisible(true);
+ }
+ });
+ // Ensure frame is visible
+ toolkit.realSync();
+
+ final Point point = new Point();
+ SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
// Place popup over the task bar
+ point.x = 0;
+ point.y = frame.getHeight() - popup.getPreferredSize().height + screenInsets.bottom;
+ popup.show(frame, point.x, point.y);
+ }
+ });
+
+ // Ensure popup is visible
+ toolkit.realSync();
+
+ SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
Point frameLoc = frame.getLocationOnScreen();
- int x = 0;
- int y = frame.getHeight()
- - popup.getPreferredSize().height + screenInsets.bottom;
- popup.show(frame, x, y);
-
if (shouldBeShifted) {
if (popup.getLocationOnScreen()
- .equals(new Point(frameLoc.x, frameLoc.y + y))) {
+ .equals(new Point(frameLoc.x, frameLoc.y + point.y))) {
throw new RuntimeException("Popup is not shifted");
}
} else {
if (!popup.getLocationOnScreen()
- .equals(new Point(frameLoc.x, frameLoc.y + y))) {
+ .equals(new Point(frameLoc.x, frameLoc.y + point.y))) {
throw new RuntimeException("Popup is unexpectedly shifted");
}
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/text/html/TableView/7030332/bug7030332.html Wed Jul 05 17:49:56 2017 +0200
@@ -0,0 +1,12 @@
+<html>
+<body>
+<applet code="bug7030332.class" width=600 height=400></applet>
+
+Compare Golden Images with rendered JEditorPane.
+They should looks simalar in each line. Pay attention to:
+
+1. Border width around tables
+2. Border width around cells
+
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/text/html/TableView/7030332/bug7030332.java Wed Jul 05 17:49:56 2017 +0200
@@ -0,0 +1,98 @@
+/*
+ * 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 7030332
+ @summary Default borders in tables looks incorrect JEditorPane
+ @author Pavel Porvatov
+ * @run applet/manual=yesno bug7030332.html
+*/
+
+import javax.swing.*;
+import java.awt.*;
+import java.net.URL;
+
+public class bug7030332 extends JApplet {
+ public static final String[] HTML_SAMPLES = new String[]{
+ "<table border><tr><th>Column1</th><th>Column2</th></tr></table>",
+ "<table border=\"\"><tr><th>Column1</th><th>Column2</th></tr></table>",
+ "<table border=\"1\"><tr><th>Column1</th><th>Column2</th></tr></table>",
+ "<table border=\"2\"><tr><th>Column1</th><th>Column2</th></tr></table>",
+ };
+
+ public static void main(String[] args) throws Exception {
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ JFrame frame = new JFrame();
+
+ frame.setContentPane(createContentPane());
+ frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
+ frame.setSize(600, 400);
+ frame.setLocationRelativeTo(null);
+
+ frame.setVisible(true);
+
+ }
+ });
+ }
+
+ public void init() {
+ try {
+ SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ setContentPane(createContentPane());
+ }
+ });
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private static Container createContentPane() {
+ JPanel result = new JPanel(new GridLayout(HTML_SAMPLES.length + 1, 3, 10, 10));
+
+ result.add(new JLabel("Html code"));
+ result.add(new JLabel("Golden image"));
+ result.add(new JLabel("JEditorPane"));
+
+ for (int i = 0; i < HTML_SAMPLES.length; i++) {
+ String htmlSample = HTML_SAMPLES[i];
+
+ JTextArea textArea = new JTextArea(htmlSample);
+
+ textArea.setLineWrap(true);
+
+ result.add(textArea);
+
+ String imageName = "sample" + i + ".png";
+ URL resource = bug7030332.class.getResource(imageName);
+
+ result.add(resource == null ? new JLabel(imageName + " not found") :
+ new JLabel(new ImageIcon(resource), SwingConstants.LEFT));
+
+ result.add(new JEditorPane("text/html", htmlSample));
+ }
+
+ return result;
+ }
+}
Binary file jdk/test/javax/swing/text/html/TableView/7030332/sample0.png has changed
Binary file jdk/test/javax/swing/text/html/TableView/7030332/sample1.png has changed
Binary file jdk/test/javax/swing/text/html/TableView/7030332/sample2.png has changed
Binary file jdk/test/javax/swing/text/html/TableView/7030332/sample3.png has changed
Binary file jdk/test/javax/swing/text/html/TableView/7030332/sample4.png has changed
--- a/jdk/test/sun/net/www/protocol/file/DirPermissionDenied.sh Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/net/www/protocol/file/DirPermissionDenied.sh Wed Jul 05 17:49:56 2017 +0200
@@ -37,5 +37,9 @@
$TESTJAVA/bin/java -classpath $TESTCLASSES DirPermissionDenied ${TESTDIR}
result=$?
+
+# Add back read access for user, otherwise not removable on some systems
+chmod u+r ${TESTDIR}
+
rm -rf ${TESTDIR}
exit $result
--- a/jdk/test/sun/nio/cs/TestCp834_SBCS.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/nio/cs/TestCp834_SBCS.java Wed Jul 05 17:49:56 2017 +0200
@@ -26,7 +26,6 @@
@summary Check all Cp933 SBCS characters are not supported in Cp834
*/
-import sun.io.*;
import java.io.*;
import java.nio.*;
import java.nio.charset.*;
@@ -36,8 +35,6 @@
// The correctness of 1:1 mapping is Coverted by CoderTest.java
// and TestConv.java, we only need to verify that SBCS characters
// are not supported by this charset.
- CharToByteConverter cb834 = CharToByteConverter.getConverter("Cp834");
- ByteToCharConverter bc834 = ByteToCharConverter.getConverter("Cp834");
CharsetEncoder enc834 = Charset.forName("Cp834")
.newEncoder()
.onUnmappableCharacter(CodingErrorAction.REPLACE)
@@ -73,27 +70,6 @@
ByteBuffer bb = enc834.encode(CharBuffer.wrap(ca));
if (bb.get() != (byte)0xfe || bb.get() != (byte)0xfe)
throw new Exception("SBCS is supported in IBM834 encoder");
-
- boolean isMalformed = false;
- int ret = 0;
- bc834.reset();
- try {
- ret = bc834.convert(ba, 0, 1, ca, 0, 1);
- } catch (sun.io.MalformedInputException x) { isMalformed = true; }
- if (!isMalformed && ret != 0 && ca[0] != '\ufffd') {
- // three scenarios (1)malformed (2)held as an incomplete
- // input or (3)return replacement all mean "no sbcs"
- throw new Exception("SBCS is supported in Cp834 b2c");
- }
-
- if (cb834.canConvert(c))
- throw new Exception("SBCS can be converted in Cp834 c2b ");
-
- ca[0] = c;
- if (cb834.convert(ca, 0, 1, ba2, 0, 2) != 2 ||
- ba2[0] != (byte)0xfe || ba2[1] != (byte)0xfe) {
- throw new Exception("SBCS is supported in Cp834 c2b");
- }
}
}
}
--- a/jdk/test/sun/nio/cs/TestISCII91.java Thu Sep 01 13:54:50 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2008, 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 6431650
- @summary Check charset ISCII91 and C2B/B2CISCII91 yield same encoding/decoding result
- */
-
-
-import java.nio.*;
-import java.nio.charset.*;
-import sun.io.*;
-
-public class TestISCII91 {
- public static void main(String[] args) throws Throwable{
- CharToByteConverter c2b = new CharToByteISCII91();
- ByteToCharConverter b2c = new ByteToCharISCII91();
- Charset cs = Charset.forName("ISCII91");
- String charsToEncode = getCharsForEncoding("ISCII91");
-
- byte [] c2bBytes = c2b.convertAll(charsToEncode.toCharArray());
- byte [] csBytes = cs.encode(charsToEncode).array();
- for (int i = 0; i < c2bBytes.length; ++i) {
- if (c2bBytes[i] != csBytes[i])
- throw new RuntimeException("ISCII91 encoding failed!");
- }
-
- char[] c2bChars = b2c.convertAll(c2bBytes);
- char[] csChars = cs.decode(ByteBuffer.wrap(csBytes)).array();
- for (int i = 0; i < c2bChars.length; ++i) {
- if (c2bChars[i] != csChars[i])
- throw new RuntimeException("ISCII91 decoding failed!");
- }
- }
-
-
- static String getCharsForEncoding(String encodingName)
- throws CharacterCodingException{
- Charset set = Charset.forName(encodingName);
- CharBuffer chars = CharBuffer.allocate(300);
- CharsetEncoder encoder = set.newEncoder();
- for (int c = 0; chars.remaining() > 0 && c < Character.MAX_VALUE; ++c) {
- if (Character.isDefined((char) c) && !Character.isISOControl((char) c) && encoder.canEncode((char) c)) {
- chars.put((char) c);
- }
- }
- chars.limit(chars.position());
- chars.rewind();
- return chars.toString();
- }
-}
--- a/jdk/test/sun/security/ec/TestEC.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ec/TestEC.java Wed Jul 05 17:49:56 2017 +0200
@@ -28,11 +28,13 @@
* @library ../pkcs11
* @library ../pkcs11/ec
* @library ../pkcs11/sslecc
+ * @library ../../../java/security/testlibrary
* @compile -XDignore.symbol.file TestEC.java
* @run main TestEC
*/
import java.security.Provider;
+import java.security.Security;
/*
* Leverage the collection of EC tests used by PKCS11
@@ -51,6 +53,15 @@
public class TestEC {
public static void main(String[] args) throws Exception {
+ ProvidersSnapshot snapshot = ProvidersSnapshot.create();
+ try {
+ main0(args);
+ } finally {
+ snapshot.restore();
+ }
+ }
+
+ public static void main0(String[] args) throws Exception {
Provider p = new sun.security.ec.SunEC();
System.out.println("Running tests with " + p.getName() +
" provider...\n");
@@ -67,6 +78,11 @@
new TestECGenSpec().main(p);
new ReadPKCS12().main(p);
new ReadCertificates().main(p);
+
+ // ClientJSSEServerJSSE fails on Solaris 11 when both SunEC and
+ // SunPKCS11-Solaris providers are enabled.
+ // Workaround:
+ // Security.removeProvider("SunPKCS11-Solaris");
new ClientJSSEServerJSSE().main(p);
long stop = System.currentTimeMillis();
--- a/jdk/test/sun/security/jgss/spnego/NoSpnegoAsDefMech.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/jgss/spnego/NoSpnegoAsDefMech.java Wed Jul 05 17:49:56 2017 +0200
@@ -36,7 +36,7 @@
public static void main(String[] argv) throws Exception {
System.setProperty("sun.security.jgss.mechanism", GSSUtil.GSS_SPNEGO_MECH_OID.toString());
try {
- GSSManager.getInstance().createName("service@host", GSSName.NT_HOSTBASED_SERVICE, new Oid("1.3.6.1.5.5.2"));
+ GSSManager.getInstance().createName("service@localhost", GSSName.NT_HOSTBASED_SERVICE, new Oid("1.3.6.1.5.5.2"));
} catch (GSSException e) {
// This is OK, for example, krb5.conf is missing or other problems
}
--- a/jdk/test/sun/security/krb5/Krb5NameEquals.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/krb5/Krb5NameEquals.java Wed Jul 05 17:49:56 2017 +0200
@@ -31,8 +31,8 @@
public class Krb5NameEquals {
- private static String NAME_STR1 = "service@host";
- private static String NAME_STR2 = "service@host2";
+ private static String NAME_STR1 = "service@localhost";
+ private static String NAME_STR2 = "service2@localhost";
private static final Oid MECH;
static {
@@ -57,7 +57,7 @@
GSSName name3 = mgr.createName(NAME_STR1,
GSSName.NT_HOSTBASED_SERVICE, MECH);
- if (!name1.equals(name3) || !name1.equals(name3) ||
+ if (!name1.equals(name1) || !name1.equals(name3) ||
!name1.equals((Object) name1) ||
!name1.equals((Object) name3)) {
System.out.println("Error: should be the same name");
--- a/jdk/test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh Wed Jul 05 17:49:56 2017 +0200
@@ -25,6 +25,8 @@
# @bug 6599979
# @summary Ensure that re-assigning the alias works
#
+# @library ..
+# @build SecretKeysBasic
# @run shell SecretKeysBasic.sh
#
# To run by hand:
@@ -43,10 +45,9 @@
if [ "${TESTCLASSES}" = "" ] ; then
TESTCLASSES=`pwd`
fi
-
-# if running by hand on windows, change this to appropriate value
if [ "${TESTJAVA}" = "" ] ; then
- TESTJAVA="/net/shimmer/export/valeriep/jdk7/build/solaris-sparc"
+ JAVAC_CMD=`which javac`
+ TESTJAVA=`dirname $JAVAC_CMD`/..
fi
echo TESTSRC=${TESTSRC}
echo TESTCLASSES=${TESTCLASSES}
@@ -63,19 +64,41 @@
SunOS )
FS="/"
PS=":"
- SCCS="${FS}usr${FS}ccs${FS}bin${FS}sccs"
- CP="${FS}bin${FS}cp -f"
- RM="${FS}bin${FS}rm -rf"
- MKDIR="${FS}bin${FS}mkdir -p"
- CHMOD="${FS}bin${FS}chmod"
+ OS_VERSION=`uname -r`
+ case "${OS_VERSION}" in
+ 5.1* )
+ SOFTTOKEN_DIR=${TESTCLASSES}
+ export SOFTTOKEN_DIR
+ TOKENS="nss solaris"
+ ;;
+ * )
+ # SunPKCS11-Solaris Test only runs on Solaris 5.10 and later
+ TOKENS="nss"
+ ;;
+ esac
+ ;;
+ Windows_* )
+ FS="\\"
+ PS=";"
+ TOKENS="nss"
+ ;;
+ CYGWIN* )
+ FS="/"
+ PS=";"
+ TOKENS="nss"
;;
* )
- echo "Unsupported System ${OS} - Test only runs on Solaris"
- exit 0;
+ FS="/"
+ PS=":"
+ TOKENS="nss"
;;
esac
-TOKENS="nss solaris"
+CP="cp -f"
+RM="rm -rf"
+MKDIR="mkdir -p"
+CHMOD="chmod"
+
STATUS=0
for token in ${TOKENS}
do
@@ -91,18 +114,6 @@
USED_FILE_LIST="${TESTCLASSES}${FS}cert8.db ${TESTCLASSES}${FS}key3.db"
elif [ ${token} = "solaris" ]
then
- OS_VERSION=`uname -r`
- case "${OS_VERSION}" in
- 5.1* )
- SOFTTOKEN_DIR=${TESTCLASSES}
- export SOFTTOKEN_DIR
- ;;
- * )
- echo "Unsupported Version ${OS_VERSION} - Test only runs on Solaris"
- exit 0;
- ;;
- esac
-
# copy keystore into write-able location
if [ -d ${TESTCLASSES}${FS}pkcs11_softtoken ]
then
@@ -127,12 +138,6 @@
USED_FILE_LIST="${TESTCLASSES}${FS}pkcs11_softtoken"
fi
-cd ${TESTCLASSES}
-${TESTJAVA}${FS}bin${FS}javac \
- -classpath ${TESTCLASSES} \
- -d ${TESTCLASSES} \
- ${TESTSRC}${FS}SecretKeysBasic.java
-
# run test
cd ${TESTSRC}
${TESTJAVA}${FS}bin${FS}java \
--- a/jdk/test/sun/security/pkcs11/PKCS11Test.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/pkcs11/PKCS11Test.java Wed Jul 05 17:49:56 2017 +0200
@@ -72,10 +72,33 @@
}
public static void main(PKCS11Test test) throws Exception {
- System.out.println("Beginning test run " + test.getClass().getName() + "...");
- testDefault(test);
- testNSS(test);
- testDeimos(test);
+ Provider[] oldProviders = Security.getProviders();
+ try {
+ System.out.println("Beginning test run " + test.getClass().getName() + "...");
+ testDefault(test);
+ testNSS(test);
+ testDeimos(test);
+ } finally {
+ Provider[] newProviders = Security.getProviders();
+ // Do not restore providers if nothing changed. This is especailly
+ // useful for ./Provider/Login.sh, where a SecurityManager exists.
+ if (oldProviders.length == newProviders.length) {
+ boolean found = false;
+ for (int i = 0; i<oldProviders.length; i++) {
+ if (oldProviders[i] != newProviders[i]) {
+ found = true;
+ break;
+ }
+ }
+ if (!found) return;
+ }
+ for (Provider p: newProviders) {
+ Security.removeProvider(p.getName());
+ }
+ for (Provider p: oldProviders) {
+ Security.addProvider(p);
+ }
+ }
}
public static void testDeimos(PKCS11Test test) throws Exception {
@@ -153,21 +176,21 @@
return libdir;
}
+ protected static void safeReload(String lib) throws Exception {
+ try {
+ System.load(lib);
+ } catch (UnsatisfiedLinkError e) {
+ if (e.getMessage().contains("already loaded")) {
+ return;
+ }
+ }
+ }
+
static boolean loadNSPR(String libdir) throws Exception {
// load NSS softoken dependencies in advance to avoid resolver issues
- try {
- System.load(libdir + System.mapLibraryName(NSPR_PREFIX + "nspr4"));
- } catch (UnsatisfiedLinkError e) {
- // GLIBC problem on older linux-amd64 machines
- if (libdir.contains("linux-amd64")) {
- System.out.println(e);
- System.out.println("NSS does not work on this platform, skipping.");
- return false;
- }
- throw e;
- }
- System.load(libdir + System.mapLibraryName(NSPR_PREFIX + "plc4"));
- System.load(libdir + System.mapLibraryName(NSPR_PREFIX + "plds4"));
+ safeReload(libdir + System.mapLibraryName(NSPR_PREFIX + "nspr4"));
+ safeReload(libdir + System.mapLibraryName(NSPR_PREFIX + "plc4"));
+ safeReload(libdir + System.mapLibraryName(NSPR_PREFIX + "plds4"));
return true;
}
--- a/jdk/test/sun/security/pkcs11/Secmod/AddPrivateKey.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/pkcs11/Secmod/AddPrivateKey.java Wed Jul 05 17:49:56 2017 +0200
@@ -27,6 +27,7 @@
* @summary Test that the PKCS#11 KeyStore handles RSA, DSA, and EC keys
* @author Andreas Sterbenz
* @library ..
+ * @run main/othervm AddPrivateKey
*/
import java.io.*;
--- a/jdk/test/sun/security/pkcs11/Secmod/AddTrustedCert.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/pkcs11/Secmod/AddTrustedCert.java Wed Jul 05 17:49:56 2017 +0200
@@ -27,6 +27,7 @@
* @summary make sure we can add a trusted cert to the NSS KeyStore module
* @author Andreas Sterbenz
* @library ..
+ * @run main/othervm AddTrustedCert
*/
import java.io.*;
--- a/jdk/test/sun/security/pkcs11/Secmod/Crypto.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/pkcs11/Secmod/Crypto.java Wed Jul 05 17:49:56 2017 +0200
@@ -27,6 +27,7 @@
* @summary verify that NSS no-db mode works correctly
* @author Andreas Sterbenz
* @library ..
+ * @run main/othervm Crypto
*/
import java.util.*;
--- a/jdk/test/sun/security/pkcs11/Secmod/GetPrivateKey.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/pkcs11/Secmod/GetPrivateKey.java Wed Jul 05 17:49:56 2017 +0200
@@ -27,6 +27,7 @@
* @summary make sure we can access the NSS softtoken KeyStore and use a private key
* @author Andreas Sterbenz
* @library ..
+ * @run main/othervm GetPrivateKey
*/
import java.util.*;
--- a/jdk/test/sun/security/pkcs11/Secmod/JksSetPrivateKey.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/pkcs11/Secmod/JksSetPrivateKey.java Wed Jul 05 17:49:56 2017 +0200
@@ -27,6 +27,7 @@
* @summary store a NSS PKCS11 PrivateKeyEntry to JKS KeyStore throws confusing NPE
* @author Wang Weijun
* @library ..
+ * @run main/othervm JksSetPrivateKey
*/
import java.util.*;
--- a/jdk/test/sun/security/pkcs11/Secmod/TrustAnchors.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/pkcs11/Secmod/TrustAnchors.java Wed Jul 05 17:49:56 2017 +0200
@@ -27,6 +27,7 @@
* @summary make sure we can access the NSS trust anchor module
* @author Andreas Sterbenz
* @library ..
+ * @run main/othervm TrustAnchors
*/
import java.util.*;
--- a/jdk/test/sun/security/pkcs11/SecmodTest.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/pkcs11/SecmodTest.java Wed Jul 05 17:49:56 2017 +0200
@@ -44,8 +44,8 @@
if (loadNSPR(LIBPATH) == false) {
return false;
}
- System.load(LIBPATH + System.mapLibraryName("softokn3"));
- System.load(LIBPATH + System.mapLibraryName("nssckbi"));
+ safeReload(LIBPATH + System.mapLibraryName("softokn3"));
+ safeReload(LIBPATH + System.mapLibraryName("nssckbi"));
DBDIR = System.getProperty("test.classes", ".") + SEP + "tmpdb";
System.setProperty("pkcs11test.nss.db", DBDIR);
--- a/jdk/test/sun/security/pkcs11/ec/ReadCertificates.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/pkcs11/ec/ReadCertificates.java Wed Jul 05 17:49:56 2017 +0200
@@ -28,6 +28,7 @@
* and verify their signatures
* @author Andreas Sterbenz
* @library ..
+ * @library ../../../../java/security/testlibrary
*/
import java.io.*;
@@ -62,7 +63,7 @@
System.out.println("Provider does not support ECDSA, skipping...");
return;
}
- Security.insertProviderAt(p, 1);
+ Providers.setAt(p, 1);
random = new SecureRandom();
factory = CertificateFactory.getInstance("X.509");
--- a/jdk/test/sun/security/pkcs11/ec/ReadPKCS12.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/pkcs11/ec/ReadPKCS12.java Wed Jul 05 17:49:56 2017 +0200
@@ -27,6 +27,7 @@
* @summary Verify that we can parse ECPrivateKeys from PKCS#12 and use them
* @author Andreas Sterbenz
* @library ..
+ * @library ../../../../java/security/testlibrary
*/
import java.io.*;
@@ -52,7 +53,7 @@
System.out.println("Provider does not support ECDSA, skipping...");
return;
}
- Security.insertProviderAt(p, 1);
+ Providers.setAt(p, 1);
CertificateFactory factory = CertificateFactory.getInstance("X.509");
try {
--- a/jdk/test/sun/security/pkcs11/ec/TestECDH.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/pkcs11/ec/TestECDH.java Wed Jul 05 17:49:56 2017 +0200
@@ -27,6 +27,7 @@
* @summary Basic known answer test for ECDH
* @author Andreas Sterbenz
* @library ..
+ * @library ../../../../java/security/testlibrary
*/
import java.io.*;
@@ -59,7 +60,7 @@
System.out.println("Provider does not support ECDH, skipping");
return;
}
- Security.insertProviderAt(p, 1);
+ Providers.setAt(p, 1);
if (false) {
KeyPairGenerator kpg = KeyPairGenerator.getInstance("EC", p);
--- a/jdk/test/sun/security/pkcs11/ec/TestECDSA.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/pkcs11/ec/TestECDSA.java Wed Jul 05 17:49:56 2017 +0200
@@ -27,6 +27,7 @@
* @summary basic test of SHA1withECDSA and NONEwithECDSA signing/verifying
* @author Andreas Sterbenz
* @library ..
+ * @library ../../../../java/security/testlibrary
*/
import java.io.*;
@@ -115,7 +116,7 @@
System.out.println("ECDSA not supported, skipping");
return;
}
- Security.insertProviderAt(provider, 1);
+ Providers.setAt(provider, 1);
if (false) {
KeyPairGenerator kpg = KeyPairGenerator.getInstance("EC", provider);
--- a/jdk/test/sun/security/pkcs11/fips/CipherTest.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/pkcs11/fips/CipherTest.java Wed Jul 05 17:49:56 2017 +0200
@@ -394,47 +394,52 @@
public static void main(PeerFactory peerFactory, KeyStore keyStore,
String[] args) throws Exception {
+ SSLContext reservedSSLContext = SSLContext.getDefault();
+ try {
+ long time = System.currentTimeMillis();
+ String relPath;
+ if ((args != null) && (args.length > 0) && args[0].equals("sh")) {
+ relPath = pathToStoresSH;
+ } else {
+ relPath = pathToStores;
+ }
+ PATH = new File(System.getProperty("test.src", "."), relPath);
+ CipherTest.peerFactory = peerFactory;
+ System.out.print(
+ "Initializing test '" + peerFactory.getName() + "'...");
+// secureRandom = new SecureRandom();
+// secureRandom.nextInt();
+// trustStore = readKeyStore(trustStoreFile);
+ CipherTest.keyStore = keyStore;
+// keyStore = readKeyStore(keyStoreFile);
+ KeyManagerFactory keyFactory =
+ KeyManagerFactory.getInstance(
+ KeyManagerFactory.getDefaultAlgorithm());
+ keyFactory.init(keyStore, "test12".toCharArray());
+ keyManager = (X509ExtendedKeyManager)keyFactory.getKeyManagers()[0];
- long time = System.currentTimeMillis();
- String relPath;
- if ((args != null) && (args.length > 0) && args[0].equals("sh")) {
- relPath = pathToStoresSH;
- } else {
- relPath = pathToStores;
+ TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
+ tmf.init(keyStore);
+ trustManager = (X509TrustManager)tmf.getTrustManagers()[0];
+
+// trustManager = new AlwaysTrustManager();
+ SSLContext context = SSLContext.getInstance("TLS");
+ context.init(new KeyManager[] {keyManager},
+ new TrustManager[] {trustManager}, null);
+ SSLContext.setDefault(context);
+
+ CipherTest cipherTest = new CipherTest(peerFactory);
+ Thread serverThread = new Thread(peerFactory.newServer(cipherTest),
+ "Server");
+ serverThread.setDaemon(true);
+ serverThread.start();
+ System.out.println("Done");
+ cipherTest.run();
+ time = System.currentTimeMillis() - time;
+ System.out.println("Done. (" + time + " ms)");
+ } finally {
+ SSLContext.setDefault(reservedSSLContext);
}
- PATH = new File(System.getProperty("test.src", "."), relPath);
- CipherTest.peerFactory = peerFactory;
- System.out.print(
- "Initializing test '" + peerFactory.getName() + "'...");
-// secureRandom = new SecureRandom();
-// secureRandom.nextInt();
-// trustStore = readKeyStore(trustStoreFile);
- CipherTest.keyStore = keyStore;
-// keyStore = readKeyStore(keyStoreFile);
- KeyManagerFactory keyFactory =
- KeyManagerFactory.getInstance(
- KeyManagerFactory.getDefaultAlgorithm());
- keyFactory.init(keyStore, "test12".toCharArray());
- keyManager = (X509ExtendedKeyManager)keyFactory.getKeyManagers()[0];
-
- TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
- tmf.init(keyStore);
- trustManager = (X509TrustManager)tmf.getTrustManagers()[0];
-
-// trustManager = new AlwaysTrustManager();
- SSLContext context = SSLContext.getInstance("TLS");
- context.init(new KeyManager[] {keyManager}, new TrustManager[] {trustManager}, null);
- SSLContext.setDefault(context);
-
- CipherTest cipherTest = new CipherTest(peerFactory);
- Thread serverThread = new Thread(peerFactory.newServer(cipherTest),
- "Server");
- serverThread.setDaemon(true);
- serverThread.start();
- System.out.println("Done");
- cipherTest.run();
- time = System.currentTimeMillis() - time;
- System.out.println("Done. (" + time + " ms)");
}
static abstract class PeerFactory {
--- a/jdk/test/sun/security/pkcs11/fips/ClientJSSEServerJSSE.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/pkcs11/fips/ClientJSSEServerJSSE.java Wed Jul 05 17:49:56 2017 +0200
@@ -26,6 +26,7 @@
* @bug 6313675 6323647
* @summary Verify that all ciphersuites work in FIPS mode
* @library ..
+ * @run main/othervm ClientJSSEServerJSSE
* @ignore JSSE supported cipher suites are changed with CR 6916074,
* need to update this test case in JDK 7 soon
* @author Andreas Sterbenz
--- a/jdk/test/sun/security/pkcs11/fips/TrustManagerTest.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/pkcs11/fips/TrustManagerTest.java Wed Jul 05 17:49:56 2017 +0200
@@ -27,6 +27,7 @@
* @summary Verify that the SunJSSE trustmanager works correctly in FIPS mode
* @author Andreas Sterbenz
* @library ..
+ * @run main/othervm TrustManagerTest
*/
import java.io.*;
--- a/jdk/test/sun/security/pkcs11/rsa/TestCACerts.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/pkcs11/rsa/TestCACerts.java Wed Jul 05 17:49:56 2017 +0200
@@ -48,32 +48,35 @@
public void main(Provider p) throws Exception {
long start = System.currentTimeMillis();
Security.addProvider(p);
- String PROVIDER = p.getName();
- String javaHome = System.getProperty("java.home");
- String caCerts = javaHome + SEP + "lib" + SEP + "security" + SEP + "cacerts";
- InputStream in = new FileInputStream(caCerts);
- KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
- ks.load(in, null);
- in.close();
- for (Enumeration e = ks.aliases(); e.hasMoreElements(); ) {
- String alias = (String)e.nextElement();
- if (ks.isCertificateEntry(alias)) {
- System.out.println("* Testing " + alias + "...");
- X509Certificate cert = (X509Certificate)ks.getCertificate(alias);
- PublicKey key = cert.getPublicKey();
- String alg = key.getAlgorithm();
- if (alg.equals("RSA")) {
- System.out.println("Signature algorithm: " + cert.getSigAlgName());
- cert.verify(key, PROVIDER);
+ try {
+ String PROVIDER = p.getName();
+ String javaHome = System.getProperty("java.home");
+ String caCerts = javaHome + SEP + "lib" + SEP + "security" + SEP + "cacerts";
+ InputStream in = new FileInputStream(caCerts);
+ KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
+ ks.load(in, null);
+ in.close();
+ for (Enumeration e = ks.aliases(); e.hasMoreElements(); ) {
+ String alias = (String)e.nextElement();
+ if (ks.isCertificateEntry(alias)) {
+ System.out.println("* Testing " + alias + "...");
+ X509Certificate cert = (X509Certificate)ks.getCertificate(alias);
+ PublicKey key = cert.getPublicKey();
+ String alg = key.getAlgorithm();
+ if (alg.equals("RSA")) {
+ System.out.println("Signature algorithm: " + cert.getSigAlgName());
+ cert.verify(key, PROVIDER);
+ } else {
+ System.out.println("Skipping cert with key: " + alg);
+ }
} else {
- System.out.println("Skipping cert with key: " + alg);
+ System.out.println("Skipping alias " + alias);
}
- } else {
- System.out.println("Skipping alias " + alias);
}
+ long stop = System.currentTimeMillis();
+ System.out.println("All tests passed (" + (stop - start) + " ms).");
+ } finally {
+ Security.removeProvider(p.getName());
}
- long stop = System.currentTimeMillis();
- System.out.println("All tests passed (" + (stop - start) + " ms).");
}
-
}
--- a/jdk/test/sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java Wed Jul 05 17:49:56 2017 +0200
@@ -27,6 +27,7 @@
* @summary Verify that all ciphersuites work (incl. ECC using NSS crypto)
* @author Andreas Sterbenz
* @library ..
+ * @library ../../../../java/security/testlibrary
*/
import java.security.*;
@@ -45,7 +46,7 @@
System.out.println("Provider does not support EC, skipping");
return;
}
- Security.insertProviderAt(p, 1);
+ Providers.setAt(p, 1);
CipherTest.main(new JSSEFactory(), cmdArgs);
Security.removeProvider(p.getName());
}
--- a/jdk/test/sun/security/pkcs12/PKCS12SameKeyId.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/pkcs12/PKCS12SameKeyId.java Wed Jul 05 17:49:56 2017 +0200
@@ -86,7 +86,9 @@
// Reads from JKS keystore and pre-calculate
KeyStore ks = KeyStore.getInstance("jks");
- ks.load(new FileInputStream(JKSFILE), PASSWORD);
+ try (FileInputStream fis = new FileInputStream(JKSFILE)) {
+ ks.load(fis, PASSWORD);
+ }
for (int i=0; i<SIZE; i++) {
aliases[i] = "p" + i;
byte[] enckey = cipher.doFinal(
@@ -103,11 +105,15 @@
for (int i=0; i<SIZE; i++) {
p12.setKeyEntry(aliases[i], keys[i], certChains[i]);
}
- p12.store(new FileOutputStream(P12FILE), PASSWORD);
+ try (FileOutputStream fos = new FileOutputStream(P12FILE)) {
+ p12.store(fos, PASSWORD);
+ }
// Check private keys still match certs
p12 = KeyStore.getInstance("pkcs12");
- p12.load(new FileInputStream(P12FILE), PASSWORD);
+ try (FileInputStream fis = new FileInputStream(P12FILE)) {
+ p12.load(fis, PASSWORD);
+ }
for (int i=0; i<SIZE; i++) {
String a = "p" + i;
X509Certificate x = (X509Certificate)p12.getCertificate(a);
--- a/jdk/test/sun/security/provider/PolicyFile/Comparator.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/provider/PolicyFile/Comparator.java Wed Jul 05 17:49:56 2017 +0200
@@ -24,6 +24,7 @@
/*
* @test
* @bug 5037004
+ * @run main/othervm Comparator
* @summary Frivolous ClassCastExceptions thrown by SubjectCodeSource.implies
*
* Note: if you want to see the java.security.debug output,
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/SSLSecurity/ProviderTest.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/SSLSecurity/ProviderTest.java Wed Jul 05 17:49:56 2017 +0200
@@ -40,28 +40,32 @@
TrustManagerFactory tmf;
KeyManagerFactory kmf;
- Security.addProvider(new MyProvider());
-
- System.out.println("getting a javax SSLContext");
- sslc = SSLContext.getInstance("javax");
- sslc.init(null, null, null);
- System.out.println("\ngetting a com SSLContext");
- sslc = SSLContext.getInstance("com");
- sslc.init(null, null, null);
+ Provider extraProvider = new MyProvider();
+ Security.addProvider(extraProvider);
+ try {
+ System.out.println("getting a javax SSLContext");
+ sslc = SSLContext.getInstance("javax");
+ sslc.init(null, null, null);
+ System.out.println("\ngetting a com SSLContext");
+ sslc = SSLContext.getInstance("com");
+ sslc.init(null, null, null);
- System.out.println("\ngetting a javax TrustManagerFactory");
- tmf = TrustManagerFactory.getInstance("javax");
- tmf.init((KeyStore) null);
- System.out.println("\ngetting a com TrustManagerFactory");
- tmf = TrustManagerFactory.getInstance("com");
- tmf.init((KeyStore) null);
+ System.out.println("\ngetting a javax TrustManagerFactory");
+ tmf = TrustManagerFactory.getInstance("javax");
+ tmf.init((KeyStore) null);
+ System.out.println("\ngetting a com TrustManagerFactory");
+ tmf = TrustManagerFactory.getInstance("com");
+ tmf.init((KeyStore) null);
- System.out.println("\ngetting a javax KeyManagerFactory");
- kmf = KeyManagerFactory.getInstance("javax");
- kmf.init((KeyStore) null, null);
- System.out.println("\ngetting a com KeyManagerFactory");
- kmf = KeyManagerFactory.getInstance("com");
- kmf.init((KeyStore) null, null);
+ System.out.println("\ngetting a javax KeyManagerFactory");
+ kmf = KeyManagerFactory.getInstance("javax");
+ kmf.init((KeyStore) null, null);
+ System.out.println("\ngetting a com KeyManagerFactory");
+ kmf = KeyManagerFactory.getInstance("com");
+ kmf.init((KeyStore) null, null);
+ } finally {
+ Security.removeProvider(extraProvider.getName());
+ }
}
}
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/AppInputStream/ReadBlocksClose.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/AppInputStream/ReadBlocksClose.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,6 +25,10 @@
* @test
* @bug 4814140
* @summary AppInputStream: read can block a close
+ * @run main/othervm ReadBlocksClose
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @author Brad Wetmore
*/
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/AppInputStream/ReadHandshake.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/AppInputStream/ReadHandshake.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,6 +25,10 @@
* @test
* @bug 4514971
* @summary Verify applications do not read handshake data after failure
+ * @run main/othervm ReadHandshake
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*/
import java.io.*;
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/AppInputStream/ReadZeroBytes.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/AppInputStream/ReadZeroBytes.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,6 +25,10 @@
* @test
* @bug 6697270
* @summary Inputstream dosent behave correct
+ * @run main/othervm ReadZeroBytes
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*/
import java.io.*;
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/AppInputStream/RemoveMarkReset.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/AppInputStream/RemoveMarkReset.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,6 +25,10 @@
* @test
* @bug 4413664
* @summary remove mark/reset functionality from AppInputStream
+ * @run main/othervm RemoveMarkReset
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @author Brad Wetmore
*/
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/AppOutputStream/NoExceptionOnClose.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/AppOutputStream/NoExceptionOnClose.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,6 +25,10 @@
* @test 1.3 01/03/08
* @bug 4378397
* @summary JSSE socket output stream doesn't throw after socket is closed
+ * @run main/othervm NoExceptionOnClose
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @author Jaya Hangal
*/
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/ClientHandshaker/CipherSuiteOrder.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/ClientHandshaker/CipherSuiteOrder.java Wed Jul 05 17:49:56 2017 +0200
@@ -26,6 +26,10 @@
* @bug 4330535
* @summary Client should follow suite order in
* SSLSocket.setEnabledCipherSuites()
+ * @run main/othervm CipherSuiteOrder
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @author Jaya Hangal
*/
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/ClientHandshaker/RSAExport.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/ClientHandshaker/RSAExport.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,6 +25,10 @@
* @test
* @bug 6690018
* @summary RSAClientKeyExchange NullPointerException
+ * @run main/othervm RSAExport
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*/
/*
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/GenSSLConfigs/main.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/GenSSLConfigs/main.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,7 +1,10 @@
/*
* @test
* @build TestThread Traffic Handler ServerHandler ServerThread ClientThread
- * @run main/timeout=140 main
+ * @run main/othervm/timeout=140 main
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @summary Make sure that different configurations of SSL sockets work
*/
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/HandshakeOutStream/NullCerts.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/HandshakeOutStream/NullCerts.java Wed Jul 05 17:49:56 2017 +0200
@@ -24,7 +24,12 @@
/*
* @test
* @bug 4453053
- * @summary If a server shuts down correctly during handshaking, the client doesn't see it.
+ * @summary If a server shuts down correctly during handshaking, the client
+ * doesn't see it.
+ * @run main/othervm NullCerts
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @author Brad Wetmore
*/
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/InputRecord/ClientHelloRead.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/InputRecord/ClientHelloRead.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -25,6 +25,10 @@
* @test
* @bug 4432868
* @summary A client-hello message may not always be read correctly
+ * @run main/othervm ClientHelloRead
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*/
import java.io.*;
@@ -154,23 +158,29 @@
* we want to avoid URLspoofCheck failures in cases where the cert
* DN name does not match the hostname in the URL.
*/
- HttpsURLConnection.setDefaultHostnameVerifier(
- new NameVerifier());
- URL url = new URL("https://" + "localhost:" + serverPort
- + "/index.html");
- BufferedReader in = null;
+ HostnameVerifier reservedHV =
+ HttpsURLConnection.getDefaultHostnameVerifier();
try {
- in = new BufferedReader(new InputStreamReader(
- url.openStream()));
- String inputLine;
- System.out.print("Client recieved from the server: ");
- while ((inputLine = in.readLine()) != null)
- System.out.println(inputLine);
- in.close();
- } catch (SSLException e) {
- if (in != null)
+ HttpsURLConnection.setDefaultHostnameVerifier(
+ new NameVerifier());
+ URL url = new URL("https://" + "localhost:" + serverPort
+ + "/index.html");
+ BufferedReader in = null;
+ try {
+ in = new BufferedReader(new InputStreamReader(
+ url.openStream()));
+ String inputLine;
+ System.out.print("Client recieved from the server: ");
+ while ((inputLine = in.readLine()) != null)
+ System.out.println(inputLine);
in.close();
- throw e;
+ } catch (SSLException e) {
+ if (in != null)
+ in.close();
+ throw e;
+ }
+ } finally {
+ HttpsURLConnection.setDefaultHostnameVerifier(reservedHV);
}
}
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/InputRecord/SSLSocketTimeoutNulls.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/InputRecord/SSLSocketTimeoutNulls.java Wed Jul 05 17:49:56 2017 +0200
@@ -27,7 +27,10 @@
* @summary Setting timeouts on SSLSockets immediately return null
* after timeout occurs. This bug was fixed as part of 4393337,
* but this is another bug we want to check regressions against.
- * @run main/timeout=140 SSLSocketTimeoutNulls
+ * @run main/othervm/timeout=140 SSLSocketTimeoutNulls
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @author Brad Wetmore
*/
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/ProtocolVersion/HttpsProtocols.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/ProtocolVersion/HttpsProtocols.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2003, 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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -147,12 +147,18 @@
Thread.sleep(50);
}
- HttpsURLConnection.setDefaultHostnameVerifier(this);
+ HostnameVerifier reservedHV =
+ HttpsURLConnection.getDefaultHostnameVerifier();
+ try {
+ HttpsURLConnection.setDefaultHostnameVerifier(this);
- URL url = new URL("https://localhost:" + serverPort + "/");
- HttpURLConnection urlc = (HttpURLConnection) url.openConnection();
+ URL url = new URL("https://localhost:" + serverPort + "/");
+ HttpURLConnection urlc = (HttpURLConnection) url.openConnection();
- System.out.println("response is " + urlc.getResponseCode());
+ System.out.println("response is " + urlc.getResponseCode());
+ } finally {
+ HttpsURLConnection.setDefaultHostnameVerifier(reservedHV);
+ }
}
public boolean verify(String hostname, SSLSession session) {
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLContextImpl/BadKSProvider.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLContextImpl/BadKSProvider.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,6 +25,10 @@
* @test
* @bug 4919147
* @summary Support for token-based KeyStores
+ * @run main/othervm BadKSProvider
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*/
import java.io.*;
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLContextImpl/BadTSProvider.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLContextImpl/BadTSProvider.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,6 +25,10 @@
* @test
* @bug 4919147
* @summary Support for token-based KeyStores
+ * @run main/othervm BadTSProvider
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*/
import java.io.*;
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLContextImpl/GoodProvider.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLContextImpl/GoodProvider.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,6 +25,10 @@
* @test
* @bug 4919147
* @summary Support for token-based KeyStores
+ * @run main/othervm GoodProvider
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*/
import java.io.*;
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/RehandshakeFinished.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/RehandshakeFinished.java Wed Jul 05 17:49:56 2017 +0200
@@ -26,6 +26,10 @@
* @bug 6207322
* @summary SSLEngine is returning a premature FINISHED message when doing
* an abbreviated handshake.
+ * @run main/othervm RehandshakeFinished
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*
* This test may need some updating if the messages change order.
* Currently I'm expecting that there is a simple renegotiation, with
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/SSLEngineDeadlock.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/SSLEngineDeadlock.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,6 +25,10 @@
* @test
* @bug 6492872
* @summary Deadlock in SSLEngine
+ * @run main/othervm SSLEngineDeadlock
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*
* @author Brad R. Wetmore
*/
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSessionImpl/HashCodeMissing.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSessionImpl/HashCodeMissing.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,6 +25,10 @@
* @test
* @bug 4910892
* @summary 4518403 was not properly fixed. hashcode should be hashCode.
+ * @run main/othervm HashCodeMissing
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @author Brad Wetmore
*/
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/AsyncSSLSocketClose.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/AsyncSSLSocketClose.java Wed Jul 05 17:49:56 2017 +0200
@@ -26,6 +26,10 @@
* @bug 6447412
* @summary Issue with socket.close() for ssl sockets when poweroff on
* other system
+ * @run main/othervm AsyncSSLSocketClose
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*/
import javax.net.ssl.*;
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/ClientModeClientAuth.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/ClientModeClientAuth.java Wed Jul 05 17:49:56 2017 +0200
@@ -24,8 +24,11 @@
/*
* @test
* @bug 4390659
- * @run main/othervm -Djavax.net.debug=all ClientModeClientAuth
* @summary setNeedClientAuth() isn't working after a handshaker is established
+ * @run main/othervm ClientModeClientAuth
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @author Brad Wetmore
*/
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/ClientTimeout.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/ClientTimeout.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,6 +25,10 @@
* @test
* @bug 4836493
* @summary Socket timeouts for SSLSockets causes data corruption.
+ * @run main/othervm ClientTimeout
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*/
import java.io.*;
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/CloseSocketException.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/CloseSocketException.java Wed Jul 05 17:49:56 2017 +0200
@@ -26,6 +26,10 @@
* @bug 4969799
* @summary javax.net.ssl.SSLSocket.SSLSocket(InetAddress,int) shouldn't
* throw exception
+ * @run main/othervm CloseSocketException
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*
* This is making sure that starting a new handshake throws the right
* exception. There is a similar test for SSLEngine.
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/InvalidateServerSessionRenegotiate.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/InvalidateServerSessionRenegotiate.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,6 +25,10 @@
* @test
* @bug 4403428
* @summary Invalidating JSSE session on server causes SSLProtocolException
+ * @run main/othervm InvalidateServerSessionRenegotiate
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @author Brad Wetmore
*/
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/NewSocketMethods.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/NewSocketMethods.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,6 +25,10 @@
* @test
* @bug 4429176
* @summary need to sync up SSL sockets with merlin java.net changes
+ * @run main/othervm NewSocketMethods
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*/
import java.io.*;
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/NonAutoClose.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/NonAutoClose.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,6 +25,10 @@
* @test
* @bug 4404399
* @summary When a layered SSL socket is closed, it should wait for close_notify
+ * @run main/othervm NonAutoClose
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @author Brad Wetmore
*/
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/ReuseAddr.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/ReuseAddr.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,6 +25,10 @@
* @test
* @bug 4482446
* @summary java.net.SocketTimeoutException on 98, NT, 2000 for JSSE
+ * @run main/othervm ReuseAddr
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @author Brad Wetmore
*/
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/ReverseNameLookup.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/ReverseNameLookup.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,6 +25,10 @@
* @test
* @bug 4748292
* @summary Prevent/Disable reverse name lookups with JSSE SSL sockets
+ * @run main/othervm ReverseNameLookup
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*/
import java.io.*;
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/SSLSocketImplThrowsWrongExceptions.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/SSLSocketImplThrowsWrongExceptions.java Wed Jul 05 17:49:56 2017 +0200
@@ -26,6 +26,10 @@
* @bug 4361124 4325806
* @summary SSLServerSocket isn't throwing exceptions when negotiations are
* failing & java.net.SocketException: occures in Auth and clientmode
+ * @run main/othervm SSLSocketImplThrowsWrongExceptions
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @author Brad Wetmore
*/
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/ServerTimeout.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/ServerTimeout.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,6 +25,10 @@
* @test
* @bug 4836493
* @summary Socket timeouts for SSLSockets causes data corruption.
+ * @run main/othervm ServerTimeout
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*/
import java.io.*;
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/SetClientMode.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/SetClientMode.java Wed Jul 05 17:49:56 2017 +0200
@@ -26,6 +26,10 @@
* @bug 6223624
* @summary SSLSocket.setUseClientMode() fails to throw expected
* IllegalArgumentException
+ * @run main/othervm SetClientMode
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*/
/*
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/UnconnectedSocketWrongExceptions.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/UnconnectedSocketWrongExceptions.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,6 +25,11 @@
* @test
* @bug 4480441
* @summary startHandshake giving wrong message when unconnected.
+ * @run main/othervm UnconnectedSocketWrongExceptions
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
+ *
* @author Brad Wetmore
*/
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/ServerHandshaker/AnonCipherWithWantClientAuth.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/ServerHandshaker/AnonCipherWithWantClientAuth.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,7 +25,10 @@
* @test
* @bug 4392475
* @summary Calling setWantClientAuth(true) disables anonymous suites
- * @run main/timeout=180 AnonCipherWithWantClientAuth
+ * @run main/othervm/timeout=180 AnonCipherWithWantClientAuth
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*/
import java.io.*;
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/ServerHandshaker/GetPeerHost.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/ServerHandshaker/GetPeerHost.java Wed Jul 05 17:49:56 2017 +0200
@@ -22,10 +22,13 @@
*/
/**
- *@test
- *@bug 4302026
- *@run main GetPeerHost
- *@summary make sure the server side doesn't do DNS lookup.
+ * @test
+ * @bug 4302026
+ * @run main/othervm GetPeerHost
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
+ * @summary make sure the server side doesn't do DNS lookup.
*/
import javax.net.*;
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SocketCreation/SocketCreation.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SocketCreation/SocketCreation.java Wed Jul 05 17:49:56 2017 +0200
@@ -27,7 +27,10 @@
* @summary This test tries all the different ways in which an SSL
* connection can be established to exercise different SSLSocketImpl
* constructors.
- * @run main/timeout=300 SocketCreation
+ * @run main/othervm/timeout=300 SocketCreation
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*/
import java.io.*;
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/ClientServer.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/ClientServer.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,6 +25,10 @@
* @test
* @bug 4717766
* @summary 1.0.3 JsseX509TrustManager erroneously calls isClientTrusted()
+ * @run main/othervm ClientServer
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @ignore JSSE supports algorithm constraints with CR 6916074,
* need to update this test case in JDK 7 soon
* @author Brad Wetmore
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/PKIXExtendedTM.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/PKIXExtendedTM.java Wed Jul 05 17:49:56 2017 +0200
@@ -26,6 +26,10 @@
* @test
* @bug 6916074
* @summary Add support for TLS 1.2
+ * @run main/othervm PKIXExtendedTM
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*/
import java.net.*;
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/SelfIssuedCert.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/SelfIssuedCert.java Wed Jul 05 17:49:56 2017 +0200
@@ -27,6 +27,9 @@
* @summary support self-issued certificate
* @run main/othervm SelfIssuedCert PKIX
* @run main/othervm SelfIssuedCert SunX509
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @author Xuelei Fan
*/
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/SunX509ExtendedTM.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/SunX509ExtendedTM.java Wed Jul 05 17:49:56 2017 +0200
@@ -24,8 +24,11 @@
/*
* @test
* @bug 6916074
- * @run main/othervm -Djavax.net.debug=all SunX509ExtendedTM
* @summary Add support for TLS 1.2
+ * @run main/othervm SunX509ExtendedTM
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*/
import java.net.*;
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/X509ExtendedTMEnabled.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/X509ExtendedTMEnabled.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,6 +25,10 @@
* @test
* @bug 6916074
* @summary Add support for TLS 1.2
+ * @run main/othervm X509ExtendedTMEnabled
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*
* Ensure that the SunJSSE provider enables the X509ExtendedTrustManager.
*/
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/spi/ProviderInit.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/spi/ProviderInit.java Wed Jul 05 17:49:56 2017 +0200
@@ -26,6 +26,10 @@
* @bug 4522550
* @summary SSLContext TrustMananagerFactory and KeyManagerFactory
* should throw if not init
+ * @run main/othervm ProviderInit
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @author Jaya Hangal
*/
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/www/protocol/https/HttpsClient/ProxyAuthTest.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/www/protocol/https/HttpsClient/ProxyAuthTest.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -25,7 +25,11 @@
* @test
* @bug 4323990 4413069
* @summary HttpsURLConnection doesn't send Proxy-Authorization on CONNECT
- * Incorrect checking of proxy server response
+ * Incorrect checking of proxy server response
+ * @run main/othervm ProxyAuthTest
+ *
+ * No way to reserve and restore java.lang.Authenticator, need to run this
+ * test in othervm mode.
*/
import java.io.*;
@@ -77,8 +81,7 @@
/*
* Main method to create the server and the client
*/
- public static void main(String args[]) throws Exception
- {
+ public static void main(String args[]) throws Exception {
String keyFilename =
System.getProperty("test.src", "./") + "/" + pathToStores +
"/" + keyStoreFile;
@@ -110,10 +113,9 @@
try {
doClientSide();
} catch (Exception e) {
- System.out.println("Client side failed: " +
- e.getMessage());
+ System.out.println("Client side failed: " + e.getMessage());
throw e;
- }
+ }
}
private static ServerSocketFactory getServerSocketFactory
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/www/protocol/https/HttpsClient/ServerIdentityTest.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/www/protocol/https/HttpsClient/ServerIdentityTest.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -26,6 +26,11 @@
* @bug 4328195
* @summary Need to include the alternate subject DN for certs,
* https should check for this
+ * @run main/othervm ServerIdentityTest
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
+ *
* @author Yingxian Wang
*/
@@ -136,39 +141,45 @@
volatile Exception clientException = null;
public static void main(String[] args) throws Exception {
- for (int i = 0; i < keyStoreFiles.length; i++) {
- String keyFilename =
- System.getProperty("test.src", ".") + "/" + pathToStores +
- "/" + keyStoreFiles[i];
- String trustFilename =
- System.getProperty("test.src", ".") + "/" + pathToStores +
- "/" + trustStoreFiles[i];
+ SSLSocketFactory reservedSFactory =
+ HttpsURLConnection.getDefaultSSLSocketFactory();
+ try {
+ for (int i = 0; i < keyStoreFiles.length; i++) {
+ String keyFilename =
+ System.getProperty("test.src", ".") + "/" + pathToStores +
+ "/" + keyStoreFiles[i];
+ String trustFilename =
+ System.getProperty("test.src", ".") + "/" + pathToStores +
+ "/" + trustStoreFiles[i];
- System.setProperty("javax.net.ssl.keyStore", keyFilename);
- System.setProperty("javax.net.ssl.keyStorePassword", passwd);
- System.setProperty("javax.net.ssl.trustStore", trustFilename);
- System.setProperty("javax.net.ssl.trustStorePassword", passwd);
+ System.setProperty("javax.net.ssl.keyStore", keyFilename);
+ System.setProperty("javax.net.ssl.keyStorePassword", passwd);
+ System.setProperty("javax.net.ssl.trustStore", trustFilename);
+ System.setProperty("javax.net.ssl.trustStorePassword", passwd);
- if (debug)
- System.setProperty("javax.net.debug", "all");
- SSLContext context = SSLContext.getInstance("SSL");
+ if (debug)
+ System.setProperty("javax.net.debug", "all");
+ SSLContext context = SSLContext.getInstance("SSL");
- KeyManager[] kms = new KeyManager[1];
- KeyStore ks = KeyStore.getInstance("JKS");
- FileInputStream fis = new FileInputStream(keyFilename);
- ks.load(fis, passwd.toCharArray());
- fis.close();
- KeyManager km = new MyKeyManager(ks, passwd.toCharArray());
- kms[0] = km;
- context.init(kms, null, null);
- HttpsURLConnection.setDefaultSSLSocketFactory(
- context.getSocketFactory());
+ KeyManager[] kms = new KeyManager[1];
+ KeyStore ks = KeyStore.getInstance("JKS");
+ FileInputStream fis = new FileInputStream(keyFilename);
+ ks.load(fis, passwd.toCharArray());
+ fis.close();
+ KeyManager km = new MyKeyManager(ks, passwd.toCharArray());
+ kms[0] = km;
+ context.init(kms, null, null);
+ HttpsURLConnection.setDefaultSSLSocketFactory(
+ context.getSocketFactory());
- /*
- * Start the tests.
- */
- System.out.println("Testing " + keyFilename);
- new ServerIdentityTest(context, keyStoreFiles[i]);
+ /*
+ * Start the tests.
+ */
+ System.out.println("Testing " + keyFilename);
+ new ServerIdentityTest(context, keyStoreFiles[i]);
+ }
+ } finally {
+ HttpsURLConnection.setDefaultSSLSocketFactory(reservedSFactory);
}
}
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/www/protocol/https/HttpsURLConnection/CriticalSubjectAltName.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/www/protocol/https/HttpsURLConnection/CriticalSubjectAltName.java Wed Jul 05 17:49:56 2017 +0200
@@ -26,6 +26,11 @@
* @bug 6668231
* @summary Presence of a critical subjectAltName causes JSSE's SunX509 to
* fail trusted checks
+ * @run main/othervm CriticalSubjectAltName
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
+ *
* @author Xuelei Fan
*
* This test depends on binary keystore, crisubn.jks and trusted.jks. Because
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/www/protocol/https/HttpsURLConnection/GetResponseCode.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/www/protocol/https/HttpsURLConnection/GetResponseCode.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,6 +25,11 @@
* @test
* @bug 4482187
* @summary HttpsClient tests are failing for build 71
+ * @run main/othervm GetResponseCode
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
+ *
* @author Yingxian Wang
*/
import java.io.*;
--- a/jdk/test/sun/security/ssl/javax/net/ssl/Fix5070632.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/javax/net/ssl/Fix5070632.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * 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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,10 @@
* @test
* @bug 5070632
* @summary Default SSLSockeFactory override createSocket() now
+ * @run main/othervm Fix5070632
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @author Weijun Wang
*/
@@ -35,8 +39,13 @@
public class Fix5070632 {
public static void main(String[] args) throws Exception {
+ // reserve the security properties
+ String reservedSFacProvider =
+ Security.getProperty("ssl.SocketFactory.provider");
+
// use a non-existing provider so that the DefaultSSLSocketFactory
// will be used, and then test against it.
+
Security.setProperty("ssl.SocketFactory.provider", "foo.NonExistant");
SSLSocketFactory fac = (SSLSocketFactory)SSLSocketFactory.getDefault();
try {
@@ -46,8 +55,16 @@
System.out.println("Throw SocketException");
se.printStackTrace();
return;
+ } finally {
+ // restore the security properties
+ if (reservedSFacProvider == null) {
+ reservedSFacProvider = "";
+ }
+ Security.setProperty("ssl.SocketFactory.provider",
+ reservedSFacProvider);
}
+
+ // if not caught, or other exception caught, then it's error
throw new Exception("should throw SocketException");
- // if not caught, or other exception caught, then it's error
}
}
--- a/jdk/test/sun/security/ssl/javax/net/ssl/FixingJavadocs/ComURLNulls.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/javax/net/ssl/FixingJavadocs/ComURLNulls.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -27,6 +27,10 @@
* @summary Need to revisit the javadocs for JSSE, especially the
* promoted classes, and HttpsURLConnection.getCipherSuite throws
* NullPointerException
+ * @run main/othervm ComURLNulls
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @author Brad Wetmore
*/
@@ -34,6 +38,7 @@
import java.io.*;
import javax.net.ssl.*;
import com.sun.net.ssl.HttpsURLConnection;
+import com.sun.net.ssl.HostnameVerifier;
/*
* Tests that the com null argument changes made it in ok.
@@ -42,59 +47,64 @@
public class ComURLNulls {
public static void main(String[] args) throws Exception {
-
- System.setProperty("java.protocol.handler.pkgs",
- "com.sun.net.ssl.internal.www.protocol");
- /**
- * This test does not establish any connection to the specified
- * URL, hence a dummy URL is used.
- */
- URL foobar = new URL("https://example.com/");
-
- HttpsURLConnection urlc =
- (HttpsURLConnection) foobar.openConnection();
-
- try {
- urlc.getCipherSuite();
- } catch (IllegalStateException e) {
- System.out.print("Caught proper exception: ");
- System.out.println(e.getMessage());
- }
-
- try {
- urlc.getServerCertificateChain();
- } catch (IllegalStateException e) {
- System.out.print("Caught proper exception: ");
- System.out.println(e.getMessage());
- }
-
+ HostnameVerifier reservedHV =
+ HttpsURLConnection.getDefaultHostnameVerifier();
try {
- urlc.setDefaultHostnameVerifier(null);
- } catch (IllegalArgumentException e) {
- System.out.print("Caught proper exception: ");
- System.out.println(e.getMessage());
- }
+ System.setProperty("java.protocol.handler.pkgs",
+ "com.sun.net.ssl.internal.www.protocol");
+ /**
+ * This test does not establish any connection to the specified
+ * URL, hence a dummy URL is used.
+ */
+ URL foobar = new URL("https://example.com/");
+
+ HttpsURLConnection urlc =
+ (HttpsURLConnection) foobar.openConnection();
- try {
- urlc.setHostnameVerifier(null);
- } catch (IllegalArgumentException e) {
- System.out.print("Caught proper exception: ");
- System.out.println(e.getMessage());
- }
+ try {
+ urlc.getCipherSuite();
+ } catch (IllegalStateException e) {
+ System.out.print("Caught proper exception: ");
+ System.out.println(e.getMessage());
+ }
+
+ try {
+ urlc.getServerCertificateChain();
+ } catch (IllegalStateException e) {
+ System.out.print("Caught proper exception: ");
+ System.out.println(e.getMessage());
+ }
- try {
- urlc.setDefaultSSLSocketFactory(null);
- } catch (IllegalArgumentException e) {
- System.out.print("Caught proper exception: ");
- System.out.println(e.getMessage());
- }
+ try {
+ urlc.setDefaultHostnameVerifier(null);
+ } catch (IllegalArgumentException e) {
+ System.out.print("Caught proper exception: ");
+ System.out.println(e.getMessage());
+ }
+
+ try {
+ urlc.setHostnameVerifier(null);
+ } catch (IllegalArgumentException e) {
+ System.out.print("Caught proper exception: ");
+ System.out.println(e.getMessage());
+ }
- try {
- urlc.setSSLSocketFactory(null);
- } catch (IllegalArgumentException e) {
- System.out.print("Caught proper exception");
- System.out.println(e.getMessage());
+ try {
+ urlc.setDefaultSSLSocketFactory(null);
+ } catch (IllegalArgumentException e) {
+ System.out.print("Caught proper exception: ");
+ System.out.println(e.getMessage());
+ }
+
+ try {
+ urlc.setSSLSocketFactory(null);
+ } catch (IllegalArgumentException e) {
+ System.out.print("Caught proper exception");
+ System.out.println(e.getMessage());
+ }
+ System.out.println("TESTS PASSED");
+ } finally {
+ HttpsURLConnection.setDefaultHostnameVerifier(reservedHV);
}
- System.out.println("TESTS PASSED");
}
}
--- a/jdk/test/sun/security/ssl/javax/net/ssl/FixingJavadocs/ImplicitHandshake.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/javax/net/ssl/FixingJavadocs/ImplicitHandshake.java Wed Jul 05 17:49:56 2017 +0200
@@ -26,6 +26,10 @@
* @bug 4387882
* @summary Need to revisit the javadocs for JSSE, especially the
* promoted classes.
+ * @run main/othervm ImplicitHandshake
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @author Brad Wetmore
*/
--- a/jdk/test/sun/security/ssl/javax/net/ssl/FixingJavadocs/JavaxURLNulls.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/javax/net/ssl/FixingJavadocs/JavaxURLNulls.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -42,63 +42,69 @@
public static void main(String[] args) throws Exception {
- /**
- * This test does not establish any connection to the specified
- * URL, hence a dummy URL is used.
- */
- URL foobar = new URL("https://example.com/");
-
- HttpsURLConnection urlc =
- (HttpsURLConnection) foobar.openConnection();
-
+ HostnameVerifier reservedHV =
+ HttpsURLConnection.getDefaultHostnameVerifier();
try {
- urlc.getCipherSuite();
- } catch (IllegalStateException e) {
- System.out.print("Caught proper exception: ");
- System.out.println(e.getMessage());
- }
+ /**
+ * This test does not establish any connection to the specified
+ * URL, hence a dummy URL is used.
+ */
+ URL foobar = new URL("https://example.com/");
+
+ HttpsURLConnection urlc =
+ (HttpsURLConnection) foobar.openConnection();
+
+ try {
+ urlc.getCipherSuite();
+ } catch (IllegalStateException e) {
+ System.out.print("Caught proper exception: ");
+ System.out.println(e.getMessage());
+ }
+
+ try {
+ urlc.getLocalCertificates();
+ } catch (IllegalStateException e) {
+ System.out.print("Caught proper exception: ");
+ System.out.println(e.getMessage());
+ }
+
+ try {
+ urlc.getServerCertificates();
+ } catch (IllegalStateException e) {
+ System.out.print("Caught proper exception: ");
+ System.out.println(e.getMessage());
+ }
- try {
- urlc.getLocalCertificates();
- } catch (IllegalStateException e) {
- System.out.print("Caught proper exception: ");
- System.out.println(e.getMessage());
- }
+ try {
+ urlc.setDefaultHostnameVerifier(null);
+ } catch (IllegalArgumentException e) {
+ System.out.print("Caught proper exception: ");
+ System.out.println(e.getMessage());
+ }
+
+ try {
+ urlc.setHostnameVerifier(null);
+ } catch (IllegalArgumentException e) {
+ System.out.print("Caught proper exception: ");
+ System.out.println(e.getMessage());
+ }
- try {
- urlc.getServerCertificates();
- } catch (IllegalStateException e) {
- System.out.print("Caught proper exception: ");
- System.out.println(e.getMessage());
+ try {
+ urlc.setDefaultSSLSocketFactory(null);
+ } catch (IllegalArgumentException e) {
+ System.out.print("Caught proper exception: ");
+ System.out.println(e.getMessage());
+ }
+
+ try {
+ urlc.setSSLSocketFactory(null);
+ } catch (IllegalArgumentException e) {
+ System.out.print("Caught proper exception: ");
+ System.out.println(e.getMessage());
+ }
+ System.out.println("TESTS PASSED");
+ } finally {
+ HttpsURLConnection.setDefaultHostnameVerifier(reservedHV);
}
-
- try {
- urlc.setDefaultHostnameVerifier(null);
- } catch (IllegalArgumentException e) {
- System.out.print("Caught proper exception: ");
- System.out.println(e.getMessage());
- }
-
- try {
- urlc.setHostnameVerifier(null);
- } catch (IllegalArgumentException e) {
- System.out.print("Caught proper exception: ");
- System.out.println(e.getMessage());
- }
-
- try {
- urlc.setDefaultSSLSocketFactory(null);
- } catch (IllegalArgumentException e) {
- System.out.print("Caught proper exception: ");
- System.out.println(e.getMessage());
- }
-
- try {
- urlc.setSSLSocketFactory(null);
- } catch (IllegalArgumentException e) {
- System.out.print("Caught proper exception: ");
- System.out.println(e.getMessage());
- }
- System.out.println("TESTS PASSED");
}
}
--- a/jdk/test/sun/security/ssl/javax/net/ssl/FixingJavadocs/SSLSessionNulls.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/javax/net/ssl/FixingJavadocs/SSLSessionNulls.java Wed Jul 05 17:49:56 2017 +0200
@@ -26,6 +26,10 @@
* @bug 4387882
* @summary Need to revisit the javadocs for JSSE, especially the
* promoted classes.
+ * @run main/othervm SSLSessionNulls
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @author Brad Wetmore
*/
--- a/jdk/test/sun/security/ssl/javax/net/ssl/FixingJavadocs/SSLSocketInherit.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/javax/net/ssl/FixingJavadocs/SSLSocketInherit.java Wed Jul 05 17:49:56 2017 +0200
@@ -27,6 +27,10 @@
* @summary Need to revisit the javadocs for JSSE, especially the
* promoted classes. This test checks to see if the settings
* on the server sockets get propagated to the sockets.
+ * @run main/othervm SSLSocketInherit
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @author Brad Wetmore
*/
--- a/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/CheckMyTrustedKeystore.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/CheckMyTrustedKeystore.java Wed Jul 05 17:49:56 2017 +0200
@@ -26,6 +26,10 @@
* @bug 4329114
* @summary Need better way of reflecting the reason when a chain is
* rejected as untrusted.
+ * @run main/othervm CheckMyTrustedKeystore
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @ignore JSSE supports algorithm constraints with CR 6916074,
* need to update this test case in JDK 7 soon
* This is a serious hack job!
--- a/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/HttpsURLConnectionLocalCertificateChain.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/HttpsURLConnectionLocalCertificateChain.java Wed Jul 05 17:49:56 2017 +0200
@@ -30,6 +30,10 @@
* Fixed 4354003: Need API to get client certificate chain
* Fixed 4387961: HostnameVerifier needs to pass various hostnames
* Fixed 4395266: HttpsURLConnection should be made protected
+ * @run main/othervm HttpsURLConnectionLocalCertificateChain
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @author Brad Wetmore
*/
--- a/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/JSSERenegotiate.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/JSSERenegotiate.java Wed Jul 05 17:49:56 2017 +0200
@@ -26,6 +26,10 @@
* @bug 4280338
* @summary "Unsupported SSL message version" SSLProtocolException
* w/SSL_RSA_WITH_NULL_MD5
+ * @run main/othervm JSSERenegotiate
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*
* @author Ram Marti
* @author Brad Wetmore
--- a/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/KeyManagerTrustManager.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/KeyManagerTrustManager.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -35,6 +35,10 @@
* 4396290: Need a way to pass algorithm specific parameters to TM's and KM's
* 4395286: The property for setting the default
* KeyManagerFactory/TrustManagerFactory algorithms needs real name
+ * @run main/othervm KeyManagerTrustManager
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @author Brad Wetmore
*/
@@ -77,17 +81,40 @@
String kmfAlg = null;
String tmfAlg = null;
- Security.setProperty("ssl.KeyManagerFactory.algorithm", "hello");
- Security.setProperty("ssl.TrustManagerFactory.algorithm", "goodbye");
+ // reserve the security properties
+ String reservedKMFacAlg =
+ Security.getProperty("ssl.KeyManagerFactory.algorithm");
+ String reservedTMFacAlg =
+ Security.getProperty("ssl.TrustManagerFactory.algorithm");
- kmfAlg = KeyManagerFactory.getDefaultAlgorithm();
- tmfAlg = TrustManagerFactory.getDefaultAlgorithm();
+ try {
+ Security.setProperty("ssl.KeyManagerFactory.algorithm", "hello");
+ Security.setProperty("ssl.TrustManagerFactory.algorithm",
+ "goodbye");
+
+ kmfAlg = KeyManagerFactory.getDefaultAlgorithm();
+ tmfAlg = TrustManagerFactory.getDefaultAlgorithm();
- if (!kmfAlg.equals("hello")) {
- throw new Exception("ssl.KeyManagerFactory.algorithm not set");
- }
- if (!tmfAlg.equals("goodbye")) {
- throw new Exception("ssl.TrustManagerFactory.algorithm not set");
+ if (!kmfAlg.equals("hello")) {
+ throw new Exception("ssl.KeyManagerFactory.algorithm not set");
+ }
+ if (!tmfAlg.equals("goodbye")) {
+ throw new Exception(
+ "ssl.TrustManagerFactory.algorithm not set");
+ }
+ } finally {
+ // restore the security properties
+ if (reservedKMFacAlg == null) {
+ reservedKMFacAlg = "";
+ }
+
+ if (reservedTMFacAlg == null) {
+ reservedTMFacAlg = "";
+ }
+ Security.setProperty("ssl.KeyManagerFactory.algorithm",
+ reservedKMFacAlg);
+ Security.setProperty("ssl.TrustManagerFactory.algorithm",
+ reservedTMFacAlg);
}
}
}
--- a/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLCtxAccessToSessCtx.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLCtxAccessToSessCtx.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,6 +25,10 @@
* @test
* @bug 4473210
* @summary SSLSessionContext should be accessible from SSLContext
+ * @run main/othervm SSLCtxAccessToSessCtx
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*/
import java.io.*;
--- a/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/AcceptLargeFragments.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/AcceptLargeFragments.java Wed Jul 05 17:49:56 2017 +0200
@@ -26,6 +26,10 @@
* @bug 6388456
* @summary Need adjustable TLS max record size for interoperability
* with non-compliant stacks
+ * @run main/othervm AcceptLargeFragments
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*
* Check the system property "jsse.SSLEngine.acceptLargeFragments"
*
--- a/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/ExtendedKeySocket.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/ExtendedKeySocket.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,6 +25,10 @@
* @test
* @bug 4981697
* @summary Rework the X509KeyManager to avoid incompatibility issues
+ * @run main/othervm ExtendedKeySocket
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @author Brad R. Wetmore
*/
--- a/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/LargePacket.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/LargePacket.java Wed Jul 05 17:49:56 2017 +0200
@@ -27,6 +27,10 @@
* @bug 6388456
* @summary Need adjustable TLS max record size for interoperability
* with non-compliant
+ * @run main/othervm LargePacket
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*
* @author Xuelei Fan
*/
--- a/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/NoAuthClientAuth.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/NoAuthClientAuth.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,6 +25,10 @@
* @test
* @bug 4495742
* @summary Demonstrate SSLEngine switch from no client auth to client auth.
+ * @run main/othervm NoAuthClientAuth
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*
* @author Brad R. Wetmore
*/
--- a/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SessionCacheSizeTests.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SessionCacheSizeTests.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,6 +25,10 @@
* @test
* @bug 4366807
* @summary Need new APIs to get/set session timeout and session cache size.
+ * @run main/othervm SessionCacheSizeTests
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*/
import java.io.*;
--- a/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SessionTimeOutTests.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SessionTimeOutTests.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,6 +25,10 @@
* @test
* @bug 4366807
* @summary Need new APIs to get/set session timeout and session cache size.
+ * @run main/othervm SessionTimeOutTests
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*/
import java.io.*;
@@ -207,7 +211,7 @@
timeout = sessCtx.getSessionTimeout();
System.out.println("timeout is changed to: " + timeout);
System.out.println();
- }
+ }
}
// check the ids returned by the enumerator
--- a/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/testEnabledProtocols.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/testEnabledProtocols.java Wed Jul 05 17:49:56 2017 +0200
@@ -30,6 +30,10 @@
* session
* 4701722 protocol mismatch exceptions should be consistent between
* SSLv3 and TLSv1
+ * @run main/othervm testEnabledProtocols
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @author Ram Marti
*/
--- a/jdk/test/sun/security/ssl/javax/net/ssl/SSLServerSocket/DefaultSSLServSocketFac.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/javax/net/ssl/SSLServerSocket/DefaultSSLServSocketFac.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -25,6 +25,10 @@
* @test
* @bug 6449579
* @summary DefaultSSLServerSocketFactory does not override createServerSocket()
+ * @run main/othervm DefaultSSLServSocketFac
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*/
import java.security.Security;
import javax.net.ServerSocketFactory;
@@ -33,6 +37,10 @@
public class DefaultSSLServSocketFac {
public static void main(String[] args) throws Exception {
+ // reserve the security properties
+ String reservedSSFacProvider =
+ Security.getProperty("ssl.ServerSocketFactory.provider");
+
try {
Security.setProperty("ssl.ServerSocketFactory.provider", "oops");
ServerSocketFactory ssocketFactory =
@@ -44,6 +52,13 @@
throw e;
}
// get the expected exception
+ } finally {
+ // restore the security properties
+ if (reservedSSFacProvider == null) {
+ reservedSSFacProvider = "";
+ }
+ Security.setProperty("ssl.ServerSocketFactory.provider",
+ reservedSSFacProvider);
}
}
}
--- a/jdk/test/sun/security/ssl/javax/net/ssl/TLSv11/EmptyCertificateAuthorities.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/javax/net/ssl/TLSv11/EmptyCertificateAuthorities.java Wed Jul 05 17:49:56 2017 +0200
@@ -27,7 +27,10 @@
* @test
* @bug 4873188
* @summary Support TLS 1.1
- * @run main/othervm -Djavax.net.debug=all EmptyCertificateAuthorities
+ * @run main/othervm EmptyCertificateAuthorities
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*
* @author Xuelei Fan
*/
--- a/jdk/test/sun/security/ssl/javax/net/ssl/TLSv11/ExportableBlockCipher.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/javax/net/ssl/TLSv11/ExportableBlockCipher.java Wed Jul 05 17:49:56 2017 +0200
@@ -27,7 +27,10 @@
* @test
* @bug 4873188
* @summary Support TLS 1.1
- * @run main/othervm -Djavax.net.debug=all ExportableBlockCipher
+ * @run main/othervm ExportableBlockCipher
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*
* @author Xuelei Fan
*/
--- a/jdk/test/sun/security/ssl/javax/net/ssl/TLSv11/ExportableStreamCipher.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/javax/net/ssl/TLSv11/ExportableStreamCipher.java Wed Jul 05 17:49:56 2017 +0200
@@ -27,7 +27,10 @@
* @test
* @bug 4873188
* @summary Support TLS 1.1
- * @run main/othervm -Djavax.net.debug=all ExportableStreamCipher
+ * @run main/othervm ExportableStreamCipher
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*
* @author Xuelei Fan
*/
--- a/jdk/test/sun/security/ssl/javax/net/ssl/TLSv11/GenericBlockCipher.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/javax/net/ssl/TLSv11/GenericBlockCipher.java Wed Jul 05 17:49:56 2017 +0200
@@ -27,7 +27,10 @@
* @test
* @bug 4873188
* @summary Support TLS 1.1
- * @run main/othervm -Djavax.net.debug=all GenericBlockCipher
+ * @run main/othervm GenericBlockCipher
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*
* @author Xuelei Fan
*/
--- a/jdk/test/sun/security/ssl/javax/net/ssl/TLSv11/GenericStreamCipher.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/javax/net/ssl/TLSv11/GenericStreamCipher.java Wed Jul 05 17:49:56 2017 +0200
@@ -27,7 +27,10 @@
* @test
* @bug 4873188
* @summary Support TLS 1.1
- * @run main/othervm -Djavax.net.debug=all GenericStreamCipher
+ * @run main/othervm GenericStreamCipher
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*
* @author Xuelei Fan
*/
--- a/jdk/test/sun/security/ssl/sanity/pluggability/CheckSSLContextExport.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/sanity/pluggability/CheckSSLContextExport.java Wed Jul 05 17:49:56 2017 +0200
@@ -64,8 +64,8 @@
default:
throw new Exception("Internal Test Error!");
}
- System.out.println("Testing with " + (standardCiphers ? "standard" : "custom") +
- " cipher suites");
+ System.out.println("Testing with " +
+ (standardCiphers ? "standard" : "custom") + " cipher suites");
for (int j = 0; j < 4; j++) {
String clsName = null;
try {
@@ -107,11 +107,16 @@
public static void main(String[] argv) throws Exception {
String protocols[] = { "SSL", "TLS" };
- Security.insertProviderAt(new CheckSSLContextExport(protocols), 1);
- for (int i = 0; i < protocols.length; i++) {
- System.out.println("Testing " + protocols[i] + "'s SSLContext");
- test(protocols[i]);
+ Provider extraProvider = new CheckSSLContextExport(protocols);
+ Security.insertProviderAt(extraProvider, 1);
+ try {
+ for (int i = 0; i < protocols.length; i++) {
+ System.out.println("Testing " + protocols[i] + "'s SSLContext");
+ test(protocols[i]);
+ }
+ System.out.println("Test Passed");
+ } finally {
+ Security.removeProvider(extraProvider.getName());
}
- System.out.println("Test Passed");
}
}
--- a/jdk/test/sun/security/ssl/sanity/pluggability/CheckSockFacExport1.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/sanity/pluggability/CheckSockFacExport1.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -26,6 +26,10 @@
* @bug 4635454 6208022
* @summary Check pluggability of SSLSocketFactory and
* SSLServerSocketFactory classes.
+ * @run main/othervm CheckSockFacExport1
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*/
import java.util.*;
@@ -37,36 +41,57 @@
public class CheckSockFacExport1 {
public static void main(String argv[]) throws Exception {
- Security.setProperty("ssl.SocketFactory.provider",
- "MySSLSocketFacImpl");
- MySSLSocketFacImpl.useCustomCipherSuites();
- Security.setProperty("ssl.ServerSocketFactory.provider",
- "MySSLServerSocketFacImpl");
- MySSLServerSocketFacImpl.useCustomCipherSuites();
+ // reserve the security properties
+ String reservedSFacAlg =
+ Security.getProperty("ssl.SocketFactory.provider");
+ String reservedSSFacAlg =
+ Security.getProperty("ssl.ServerSocketFactory.provider");
+
+ try {
+ Security.setProperty("ssl.SocketFactory.provider",
+ "MySSLSocketFacImpl");
+ MySSLSocketFacImpl.useCustomCipherSuites();
+ Security.setProperty("ssl.ServerSocketFactory.provider",
+ "MySSLServerSocketFacImpl");
+ MySSLServerSocketFacImpl.useCustomCipherSuites();
- String[] supportedCS = null;
- for (int i = 0; i < 2; i++) {
- switch (i) {
- case 0:
- System.out.println("Testing SSLSocketFactory:");
- SSLSocketFactory sf = (SSLSocketFactory)
- SSLSocketFactory.getDefault();
- supportedCS = sf.getSupportedCipherSuites();
- break;
- case 1:
- System.out.println("Testing SSLServerSocketFactory:");
- SSLServerSocketFactory ssf = (SSLServerSocketFactory)
- SSLServerSocketFactory.getDefault();
- supportedCS = ssf.getSupportedCipherSuites();
- break;
- default:
- throw new Exception("Internal Test Error");
+ String[] supportedCS = null;
+ for (int i = 0; i < 2; i++) {
+ switch (i) {
+ case 0:
+ System.out.println("Testing SSLSocketFactory:");
+ SSLSocketFactory sf = (SSLSocketFactory)
+ SSLSocketFactory.getDefault();
+ supportedCS = sf.getSupportedCipherSuites();
+ break;
+ case 1:
+ System.out.println("Testing SSLServerSocketFactory:");
+ SSLServerSocketFactory ssf = (SSLServerSocketFactory)
+ SSLServerSocketFactory.getDefault();
+ supportedCS = ssf.getSupportedCipherSuites();
+ break;
+ default:
+ throw new Exception("Internal Test Error");
+ }
+ System.out.println(Arrays.asList(supportedCS));
+ if (supportedCS.length == 0) {
+ throw new Exception("supported ciphersuites are empty");
+ }
}
- System.out.println(Arrays.asList(supportedCS));
- if (supportedCS.length == 0) {
- throw new Exception("supported ciphersuites are empty");
+ System.out.println("Test Passed");
+ } finally {
+ // restore the security properties
+ if (reservedSFacAlg == null) {
+ reservedSFacAlg = "";
}
+
+ if (reservedSSFacAlg == null) {
+ reservedSSFacAlg = "";
+ }
+ Security.setProperty("ssl.SocketFactory.provider",
+ reservedSFacAlg);
+ Security.setProperty("ssl.ServerSocketFactory.provider",
+ reservedSSFacAlg);
}
- System.out.println("Test Passed");
}
}
--- a/jdk/test/sun/security/ssl/sanity/pluggability/CheckSockFacExport2.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/sanity/pluggability/CheckSockFacExport2.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -25,7 +25,11 @@
* @test
* @bug 4635454
* @summary Check pluggability of SSLSocketFactory and
- * SSLServerSocketFactory classes.
+ * SSLServerSocketFactory classes.
+ * @run main/othervm CheckSockFacExport2
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*/
import java.security.*;
import java.net.*;
@@ -34,38 +38,59 @@
public class CheckSockFacExport2 {
public static void main(String argv[]) throws Exception {
- Security.setProperty("ssl.SocketFactory.provider",
- "MySSLSocketFacImpl");
- MySSLSocketFacImpl.useStandardCipherSuites();
- Security.setProperty("ssl.ServerSocketFactory.provider",
- "MySSLServerSocketFacImpl");
- MySSLServerSocketFacImpl.useStandardCipherSuites();
+ // reserve the security properties
+ String reservedSFacAlg =
+ Security.getProperty("ssl.SocketFactory.provider");
+ String reservedSSFacAlg =
+ Security.getProperty("ssl.ServerSocketFactory.provider");
- boolean result = false;
- for (int i = 0; i < 2; i++) {
- switch (i) {
- case 0:
- System.out.println("Testing SSLSocketFactory:");
- SSLSocketFactory sf = (SSLSocketFactory)
- SSLSocketFactory.getDefault();
- result = (sf instanceof MySSLSocketFacImpl);
- break;
+ try {
+ Security.setProperty("ssl.SocketFactory.provider",
+ "MySSLSocketFacImpl");
+ MySSLSocketFacImpl.useStandardCipherSuites();
+ Security.setProperty("ssl.ServerSocketFactory.provider",
+ "MySSLServerSocketFacImpl");
+ MySSLServerSocketFacImpl.useStandardCipherSuites();
+
+ boolean result = false;
+ for (int i = 0; i < 2; i++) {
+ switch (i) {
+ case 0:
+ System.out.println("Testing SSLSocketFactory:");
+ SSLSocketFactory sf = (SSLSocketFactory)
+ SSLSocketFactory.getDefault();
+ result = (sf instanceof MySSLSocketFacImpl);
+ break;
- case 1:
- System.out.println("Testing SSLServerSocketFactory:");
- SSLServerSocketFactory ssf = (SSLServerSocketFactory)
- SSLServerSocketFactory.getDefault();
- result = (ssf instanceof MySSLServerSocketFacImpl);
- break;
- default:
- throw new Exception("Internal Test Error");
+ case 1:
+ System.out.println("Testing SSLServerSocketFactory:");
+ SSLServerSocketFactory ssf = (SSLServerSocketFactory)
+ SSLServerSocketFactory.getDefault();
+ result = (ssf instanceof MySSLServerSocketFacImpl);
+ break;
+ default:
+ throw new Exception("Internal Test Error");
+ }
+ if (result) {
+ System.out.println("...accepted valid SFs");
+ } else {
+ throw new Exception("...wrong SF is used");
+ }
}
- if (result) {
- System.out.println("...accepted valid SFs");
- } else {
- throw new Exception("...wrong SF is used");
+ System.out.println("Test Passed");
+ } finally {
+ // restore the security properties
+ if (reservedSFacAlg == null) {
+ reservedSFacAlg = "";
}
+
+ if (reservedSSFacAlg == null) {
+ reservedSSFacAlg = "";
+ }
+ Security.setProperty("ssl.SocketFactory.provider",
+ reservedSFacAlg);
+ Security.setProperty("ssl.ServerSocketFactory.provider",
+ reservedSSFacAlg);
}
- System.out.println("Test Passed");
}
}
--- a/jdk/test/sun/security/ssl/sun/net/www/http/ChunkedOutputStream/Test.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/sun/net/www/http/ChunkedOutputStream/Test.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * 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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,9 @@
* @bug 5026745
* @library ../../httpstest/
* @run main/othervm Test
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @summary Cannot flush output stream when writing to an HttpUrlConnection
*/
@@ -283,31 +286,37 @@
System.getProperty("test.src", "./") + "/" + pathToStores +
"/" + trustStoreFile;
- System.setProperty("javax.net.ssl.keyStore", keyFilename);
- System.setProperty("javax.net.ssl.keyStorePassword", passwd);
- System.setProperty("javax.net.ssl.trustStore", trustFilename);
- System.setProperty("javax.net.ssl.trustStorePassword", passwd);
- HttpsURLConnection.setDefaultHostnameVerifier(new NameVerifier());
-
+ HostnameVerifier reservedHV =
+ HttpsURLConnection.getDefaultHostnameVerifier();
try {
- server = new HttpServer (new Test(), 1, 10, 0);
- System.out.println ("Server started: listening on port: " + server.getLocalPort());
- // the test server doesn't support keep-alive yet
- // test1("http://localhost:"+server.getLocalPort()+"/d0");
- test1("https://localhost:"+server.getLocalPort()+"/d01");
- test3("https://localhost:"+server.getLocalPort()+"/d3");
- test4("https://localhost:"+server.getLocalPort()+"/d4");
- test5("https://localhost:"+server.getLocalPort()+"/d5");
- test6("https://localhost:"+server.getLocalPort()+"/d6");
- test7("https://localhost:"+server.getLocalPort()+"/d7");
- test8("https://localhost:"+server.getLocalPort()+"/d8");
- } catch (Exception e) {
- if (server != null) {
- server.terminate();
+ System.setProperty("javax.net.ssl.keyStore", keyFilename);
+ System.setProperty("javax.net.ssl.keyStorePassword", passwd);
+ System.setProperty("javax.net.ssl.trustStore", trustFilename);
+ System.setProperty("javax.net.ssl.trustStorePassword", passwd);
+ HttpsURLConnection.setDefaultHostnameVerifier(new NameVerifier());
+
+ try {
+ server = new HttpServer (new Test(), 1, 10, 0);
+ System.out.println ("Server started: listening on port: " + server.getLocalPort());
+ // the test server doesn't support keep-alive yet
+ // test1("http://localhost:"+server.getLocalPort()+"/d0");
+ test1("https://localhost:"+server.getLocalPort()+"/d01");
+ test3("https://localhost:"+server.getLocalPort()+"/d3");
+ test4("https://localhost:"+server.getLocalPort()+"/d4");
+ test5("https://localhost:"+server.getLocalPort()+"/d5");
+ test6("https://localhost:"+server.getLocalPort()+"/d6");
+ test7("https://localhost:"+server.getLocalPort()+"/d7");
+ test8("https://localhost:"+server.getLocalPort()+"/d8");
+ } catch (Exception e) {
+ if (server != null) {
+ server.terminate();
+ }
+ throw e;
}
- throw e;
+ server.terminate();
+ } finally {
+ HttpsURLConnection.setDefaultHostnameVerifier(reservedHV);
}
- server.terminate();
}
static class NameVerifier implements HostnameVerifier {
--- a/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/B6216082.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/B6216082.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -26,9 +26,12 @@
* @bug 6216082
* @library ../../../httpstest/
* @build HttpCallback HttpServer ClosedChannelList HttpTransaction TunnelProxy
+ * @summary Redirect problem with HttpsURLConnection using a proxy
* @run main/othervm B6216082
- * @summary Redirect problem with HttpsURLConnection using a proxy
-*/
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
+ */
import java.io.*;
import java.net.*;
@@ -46,20 +49,27 @@
static InetAddress firstNonLoAddress = null;
public static void main(String[] args) throws Exception {
- // XXX workaround for CNFE
- Class.forName("java.nio.channels.ClosedByInterruptException");
- setupEnv();
+ HostnameVerifier reservedHV =
+ HttpsURLConnection.getDefaultHostnameVerifier();
+ try {
+ // XXX workaround for CNFE
+ Class.forName("java.nio.channels.ClosedByInterruptException");
+ setupEnv();
- startHttpServer();
+ startHttpServer();
- // https.proxyPort can only be set after the TunnelProxy has been
- // created as it will use an ephemeral port.
- System.setProperty( "https.proxyPort", (new Integer(proxy.getLocalPort())).toString() );
+ // https.proxyPort can only be set after the TunnelProxy has been
+ // created as it will use an ephemeral port.
+ System.setProperty("https.proxyPort",
+ (new Integer(proxy.getLocalPort())).toString() );
- makeHttpCall();
+ makeHttpCall();
- if (httpTrans.hasBadRequest) {
- throw new RuntimeException("Test failed : bad http request");
+ if (httpTrans.hasBadRequest) {
+ throw new RuntimeException("Test failed : bad http request");
+ }
+ } finally {
+ HttpsURLConnection.setDefaultHostnameVerifier(reservedHV);
}
}
--- a/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/CloseKeepAliveCached.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/CloseKeepAliveCached.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -26,7 +26,10 @@
* @bug 6618387
* @summary SSL client sessions do not close cleanly. A TCP reset occurs
* instead of a close_notify alert.
- * @run main/othervm -Djavax.net.debug=ssl CloseKeepAliveCached
+ * @run main/othervm CloseKeepAliveCached
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*
* @ignore
* After run the test manually, at the end of the debug output,
@@ -140,13 +143,15 @@
* to avoid infinite hangs.
*/
void doClientSide() throws Exception {
-
/*
* Wait for server to get started.
*/
while (!serverReady) {
Thread.sleep(50);
}
+
+ HostnameVerifier reservedHV =
+ HttpsURLConnection.getDefaultHostnameVerifier();
try {
HttpsURLConnection http = null;
@@ -180,6 +185,8 @@
if (sslServerSocket != null)
sslServerSocket.close();
throw ioex;
+ } finally {
+ HttpsURLConnection.setDefaultHostnameVerifier(reservedHV);
}
}
--- a/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/CookieHandlerTest.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/CookieHandlerTest.java Wed Jul 05 17:49:56 2017 +0200
@@ -22,8 +22,12 @@
*/
/* @test
+ * @bug 4696506 4942650
* @summary Unit test for java.net.CookieHandler
- * @bug 4696506 4942650
+ * @run main/othervm CookieHandlerTest
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @author Yingxian Wang
*/
@@ -182,26 +186,34 @@
System.getProperty("test.src", "./") + "/" + pathToStores +
"/" + trustStoreFile;
- System.setProperty("javax.net.ssl.keyStore", keyFilename);
- System.setProperty("javax.net.ssl.keyStorePassword", passwd);
- System.setProperty("javax.net.ssl.trustStore", trustFilename);
- System.setProperty("javax.net.ssl.trustStorePassword", passwd);
+ CookieHandler reservedCookieHandler = CookieHandler.getDefault();
+ HostnameVerifier reservedHV =
+ HttpsURLConnection.getDefaultHostnameVerifier();
+ try {
+ System.setProperty("javax.net.ssl.keyStore", keyFilename);
+ System.setProperty("javax.net.ssl.keyStorePassword", passwd);
+ System.setProperty("javax.net.ssl.trustStore", trustFilename);
+ System.setProperty("javax.net.ssl.trustStorePassword", passwd);
- if (debug)
- System.setProperty("javax.net.debug", "all");
+ if (debug)
+ System.setProperty("javax.net.debug", "all");
- /*
- * Start the tests.
- */
- cookies = new HashMap<String, String>();
- cookies.put("Cookie",
- "$Version=\"1\"; Customer=\"WILE_E_COYOTE\"; $Path=\"/acme\"");
- cookies.put("Set-Cookie2",
- "$Version=\"1\"; Part_Number=\"Riding_Rocket_0023\"; " +
- "$Path=\"/acme/ammo\"; Part_Number=\"Rocket_Launcher_0001\"; "+
- "$Path=\"/acme\"");
- CookieHandler.setDefault(new MyCookieHandler());
- new CookieHandlerTest();
+ /*
+ * Start the tests.
+ */
+ cookies = new HashMap<String, String>();
+ cookies.put("Cookie",
+ "$Version=\"1\"; Customer=\"WILE_E_COYOTE\"; $Path=\"/acme\"");
+ cookies.put("Set-Cookie2",
+ "$Version=\"1\"; Part_Number=\"Riding_Rocket_0023\"; " +
+ "$Path=\"/acme/ammo\"; Part_Number=\"Rocket_Launcher_0001\"; "+
+ "$Path=\"/acme\"");
+ CookieHandler.setDefault(new MyCookieHandler());
+ new CookieHandlerTest();
+ } finally {
+ HttpsURLConnection.setDefaultHostnameVerifier(reservedHV);
+ CookieHandler.setDefault(reservedCookieHandler);
+ }
}
Thread clientThread = null;
--- a/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/DNSIdentities.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/DNSIdentities.java Wed Jul 05 17:49:56 2017 +0200
@@ -22,8 +22,12 @@
*/
/* @test
+ * @bug 6766775
* @summary X509 certificate hostname checking is broken in JDK1.6.0_10
- * @bug 6766775
+ * @run main/othervm DNSIdentities
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @author Xuelei Fan
*/
@@ -691,34 +695,39 @@
* to avoid infinite hangs.
*/
void doClientSide() throws Exception {
- SSLContext context = getSSLContext(trusedCertStr, clientCertStr,
- clientModulus, clientPrivateExponent, passphrase);
+ SSLContext reservedSSLContext = SSLContext.getDefault();
+ try {
+ SSLContext context = getSSLContext(trusedCertStr, clientCertStr,
+ clientModulus, clientPrivateExponent, passphrase);
- SSLContext.setDefault(context);
+ SSLContext.setDefault(context);
- /*
- * Wait for server to get started.
- */
- while (!serverReady) {
- Thread.sleep(50);
- }
+ /*
+ * Wait for server to get started.
+ */
+ while (!serverReady) {
+ Thread.sleep(50);
+ }
- HttpsURLConnection http = null;
+ HttpsURLConnection http = null;
- /* establish http connection to server */
- URL url = new URL("https://localhost:" + serverPort+"/");
- System.out.println("url is "+url.toString());
+ /* establish http connection to server */
+ URL url = new URL("https://localhost:" + serverPort+"/");
+ System.out.println("url is "+url.toString());
- try {
- http = (HttpsURLConnection)url.openConnection();
+ try {
+ http = (HttpsURLConnection)url.openConnection();
- int respCode = http.getResponseCode();
- System.out.println("respCode = "+respCode);
+ int respCode = http.getResponseCode();
+ System.out.println("respCode = "+respCode);
+ } finally {
+ if (http != null) {
+ http.disconnect();
+ }
+ closeReady = true;
+ }
} finally {
- if (http != null) {
- http.disconnect();
- }
- closeReady = true;
+ SSLContext.setDefault(reservedSSLContext);
}
}
--- a/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/HttpsCreateSockTest.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/HttpsCreateSockTest.java Wed Jul 05 17:49:56 2017 +0200
@@ -24,7 +24,12 @@
/**
* @test
* @bug 6771432
- * @summary createSocket() - smpatch fails using 1.6.0_10 because of "Unconnected sockets not implemented"
+ * @summary createSocket() - smpatch fails using 1.6.0_10 because of
+ * "Unconnected sockets not implemented"
+ * @run main/othervm HttpsCreateSockTest
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*/
import javax.net.SocketFactory;
--- a/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/HttpsPost.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/HttpsPost.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -26,6 +26,10 @@
* @bug 4423074
* @summary Need to rebase all the duplicated classes from Merlin.
* This test will check out http POST
+ * @run main/othervm HttpsPost
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*/
import java.io.*;
@@ -140,34 +144,38 @@
* to avoid infinite hangs.
*/
void doClientSide() throws Exception {
+ HostnameVerifier reservedHV =
+ HttpsURLConnection.getDefaultHostnameVerifier();
+ try {
+ /*
+ * Wait for server to get started.
+ */
+ while (!serverReady) {
+ Thread.sleep(50);
+ }
- /*
- * Wait for server to get started.
- */
- while (!serverReady) {
- Thread.sleep(50);
- }
-
- // Send HTTP POST request to server
- URL url = new URL("https://localhost:"+serverPort);
+ // Send HTTP POST request to server
+ URL url = new URL("https://localhost:"+serverPort);
- HttpsURLConnection.setDefaultHostnameVerifier(
- new NameVerifier());
- HttpsURLConnection http = (HttpsURLConnection)url.openConnection();
- http.setDoOutput(true);
+ HttpsURLConnection.setDefaultHostnameVerifier(new NameVerifier());
+ HttpsURLConnection http = (HttpsURLConnection)url.openConnection();
+ http.setDoOutput(true);
- http.setRequestMethod("POST");
- PrintStream ps = new PrintStream(http.getOutputStream());
- try {
- ps.println(postMsg);
- ps.flush();
- if (http.getResponseCode() != 200) {
- throw new RuntimeException("test Failed");
+ http.setRequestMethod("POST");
+ PrintStream ps = new PrintStream(http.getOutputStream());
+ try {
+ ps.println(postMsg);
+ ps.flush();
+ if (http.getResponseCode() != 200) {
+ throw new RuntimeException("test Failed");
+ }
+ } finally {
+ ps.close();
+ http.disconnect();
+ closeReady = true;
}
} finally {
- ps.close();
- http.disconnect();
- closeReady = true;
+ HttpsURLConnection.setDefaultHostnameVerifier(reservedHV);
}
}
--- a/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/HttpsProxyStackOverflow.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/HttpsProxyStackOverflow.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,6 +25,9 @@
* @test
* @bug 6670868
* @summary StackOverFlow with bad authenticated Proxy tunnels
+ * @run main/othervm HttpsProxyStackOverflow
+ *
+ * No way to reserve default Authenticator, need to run in othervm mode.
*/
import java.io.IOException;
--- a/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/HttpsSocketFacTest.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/HttpsSocketFacTest.java Wed Jul 05 17:49:56 2017 +0200
@@ -26,6 +26,9 @@
* @bug 6614957
* @summary HttpsURLConnection not using the set SSLSocketFactory for creating all its Sockets
* @run main/othervm HttpsSocketFacTest
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*/
import javax.net.SocketFactory;
--- a/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/IPAddressDNSIdentities.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/IPAddressDNSIdentities.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,8 +22,12 @@
*/
/* @test
+ * @bug 6766775
* @summary X509 certificate hostname checking is broken in JDK1.6.0_10
- * @bug 6766775
+ * @run main/othervm IPAddressDNSIdentities
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @author Xuelei Fan
*/
@@ -691,43 +695,48 @@
* to avoid infinite hangs.
*/
void doClientSide() throws Exception {
- SSLContext context = getSSLContext(trusedCertStr, clientCertStr,
- clientModulus, clientPrivateExponent, passphrase);
-
- SSLContext.setDefault(context);
-
- /*
- * Wait for server to get started.
- */
- while (!serverReady) {
- Thread.sleep(50);
- }
-
- HttpsURLConnection http = null;
-
- /* establish http connection to server */
- URL url = new URL("https://127.0.0.1:" + serverPort+"/");
- System.out.println("url is "+url.toString());
-
+ SSLContext reservedSSLContext = SSLContext.getDefault();
try {
- http = (HttpsURLConnection)url.openConnection();
+ SSLContext context = getSSLContext(trusedCertStr, clientCertStr,
+ clientModulus, clientPrivateExponent, passphrase);
+
+ SSLContext.setDefault(context);
- int respCode = http.getResponseCode();
- System.out.println("respCode = " + respCode);
+ /*
+ * Wait for server to get started.
+ */
+ while (!serverReady) {
+ Thread.sleep(50);
+ }
+
+ HttpsURLConnection http = null;
+
+ /* establish http connection to server */
+ URL url = new URL("https://127.0.0.1:" + serverPort+"/");
+ System.out.println("url is "+url.toString());
- throw new Exception("Unexpectly found subject alternative name " +
- "matching IP address");
- } catch (SSLHandshakeException sslhe) {
- // no subject alternative names matching IP address 127.0.0.1 found
- // that's the expected exception, ignore it.
- } catch (IOException ioe) {
- // HttpsClient may throw IOE during checking URL spoofing,
- // that's the expected exception, ignore it.
+ try {
+ http = (HttpsURLConnection)url.openConnection();
+
+ int respCode = http.getResponseCode();
+ System.out.println("respCode = " + respCode);
+
+ throw new Exception("Unexpectly found " +
+ "subject alternative name matching IP address");
+ } catch (SSLHandshakeException sslhe) {
+ // no subject alternative names matching IP address 127.0.0.1
+ // found that's the expected exception, ignore it.
+ } catch (IOException ioe) {
+ // HttpsClient may throw IOE during checking URL spoofing,
+ // that's the expected exception, ignore it.
+ } finally {
+ if (http != null) {
+ http.disconnect();
+ }
+ closeReady = true;
+ }
} finally {
- if (http != null) {
- http.disconnect();
- }
- closeReady = true;
+ SSLContext.setDefault(reservedSSLContext);
}
}
--- a/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/IPAddressIPIdentities.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/IPAddressIPIdentities.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -24,6 +24,10 @@
/* @test
* @summary X509 certificate hostname checking is broken in JDK1.6.0_10
* @bug 6766775
+ * @run main/othervm IPAddressIPIdentities
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @author Xuelei Fan
*/
@@ -692,34 +696,39 @@
* to avoid infinite hangs.
*/
void doClientSide() throws Exception {
- SSLContext context = getSSLContext(trusedCertStr, clientCertStr,
- clientModulus, clientPrivateExponent, passphrase);
+ SSLContext reservedSSLContext = SSLContext.getDefault();
+ try {
+ SSLContext context = getSSLContext(trusedCertStr, clientCertStr,
+ clientModulus, clientPrivateExponent, passphrase);
- SSLContext.setDefault(context);
+ SSLContext.setDefault(context);
- /*
- * Wait for server to get started.
- */
- while (!serverReady) {
- Thread.sleep(50);
- }
+ /*
+ * Wait for server to get started.
+ */
+ while (!serverReady) {
+ Thread.sleep(50);
+ }
- HttpsURLConnection http = null;
+ HttpsURLConnection http = null;
- /* establish http connection to server */
- URL url = new URL("https://127.0.0.1:" + serverPort+"/");
- System.out.println("url is "+url.toString());
+ /* establish http connection to server */
+ URL url = new URL("https://127.0.0.1:" + serverPort+"/");
+ System.out.println("url is "+url.toString());
- try {
- http = (HttpsURLConnection)url.openConnection();
+ try {
+ http = (HttpsURLConnection)url.openConnection();
- int respCode = http.getResponseCode();
- System.out.println("respCode = "+respCode);
+ int respCode = http.getResponseCode();
+ System.out.println("respCode = "+respCode);
+ } finally {
+ if (http != null) {
+ http.disconnect();
+ }
+ closeReady = true;
+ }
} finally {
- if (http != null) {
- http.disconnect();
- }
- closeReady = true;
+ SSLContext.setDefault(reservedSSLContext);
}
}
--- a/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/IPIdentities.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/IPIdentities.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -24,6 +24,10 @@
/* @test
* @summary X509 certificate hostname checking is broken in JDK1.6.0_10
* @bug 6766775
+ * @run main/othervm IPIdentities
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @author Xuelei Fan
*/
@@ -692,34 +696,38 @@
* to avoid infinite hangs.
*/
void doClientSide() throws Exception {
- SSLContext context = getSSLContext(trusedCertStr, clientCertStr,
- clientModulus, clientPrivateExponent, passphrase);
-
- SSLContext.setDefault(context);
+ SSLContext reservedSSLContext = SSLContext.getDefault();
+ try {
+ SSLContext context = getSSLContext(trusedCertStr, clientCertStr,
+ clientModulus, clientPrivateExponent, passphrase);
+ SSLContext.setDefault(context);
- /*
- * Wait for server to get started.
- */
- while (!serverReady) {
- Thread.sleep(50);
- }
+ /*
+ * Wait for server to get started.
+ */
+ while (!serverReady) {
+ Thread.sleep(50);
+ }
- HttpsURLConnection http = null;
+ HttpsURLConnection http = null;
- /* establish http connection to server */
- URL url = new URL("https://localhost:" + serverPort+"/");
- System.out.println("url is "+url.toString());
+ /* establish http connection to server */
+ URL url = new URL("https://localhost:" + serverPort+"/");
+ System.out.println("url is "+url.toString());
- try {
- http = (HttpsURLConnection)url.openConnection();
+ try {
+ http = (HttpsURLConnection)url.openConnection();
- int respCode = http.getResponseCode();
- System.out.println("respCode = "+respCode);
+ int respCode = http.getResponseCode();
+ System.out.println("respCode = "+respCode);
+ } finally {
+ if (http != null) {
+ http.disconnect();
+ }
+ closeReady = true;
+ }
} finally {
- if (http != null) {
- http.disconnect();
- }
- closeReady = true;
+ SSLContext.setDefault(reservedSSLContext);
}
}
--- a/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/Identities.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/Identities.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,8 +22,12 @@
*/
/* @test
+ * @bug 6766775
* @summary X509 certificate hostname checking is broken in JDK1.6.0_10
- * @bug 6766775
+ * @run main/othervm Identities
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @author Xuelei Fan
*/
@@ -691,34 +695,39 @@
* to avoid infinite hangs.
*/
void doClientSide() throws Exception {
- SSLContext context = getSSLContext(trusedCertStr, clientCertStr,
- clientModulus, clientPrivateExponent, passphrase);
+ SSLContext reservedSSLContext = SSLContext.getDefault();
+ try {
+ SSLContext context = getSSLContext(trusedCertStr, clientCertStr,
+ clientModulus, clientPrivateExponent, passphrase);
- SSLContext.setDefault(context);
+ SSLContext.setDefault(context);
- /*
- * Wait for server to get started.
- */
- while (!serverReady) {
- Thread.sleep(50);
- }
+ /*
+ * Wait for server to get started.
+ */
+ while (!serverReady) {
+ Thread.sleep(50);
+ }
- HttpsURLConnection http = null;
+ HttpsURLConnection http = null;
- /* establish http connection to server */
- URL url = new URL("https://localhost:" + serverPort+"/");
- System.out.println("url is "+url.toString());
+ /* establish http connection to server */
+ URL url = new URL("https://localhost:" + serverPort+"/");
+ System.out.println("url is "+url.toString());
- try {
- http = (HttpsURLConnection)url.openConnection();
+ try {
+ http = (HttpsURLConnection)url.openConnection();
- int respCode = http.getResponseCode();
- System.out.println("respCode = "+respCode);
+ int respCode = http.getResponseCode();
+ System.out.println("respCode = "+respCode);
+ } finally {
+ if (http != null) {
+ http.disconnect();
+ }
+ closeReady = true;
+ }
} finally {
- if (http != null) {
- http.disconnect();
- }
- closeReady = true;
+ SSLContext.setDefault(reservedSSLContext);
}
}
--- a/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -147,44 +147,50 @@
static String postMsg = "Testing HTTP post on a https server";
static void doClientSide(String hostname) throws Exception {
- /*
- * setup up a proxy
- */
- setupProxy();
-
- /*
- * we want to avoid URLspoofCheck failures in cases where the cert
- * DN name does not match the hostname in the URL.
- */
- HttpsURLConnection.setDefaultHostnameVerifier(
- new NameVerifier());
- URL url = new URL("https://" + hostname+ ":" + serverPort);
-
- HttpsURLConnection https = (HttpsURLConnection)url.openConnection();
- https.setDoOutput(true);
- https.setRequestMethod("POST");
- PrintStream ps = null;
+ HostnameVerifier reservedHV =
+ HttpsURLConnection.getDefaultHostnameVerifier();
try {
- ps = new PrintStream(https.getOutputStream());
- ps.println(postMsg);
- ps.flush();
- if (https.getResponseCode() != 200) {
- throw new RuntimeException("test Failed");
- }
- ps.close();
+ /*
+ * setup up a proxy
+ */
+ setupProxy();
+
+ /*
+ * we want to avoid URLspoofCheck failures in cases where the cert
+ * DN name does not match the hostname in the URL.
+ */
+ HttpsURLConnection.setDefaultHostnameVerifier(
+ new NameVerifier());
+ URL url = new URL("https://" + hostname+ ":" + serverPort);
- // clear the pipe
- BufferedReader in = new BufferedReader(
- new InputStreamReader(
- https.getInputStream()));
- String inputLine;
- while ((inputLine = in.readLine()) != null)
- System.out.println("Client received: " + inputLine);
- in.close();
- } catch (SSLException e) {
- if (ps != null)
- ps.close();
- throw e;
+ HttpsURLConnection https = (HttpsURLConnection)url.openConnection();
+ https.setDoOutput(true);
+ https.setRequestMethod("POST");
+ PrintStream ps = null;
+ try {
+ ps = new PrintStream(https.getOutputStream());
+ ps.println(postMsg);
+ ps.flush();
+ if (https.getResponseCode() != 200) {
+ throw new RuntimeException("test Failed");
+ }
+ ps.close();
+
+ // clear the pipe
+ BufferedReader in = new BufferedReader(
+ new InputStreamReader(
+ https.getInputStream()));
+ String inputLine;
+ while ((inputLine = in.readLine()) != null)
+ System.out.println("Client received: " + inputLine);
+ in.close();
+ } catch (SSLException e) {
+ if (ps != null)
+ ps.close();
+ throw e;
+ }
+ } finally {
+ HttpsURLConnection.setDefaultHostnameVerifier(reservedHV);
}
}
--- a/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/ReadTimeout.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/ReadTimeout.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -24,7 +24,13 @@
/*
* @test
* @bug 4811482 4700777 4905410
- * @summary sun.net.client.defaultConnectTimeout should work with HttpsURLConnection; HTTP client: Connect and read timeouts; Https needs to support new tiger features that went into http
+ * @summary sun.net.client.defaultConnectTimeout should work with
+ * HttpsURLConnection; HTTP client: Connect and read timeouts;
+ * Https needs to support new tiger features that went into http
+ * @run main/othervm ReadTimeout
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*/
import java.io.*;
@@ -143,44 +149,48 @@
* to avoid infinite hangs.
*/
void doClientSide() throws Exception {
+ HostnameVerifier reservedHV =
+ HttpsURLConnection.getDefaultHostnameVerifier();
+ try {
+ /*
+ * Wait for server to get started.
+ */
+ while (!serverReady) {
+ Thread.sleep(50);
+ }
+ HttpsURLConnection http = null;
+ try {
+ URL url = new URL("https://localhost:"+serverPort);
- /*
- * Wait for server to get started.
- */
- while (!serverReady) {
- Thread.sleep(50);
- }
- HttpsURLConnection http = null;
- try {
- URL url = new URL("https://localhost:"+serverPort);
-
- // set read timeout through system property
- System.setProperty("sun.net.client.defaultReadTimeout", "2000");
- HttpsURLConnection.setDefaultHostnameVerifier(
- new NameVerifier());
- http = (HttpsURLConnection)url.openConnection();
+ // set read timeout through system property
+ System.setProperty("sun.net.client.defaultReadTimeout", "2000");
+ HttpsURLConnection.setDefaultHostnameVerifier(
+ new NameVerifier());
+ http = (HttpsURLConnection)url.openConnection();
- InputStream is = http.getInputStream ();
- } catch (SocketTimeoutException stex) {
- done();
- http.disconnect();
- }
+ InputStream is = http.getInputStream ();
+ } catch (SocketTimeoutException stex) {
+ done();
+ http.disconnect();
+ }
- try {
- URL url = new URL("https://localhost:"+serverPort);
+ try {
+ URL url = new URL("https://localhost:"+serverPort);
- HttpsURLConnection.setDefaultHostnameVerifier(
- new NameVerifier());
- http = (HttpsURLConnection)url.openConnection();
- // set read timeout through API
- http.setReadTimeout(2000);
+ HttpsURLConnection.setDefaultHostnameVerifier(
+ new NameVerifier());
+ http = (HttpsURLConnection)url.openConnection();
+ // set read timeout through API
+ http.setReadTimeout(2000);
- InputStream is = http.getInputStream ();
- } catch (SocketTimeoutException stex) {
- done();
- http.disconnect();
+ InputStream is = http.getInputStream ();
+ } catch (SocketTimeoutException stex) {
+ done();
+ http.disconnect();
+ }
+ } finally {
+ HttpsURLConnection.setDefaultHostnameVerifier(reservedHV);
}
-
}
static class NameVerifier implements HostnameVerifier {
--- a/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/Redirect.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/Redirect.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -26,6 +26,10 @@
* @bug 4423074
* @summary Need to rebase all the duplicated classes from Merlin.
* This test will check out http POST
+ * @run main/othervm Redirect
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*/
import java.io.*;
@@ -139,28 +143,33 @@
* to avoid infinite hangs.
*/
void doClientSide() throws Exception {
-
- /*
- * Wait for server to get started.
- */
- while (!serverReady) {
- Thread.sleep(50);
- }
+ HostnameVerifier reservedHV =
+ HttpsURLConnection.getDefaultHostnameVerifier();
+ try {
+ /*
+ * Wait for server to get started.
+ */
+ while (!serverReady) {
+ Thread.sleep(50);
+ }
- // Send HTTP POST request to server
- URL url = new URL("https://localhost:"+serverPort);
+ // Send HTTP POST request to server
+ URL url = new URL("https://localhost:"+serverPort);
- HttpsURLConnection.setDefaultHostnameVerifier(
- new NameVerifier());
- HttpsURLConnection http = (HttpsURLConnection)url.openConnection();
- try {
- System.out.println("response header: "+http.getHeaderField(0));
- if (http.getResponseCode() != 200) {
- throw new RuntimeException("test Failed");
+ HttpsURLConnection.setDefaultHostnameVerifier(
+ new NameVerifier());
+ HttpsURLConnection http = (HttpsURLConnection)url.openConnection();
+ try {
+ System.out.println("response header: "+http.getHeaderField(0));
+ if (http.getResponseCode() != 200) {
+ throw new RuntimeException("test Failed");
+ }
+ } finally {
+ http.disconnect();
+ closeReady = true;
}
} finally {
- http.disconnect();
- closeReady = true;
+ HttpsURLConnection.setDefaultHostnameVerifier(reservedHV);
}
}
--- a/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/RetryHttps.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/RetryHttps.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,8 +22,12 @@
*/
/* @test
+ * @bug 4799427
* @summary Https can not retry request
- * @bug 4799427
+ * @run main/othervm RetryHttps
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @author Yingxian Wang
*/
@@ -129,36 +133,41 @@
* to avoid infinite hangs.
*/
void doClientSide() throws Exception {
-
- /*
- * Wait for server to get started.
- */
- while (!serverReady) {
- Thread.sleep(50);
- }
+ HostnameVerifier reservedHV =
+ HttpsURLConnection.getDefaultHostnameVerifier();
try {
- HttpsURLConnection http = null;
- /* establish http connection to server */
- URL url = new URL("https://localhost:" + serverPort+"/file1");
- System.out.println("url is "+url.toString());
- HttpsURLConnection.setDefaultHostnameVerifier(new NameVerifier());
- http = (HttpsURLConnection)url.openConnection();
- int respCode = http.getResponseCode();
- int cl = http.getContentLength();
- InputStream is = http.getInputStream ();
- int count = 0;
- while (is.read() != -1 && count++ < cl);
- System.out.println("respCode1 = "+respCode);
- Thread.sleep(2000);
- url = new URL("https://localhost:" + serverPort+"/file2");
- http = (HttpsURLConnection)url.openConnection();
- respCode = http.getResponseCode();
- System.out.println("respCode2 = "+respCode);
-
- } catch (IOException ioex) {
- if (sslServerSocket != null)
- sslServerSocket.close();
- throw ioex;
+ /*
+ * Wait for server to get started.
+ */
+ while (!serverReady) {
+ Thread.sleep(50);
+ }
+ try {
+ HttpsURLConnection http = null;
+ /* establish http connection to server */
+ URL url = new URL("https://localhost:" + serverPort+"/file1");
+ System.out.println("url is "+url.toString());
+ HttpsURLConnection.setDefaultHostnameVerifier(
+ new NameVerifier());
+ http = (HttpsURLConnection)url.openConnection();
+ int respCode = http.getResponseCode();
+ int cl = http.getContentLength();
+ InputStream is = http.getInputStream ();
+ int count = 0;
+ while (is.read() != -1 && count++ < cl);
+ System.out.println("respCode1 = "+respCode);
+ Thread.sleep(2000);
+ url = new URL("https://localhost:" + serverPort+"/file2");
+ http = (HttpsURLConnection)url.openConnection();
+ respCode = http.getResponseCode();
+ System.out.println("respCode2 = "+respCode);
+ } catch (IOException ioex) {
+ if (sslServerSocket != null)
+ sslServerSocket.close();
+ throw ioex;
+ }
+ } finally {
+ HttpsURLConnection.setDefaultHostnameVerifier(reservedHV);
}
}
--- a/jdk/test/sun/security/ssl/sun/net/www/protocol/https/NewImpl/ComHTTPSConnection.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/sun/net/www/protocol/https/NewImpl/ComHTTPSConnection.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -25,6 +25,10 @@
* @test
* @bug 4474255
* @summary Can no longer obtain a com.sun.net.ssl.HttpsURLConnection
+ * @run main/othervm ComHTTPSConnection
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @author Brad Wetmore
*/
@@ -198,44 +202,50 @@
Thread.sleep(50);
}
- System.setProperty("java.protocol.handler.pkgs",
- "com.sun.net.ssl.internal.www.protocol");
- HttpsURLConnection.setDefaultHostnameVerifier(new NameVerifier());
-
- URL url = new URL("https://" + "localhost:" + serverPort +
- "/etc/hosts");
- URLConnection urlc = url.openConnection();
-
- if (!(urlc instanceof com.sun.net.ssl.HttpsURLConnection)) {
- throw new Exception(
- "URLConnection ! instanceof " +
- "com.sun.net.ssl.HttpsURLConnection");
- }
+ HostnameVerifier reservedHV =
+ HttpsURLConnection.getDefaultHostnameVerifier();
+ try {
+ System.setProperty("java.protocol.handler.pkgs",
+ "com.sun.net.ssl.internal.www.protocol");
+ HttpsURLConnection.setDefaultHostnameVerifier(new NameVerifier());
- BufferedReader in = null;
- try {
- in = new BufferedReader(new InputStreamReader(
- urlc.getInputStream()));
- String inputLine;
- System.out.print("Client reading... ");
- while ((inputLine = in.readLine()) != null)
- System.out.println(inputLine);
+ URL url = new URL("https://" + "localhost:" + serverPort +
+ "/etc/hosts");
+ URLConnection urlc = url.openConnection();
- System.out.println("Cipher Suite: " +
- ((HttpsURLConnection)urlc).getCipherSuite());
- X509Certificate[] certs =
- ((HttpsURLConnection)urlc).getServerCertificateChain();
- for (int i = 0; i < certs.length; i++) {
- System.out.println(certs[0]);
+ if (!(urlc instanceof com.sun.net.ssl.HttpsURLConnection)) {
+ throw new Exception(
+ "URLConnection ! instanceof " +
+ "com.sun.net.ssl.HttpsURLConnection");
}
- in.close();
- } catch (SSLException e) {
- if (in != null)
+ BufferedReader in = null;
+ try {
+ in = new BufferedReader(new InputStreamReader(
+ urlc.getInputStream()));
+ String inputLine;
+ System.out.print("Client reading... ");
+ while ((inputLine = in.readLine()) != null)
+ System.out.println(inputLine);
+
+ System.out.println("Cipher Suite: " +
+ ((HttpsURLConnection)urlc).getCipherSuite());
+ X509Certificate[] certs =
+ ((HttpsURLConnection)urlc).getServerCertificateChain();
+ for (int i = 0; i < certs.length; i++) {
+ System.out.println(certs[0]);
+ }
+
in.close();
- throw e;
+ } catch (SSLException e) {
+ if (in != null)
+ in.close();
+ throw e;
+ }
+ System.out.println("Client reports: SUCCESS");
+ } finally {
+ HttpsURLConnection.setDefaultHostnameVerifier(reservedHV);
}
- System.out.println("Client reports: SUCCESS");
}
static class NameVerifier implements HostnameVerifier {
--- a/jdk/test/sun/security/ssl/sun/net/www/protocol/https/NewImpl/ComHostnameVerifier.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/sun/net/www/protocol/https/NewImpl/ComHostnameVerifier.java Wed Jul 05 17:49:56 2017 +0200
@@ -28,6 +28,10 @@
* @bug 4484246
* @summary When an application enables anonymous SSL cipher suite,
* Hostname verification is not required
+ * @run main/othervm ComHostnameVerifier
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*/
import java.io.*;
--- a/jdk/test/sun/security/ssl/sun/net/www/protocol/https/NewImpl/JavaxHTTPSConnection.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/sun/net/www/protocol/https/NewImpl/JavaxHTTPSConnection.java Wed Jul 05 17:49:56 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -25,6 +25,10 @@
* @test
* @bug 4474255
* @summary Can no longer obtain a com.sun.net.ssl.HttpsURLConnection
+ * @run main/othervm JavaxHTTPSConnection
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @author Brad Wetmore
*/
@@ -189,47 +193,53 @@
* to avoid infinite hangs.
*/
void doClientSide() throws Exception {
- /*
- * Wait for server to get started.
- */
- while (!serverReady) {
- Thread.sleep(50);
- }
-
- HttpsURLConnection.setDefaultHostnameVerifier(new NameVerifier());
- URL url = new URL("https://" + "localhost:" + serverPort +
- "/etc/hosts");
- URLConnection urlc = url.openConnection();
+ HostnameVerifier reservedHV =
+ HttpsURLConnection.getDefaultHostnameVerifier();
+ try {
+ /*
+ * Wait for server to get started.
+ */
+ while (!serverReady) {
+ Thread.sleep(50);
+ }
- if (!(urlc instanceof javax.net.ssl.HttpsURLConnection)) {
- throw new Exception(
- "URLConnection ! instanceof javax.net.ssl.HttpsURLConnection");
- }
+ HttpsURLConnection.setDefaultHostnameVerifier(new NameVerifier());
+ URL url = new URL("https://" + "localhost:" + serverPort +
+ "/etc/hosts");
+ URLConnection urlc = url.openConnection();
- BufferedReader in = null;
- try {
- in = new BufferedReader(new InputStreamReader(
- urlc.getInputStream()));
- String inputLine;
- System.out.print("Client reading... ");
- while ((inputLine = in.readLine()) != null)
- System.out.println(inputLine);
-
- System.out.println("Cipher Suite: " +
- ((HttpsURLConnection)urlc).getCipherSuite());
- Certificate[] certs =
- ((HttpsURLConnection)urlc).getServerCertificates();
- for (int i = 0; i < certs.length; i++) {
- System.out.println(certs[0]);
+ if (!(urlc instanceof javax.net.ssl.HttpsURLConnection)) {
+ throw new Exception("URLConnection ! instanceof " +
+ "javax.net.ssl.HttpsURLConnection");
}
- in.close();
- } catch (SSLException e) {
- if (in != null)
+ BufferedReader in = null;
+ try {
+ in = new BufferedReader(new InputStreamReader(
+ urlc.getInputStream()));
+ String inputLine;
+ System.out.print("Client reading... ");
+ while ((inputLine = in.readLine()) != null)
+ System.out.println(inputLine);
+
+ System.out.println("Cipher Suite: " +
+ ((HttpsURLConnection)urlc).getCipherSuite());
+ Certificate[] certs =
+ ((HttpsURLConnection)urlc).getServerCertificates();
+ for (int i = 0; i < certs.length; i++) {
+ System.out.println(certs[0]);
+ }
+
in.close();
- throw e;
+ } catch (SSLException e) {
+ if (in != null)
+ in.close();
+ throw e;
+ }
+ System.out.println("Client reports: SUCCESS");
+ } finally {
+ HttpsURLConnection.setDefaultHostnameVerifier(reservedHV);
}
- System.out.println("Client reports: SUCCESS");
}
static class NameVerifier implements HostnameVerifier {
--- a/jdk/test/sun/security/ssl/sun/net/www/protocol/https/NewImpl/JavaxHostnameVerifier.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/sun/net/www/protocol/https/NewImpl/JavaxHostnameVerifier.java Wed Jul 05 17:49:56 2017 +0200
@@ -28,6 +28,10 @@
* @bug 4484246
* @summary When an application enables anonymous SSL cipher suite,
* Hostname verification is not required
+ * @run main/othervm JavaxHostnameVerifier
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*/
import java.io.*;
--- a/jdk/test/sun/security/ssl/templates/SSLEngineTemplate.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/templates/SSLEngineTemplate.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,7 +25,10 @@
* @test
* @bug 1234567
* @summary SSLEngine has not yet caused Solaris kernel to panic
+ * @run main/othervm SSLEngineTemplate
*
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
*/
/**
--- a/jdk/test/sun/security/ssl/templates/SSLSocketTemplate.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/ssl/templates/SSLSocketTemplate.java Wed Jul 05 17:49:56 2017 +0200
@@ -25,6 +25,10 @@
* @test
* @bug 1234567
* @summary Use this template to help speed your client/server tests.
+ * @run main/othervm SSLSocketTemplate
+ *
+ * SunJSSE does not support dynamic system properties, no way to re-use
+ * system properties in samevm/agentvm mode.
* @author Brad Wetmore
*/
--- a/jdk/test/sun/security/tools/jarsigner/concise_jarsigner.sh Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/tools/jarsigner/concise_jarsigner.sh Wed Jul 05 17:49:56 2017 +0200
@@ -44,7 +44,10 @@
;;
esac
-KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore js.jks"
+# Choose 512-bit RSA to make sure it runs fine and fast on all platforms. In fact,
+# every keyalg/keysize combination is OK for this test.
+
+KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore js.jks -keyalg rsa -keysize 512"
JAR=$TESTJAVA${FS}bin${FS}jar
JARSIGNER=$TESTJAVA${FS}bin${FS}jarsigner
JAVAC=$TESTJAVA${FS}bin${FS}javac
--- a/jdk/test/sun/security/tools/keytool/StartDateTest.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/tools/keytool/StartDateTest.java Wed Jul 05 17:49:56 2017 +0200
@@ -132,7 +132,9 @@
static Date getIssueDate() throws Exception {
KeyStore ks = KeyStore.getInstance("jks");
- ks.load(new FileInputStream("jks"), "changeit".toCharArray());
+ try (FileInputStream fis = new FileInputStream("jks")) {
+ ks.load(fis, "changeit".toCharArray());
+ }
X509Certificate cert = (X509Certificate)ks.getCertificate("me");
return cert.getNotBefore();
}
--- a/jdk/test/sun/security/x509/AlgorithmId/ExtensibleAlgorithmId.java Thu Sep 01 13:54:50 2011 -0700
+++ b/jdk/test/sun/security/x509/AlgorithmId/ExtensibleAlgorithmId.java Wed Jul 05 17:49:56 2017 +0200
@@ -24,9 +24,12 @@
/*
* @test
* @bug 4162868
+ * @run main/othervm ExtensibleAlgorithmId
* @summary Algorithm Name-to-OID mapping needs to be made extensible.
*/
+// Run in othervm, coz AlgorithmId.oidTable is only initialized once
+
import java.security.*;
import sun.security.x509.AlgorithmId;